7 releases (4 breaking)

0.32.0 Dec 29, 2024
0.31.0 Nov 4, 2024
0.30.2 Sep 8, 2024
0.30.1 Aug 25, 2024
0.28.0 Jul 1, 2024

#6 in #ln

Download history 2/week @ 2024-10-04 123/week @ 2024-11-01 39/week @ 2024-11-08 5/week @ 2024-11-15 1/week @ 2024-11-22 3/week @ 2024-11-29 21/week @ 2024-12-06 70/week @ 2024-12-13 6/week @ 2024-12-20 104/week @ 2024-12-27 9/week @ 2025-01-03 38/week @ 2025-01-10 19/week @ 2025-01-17

170 downloads per month

Apache-2.0

47KB
1K SLoC

Pallas Math

Crate with all the mathematics functions to support Cardano protocol:

  • [] lncf - Approximate ln(1+x) for x in 0..infinty.
  • [] cf - Compute continued fraction using max steps or bounded list of a/b factors.
  • [] bound - Simple way to find integer powers that bound x.
  • [] contract - Bisect bounds to find the smallest integer power such that factor^n<=x<factor^(n+1).
  • [] find_e - find n with e^n<=x<e^(n+1).
  • [] ln - Compute natural logarithm via continued fraction, first splitting integral part and then using continued fractions approximation for ln(1+x).
  • [] taylor_exp - Compute exp(x) using Taylor expansion.
  • [] taylor_exp_cmp - Efficient way to compare the result of the Taylor expansion of the exponential function to a threshold value.
  • ...
  • ...

Dependencies

~3.5–5MB
~90K SLoC