bigdecimal-rs icon indicating copy to clipboard operation
bigdecimal-rs copied to clipboard

Maths functions

Open andy-thomason opened this issue 3 years ago • 2 comments

If you are interested. I have a set of maths functions on BigDecimal that I am using as a reference for libm generation.

https://github.com/extendr/doctor-syn/blob/main/src/bdmath.rs

These are only references, using MacLaurin series and do not cover all domains, but could be worked into something more useful.

I've also added a version of "round" that does not panic.

I'm a bit short of time at the moment, but anyone interested, should feel free to cut and paste.

andy-thomason avatar Jul 26 '21 12:07 andy-thomason

I guess Maclaurin is not fast, right?

lukaz-vaultree-com avatar Aug 25 '21 12:08 lukaz-vaultree-com

Taylor/Maclaurin series converge slowly except for very small values.

Some of the functions do range reduction to map the inputs to small ones, but more work is required here for fast convergence.

At the moment, these are just used as references for polynomial approximations in our CAS package:

https://github.com/doctor-syn/doctor-syn

andy-thomason avatar Aug 25 '21 13:08 andy-thomason