Skip to content

Releases: mhogrefe/malachite

v0.5.0

03 Feb 06:54
Compare
Choose a tag to compare

I am reinstating some import changes that I reverted in 0.4.x, since they were breaking changes there. I'm also changing the constants in the platform module to pub(crate), since I only want the types to be visible.

v0.4.22

03 Feb 03:54
Compare
Choose a tag to compare

I recently changed the way the malachite crate re-exported its sub-crate items, in this commit. This was a breaking change and caused some failures in downstream crates, so I'm reverting it in this release and in a few hours I will re-release it in v0.5.0.

v0.4.21

30 Jan 22:29
Compare
Choose a tag to compare

Tweaked the documentation just a bit more. Should be good now.

v0.4.20

30 Jan 22:06
Compare
Choose a tag to compare

Some of the documentation for the top-level malachite crate didn't work as intended in the v0.4.19 release, so I'm releasing again.

v0.4.19

30 Jan 21:44
Compare
Choose a tag to compare

This is a small release to address the following issues:

#39
#56
#57

Also, I've made some changes to how the main malachite crate re-exports the sub-crate items. The items from malachite-base are now under a base module, and the platform module from malachite-nz, containing items like Limb, is now exported.

v0.4.18

25 Jan 00:41
Compare
Choose a tag to compare

My attempt at publishing 0.4.17 failed, and I am forced to increment the version to try again.

v0.4.17

25 Jan 00:25
Compare
Choose a tag to compare

I wasn't planning on releasing today, but after pishleback found a multiplication bug I wanted to push out a fix ASAP. I also released the partially-completed work that I've been doing on Malachite in the last few months.

  • I rewrote a significant portion of malachite-float to exactly match the overflow and underflow behavior of MPFR. There are also explicit Float::MAX_EXPONENT and Float::MIN_EXPONENT constants now. This work is complete except for division of Floats by Floats, division of Floats by Rationals, division of Rationals by Floats, and multiplication of Floats by Rationals; I'll wrap that up soon. Note that all arithmetic operations worked perfectly well before this change, unless you were working with Floats whose absolute exponents are on the order of 1 billion.
  • Malachite's integer multiplication code is translated from the corresponding code in FLINT. Since I first did that translation, Dan Schultz wrote a faster implementation for FLINT, and I've started working on incorporating a translation of that code into Malachite. It's not done yet, but it's already yielded one nice side benefit:
  • Malachite now supports fast primality testing for primitive integers up to u64, also translated from FLINT's codebase; for example, after importing the IsPrime trait, you can write 5509785649208481923u64.is_prime(), which evaluates to true. I tested this function on hundreds of thousands of random u64s, and found that it completed in less than 1.5 milliseconds for every u64, whereas a naive approach based on trial division could take up to 1 second for a single u64. I will eventually implement IsPrime for u128 and Natural as well.
  • Converting primitive integers or primitive floats to Float now creates a Float with the minimum precision necessary to represent the original value. Previously, some less obvious precision choices were made. If you want some precision other than the default, you can always use Float::from_unsigned_prec, Float::from_unsigned_prec_round, etc.
  • There are various other improvements. For example, I added an AbsDiff implementation for Rational.

v0.4.16

05 Sep 05:00
Compare
Choose a tag to compare

This release adds efficient Float division, as well as efficient multiplication of Floats by Rationals, division of Floats by Rationals, and division of Rationals by Floats. Conversion from Rationals to Floats is also more efficient, because it now uses Float division. The Reciprocal trait, and related functions, are also now implemented for Floats. Taking the reciprocal with these functions is slightly faster than computing 1/x using the division functions.

Now that the four basic arithmetic functions are supported for Floats, I'm able to move on to more interesting functions. Apart from the square root function and efficient string conversion functions, the functions that have yet to be implemented have simpler implementations in MPFR than the functions that have already been translated for Malachite, so you can generally expect the development of Floats to speed up a bit.

Other changes include

  • Float::from_natural_min_prec and related functions, which convert from Naturals or Integers to Floats using the minimum precision necessary.
  • Float::from_natural_prec_round_ref is now smarter: if converting from a large Natural with low precision, only the few most-significant bits that are needed are copied.
  • More Float functions are now tested against the rug library.
  • Some more random Natural, Integer, and Rational generators are added.
  • Two nontrivial Float constants are added (not actually constants, since you need to specify a precision and optionally a rounding mode). They are the prime constant and the Thue-Morse constant. They're not very useful; I just added them because I like constants. More useful constants are coming soon!

v0.4.15

18 Aug 02:07
Compare
Choose a tag to compare

This is a small release. Its purpose is mostly to include this pull request, which specifies the minimum supported Rust version. There is a more substantial release coming in the next weeks, which will contain efficient implementations of Float division and reciprocation.

This release includes

  • A MSRV specification, as mentioned above (thanks to John Vandenberg)
  • Implementations of AbsDiff for Integer
  • Implementations of EqAbs between Rationals and other numeric types
  • A small efficiency improvement for the Sum and Product implementations on Rational
  • More thorough testing for division-by-zero and exact rounding in malachite-base. This is purely proactive; no bugs have been found

v0.4.14

22 Jun 04:21
Compare
Choose a tag to compare

Added multiplication and squaring for Floats. Implementations for multiplying a Float by a Rational were also added, but the implementations are naive; to use the same technique as MPFR we need Float division, which Malachite can't do yet. But that's what I'll be working on next!