C99 Complex Math Functions

Peter Jeremy peterjeremy at optushome.com.au
Fri Aug 21 09:38:53 UTC 2009


On 2009-Aug-20 16:04:00 -0700, Steve Kargl <sgk at troutmask.apl.washington.edu> wrote:
>On Mon, Aug 17, 2009 at 04:13:19PM -0400, David Schultz wrote:
>> On Sat, Aug 15, 2009, Peter Jeremy wrote:
>> > I've recently had a requirement for the C99 complex math functions.
>> > I know you have been doing some work on implementing functions in
>> > complex.h and wonder what (if any) plans you have for implementing
>> > the rest of the C99 functions.
>> 
>> Which ones do you need?

cacos, cacosh, casin, casinh, catan, catanh, ccos, ccosh, cexp, clog,
cpow, csin, csinh, ctan, ctanh :-)

>> Many of the functions can be fudged with some simple formulas that
>> you can look up.

I have all the simple formulae.

>>  The simple formulas work great in most cases,
>> but often fail near asymptotes and for special cases (infinity,
>> NaN, underflow, etc.)

And simplistic implementations can lose significant amounts of
precision as well.

>In a private response to Peter, I directed him to NetBSD.

Thanks for that.  I've also discovered that math/gsl also implements
the required functions (though with non-standard names and argument
types).  Since I already have gsl available, I might use it instead.
(As a warning for anyone else interested in math/gsl - it's complex
functions are implemented very simplisticly - no better than NetBSD).

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20090821/5b38dbf7/attachment.pgp


More information about the freebsd-arch mailing list