View on GitHub

malachite

An arbitrary-precision arithmetic library for Rust.

How Malachite Is Tested

Arbitrary-precision arithmetic is easy to get subtly wrong and hard to notice when it is: a carry dropped once in a million limbs, a rounding tie resolved the wrong way at one exponent, a threshold crossed into an algorithm that was never exercised. Malachite’s answer is differential testing at scale. Every public function is run against independent implementations of the same mathematics, over millions of inputs drawn from several generators, and any disagreement fails the build.

These pages record, function by function, which independent checks each operation has. They are the inverse of the mapping pages: those tell you what to call in Malachite for a function of another library; these tell you what else has computed the same answers as the Malachite function you are calling. A row with no checks is a row we intend to fill.

The oracles

Every function also has unit tests with hand-picked edge cases and property tests of its algebraic identities ((a + b) - b = a, gcd(a, b) | a, round-trips through strings), run over exhaustive, random, and “special” random generators that favor the limb boundaries and extreme values where implementations fail. Those are not listed per function, because every function has them; the columns record only what is independent of Malachite.

The pages

Pages for the polynomial types will follow.