Repository navigation
Highlights
- Polynomials. Four new univariate polynomial types:
UnsignedPolynomial<T>(malachite-base),NaturalPolynomialandIntegerPolynomial(malachite-nz), andRationalPolynomial(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'sfmpz_poly,fmpq_poly,fmpz_mod_poly, andnmod_poly. - Hyperbolic functions for
Float.sinh,cosh,sinh_cosh,tanh,sech,csch,coth,asinh,acosh,atanh,asech,acsch, andacoth, all correctly rounded, each with a variant that takesRationalinput. - LaTeX and Typst output. New
ToLatexandToTypsttraits 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_serdefeature.
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
Debugfor the Gaussian and polynomial types now matchesDisplay.Rational::to_height,into_height, andheight_significant_bitsmoved to the newHeighttrait. Importmalachite_base::num::arithmetic::traits::Height.canonicalize_unitnow returns 1 for every nonzero element of a field (Rational,GaussianRational,Float,f32,f64).
See CHANGELOG.md for the full list.