complex math functions

Bruce Evans bde at zeta.org.au
Tue Mar 6 09:49:32 UTC 2007


On Mon, 5 Mar 2007, ff b wrote:

> What is currently the status of complex math functions in freebsd ?

Still mostly unimplemented.

For cexp() and friends, you won't lose much relative to a not very high-
powered Standard library implementation by just using Euler's formula.
The Standard implementation is required to handle exceptional values
(only infinities for cexp()) in a certain way, and just using the formula
will get this wrong, but I think most applications won't care.  Handling
the exceptional values is much easier than handling cases near overflow
and getting good accuracy and efficiency.  Note that even ordinary
multiplication, as implemented naively by gcc, has good efficiency but
bad accuracy and very bad handing of cases near overflow.

There is an uncommitted version of ccosh() that handles the exceptional
values but otherwise just uses the infinite-precsion formula for cosh().

Bruce


More information about the freebsd-standards mailing list