racket / math

Other
34 stars 28 forks source link

Improve performance - use Bezout from GMP #40

Closed soegaard closed 2 years ago

soegaard commented 4 years ago

Use bezout from gmp rather than compute it ourselves.

https://github.com/racket/math/blob/58f5d6205abeec854b47a6c70d613089f108bceb/math-lib/math/private/number-theory/divisibility.rkt#L35

samth commented 2 years ago

Note that GMP is LGPL-licensed, so we probably don't want to copy the algorithm in here.

soegaard commented 2 years ago

The idea was to call the bezout function via the FFI and scratch the Racket implementation. Since we want to avoid GMP, it wasn't the best idea - so I'll close this issue. The algorithm used presently is standard text book.

samth commented 2 years ago

Using the FFI to libgmp is quite reasonable; especially since this library already does that in other places. I was only referring to copying the code.