Skip to content

v0.13.0

Latest

Choose a tag to compare

@mhogrefe mhogrefe released this 07 Oct 21:25
· 113 commits to master since this release

Highlights

  • Polynomials. Four new univariate polynomial types: UnsignedPolynomial<T> (malachite-base), NaturalPolynomial and IntegerPolynomial (malachite-nz), and RationalPolynomial (malachite-q). They support arithmetic, including fast multiplication and powers, along with modular and mod-2^k variants, derivatives and integrals, evaluation, content and primitive part, and parsing and printing. Coverage follows FLINT's fmpz_poly, fmpq_poly, fmpz_mod_poly, and nmod_poly.
  • Hyperbolic functions for Float. sinh, cosh, sinh_cosh, tanh, sech, csch, coth, asinh, acosh, atanh, asech, acsch, and acoth, all correctly rounded, each with a variant that takes Rational input.
  • LaTeX and Typst output. New ToLatex and ToTypst traits write math-mode fragments for the primitive types, collections, and every Malachite number and polynomial type.
  • Serde support for the polynomial types, under the new enable_serde feature.

Testing: the Azurite oracle

Malachite is now also tested against Azurite, a bignum library written in Lean 4 whose operations are proven correct. An oracle executable reads the output of Malachite's demos, recomputes every line, and reports any disagreement. It covers many functions on naturals, integers, modular arithmetic, rationals, and floats, alongside the existing FLINT, GMP, MPFR, and num checks. However, overall coverage is still fairly low and will improve in the future. The new verification pages record, function by function, which independent implementations each operation is checked against. New mapping pages cover Azurite and FLINT's polynomial types.

Breaking changes

  • Debug for the Gaussian and polynomial types now matches Display.
  • Rational::to_height, into_height, and height_significant_bits moved to the new Height trait. Import malachite_base::num::arithmetic::traits::Height.
  • canonicalize_unit now returns 1 for every nonzero element of a field (Rational, GaussianRational, Float, f32, f64).

See CHANGELOG.md for the full list.