[SciPy-user] numpy's math library?

David M. Cooke cookedm at physics.mcmaster.ca
Wed Jan 11 21:09:29 CST 2006

Alan G Isaac <aisaac at american.edu> writes:

> On Wed, 11 Jan 2006, "David M. Cooke" apparently wrote: 
>> If necessary, we could use the definitions from fdlibm 
>> (http://www.netlib.org/fdlibm/). 
> It seems like a good idea to replace them with something 
> better in any case, if for no other reason than to avoid 
> having such doubts arise.  If the fdlibm (attribution only) 
> license looks fine, these look good.  Otherwise there are 
> also liberal license implementations that while not as good 
> as fdlibm are still better than the current implementation:
>     Public Domain:
>     http://www.digitalmars.com/d/archives/digitalmars/D/28555.html
>     BSD:
>     http://savannah.nongnu.org/projects/avr-libc/
>     Probably public domain (I can ask):
>     http://www.plunk.org/~hatch/rightway.php
> Alan Isaac

Using ideas from the first and third links above (verified by me), and some
digging for Kahan's version for arccosh, I've reimplemented the
replacement inverse hyperbolic functions in
(and a minor fix in 1885).

I've also exposed log1p(x) = log(1+x) and expm1(x) = exp(x)-1 as
ufuncs, since those are quite useful if you're worrying about
cancellation errors.

|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca

More information about the SciPy-user mailing list