Trending

World technology news

→
Archive photograph from a mathematics lecture with formulas on a blackboard.
crates.ioIn-depth report

Multidouble 6.2.1 publishes expanded-precision numerical software for Rust

The package combines ordinary double-precision values into expansions, with scalar and eight-lane vector operations.

·crates.io
Reading progress0%

Release and representation

Multidouble 6.2.1 appeared on crates.io on November 29 at 00:05:46 UTC, with a separate Docs.rs build record. The package exposes two-, four-, and eight-part floating-point expansions for Rust. Each value can be represented as a sum of multiple 64-bit floating-point parts. The documented API includes scalar types, eight-lane vector types, and linear algebra helpers. An application still needs to decide where it creates the wider representation and where conversions take place.

A subtraction fixture

Subtracting two nearly equal values can leave few useful digits in an ordinary calculation. Converting after inputs have already rounded away their difference cannot recover it. Construct the inputs in the intended representation before doing the arithmetic. One fixture can add a small contribution to a large value and then subtract the large part. Record how the inputs were produced and the type of each intermediate result.

Scalar and eight-lane results

The documentation describes eight-lane types for AVX-512, AVX2, SSE2, NEON, and portable implementations, with scalar-equivalent bit patterns for documented operations. Compare identical inputs through both paths and preserve lane order when inspecting the results. This check assesses numerical agreement. Record the operation, target features, and processor separately if the question also concerns throughput.

Selected operations trade accuracy for speed

The documentation lists `DD::fast_div` and `OD::sloppy_mul` as examples of operations with different accuracy trade-offs. Compare the faster path with the baseline for representative inputs. A maximum deviation, a decision threshold, and the handling of special values can each matter. If overflow or underflow is relevant, check whether the stated error bound covers that case.

Start with a small linear system

The package describes dense LU factorizations in the expanded types. Start with a small system with a known solution, then compare it with another containing closely related columns. Multiply the computed solution by the original matrix and inspect the residual. Record the input scale and a justified tolerance. A documentation build confirms the package exists in that form. Numerical suitability depends on the actual workload.

Printed decimals are a separate output

A decimal formatter may show fewer digits than the internal representation retains. Two operations can print the same text while producing different bits. Test internal values directly when bitwise equivalence matters and use the formatted output for reporting. A graph label has different precision needs from a regression fixture. Preserve the original input text and the type that parses it. A comparison can look inconsistent when scalar and vector tests start from separately rounded constants. Construct the fixture once, send the same values to both paths, and compare them in lane order before making claims about processor differences.

Archive photo · Tungsten / Wikimedia Commons ↗ · Public domain

Sources and verification
Be the first reader ✎ Write a comment

Reader discussion

Discussion prompt

What would you change first for maintainability and testing in your own project?

No comments yet. Be the first to contribute.

Write a comment

Comments are real visitor contributions. Repeated, link-heavy or abusive submissions may be limited.