Use of C99 extra long double math functions after r236148

Steve Kargl sgk at troutmask.apl.washington.edu
Sun Aug 12 23:11:55 UTC 2012


On Sun, Jul 22, 2012 at 10:24:10AM -0500, Stephen Montgomery-Smith wrote:
> 
> mpfr is OK, but terribly cludgy.

I almost chocked on my coffee reading this statement.

> Having it compute clog is easy.  But 
> having it computing casinh is going to be very painful.  If I cannot use 
> pari, I will probably use C++ code based around a floating point package 
> called cln.  It is used in GiNaC, which is a rather cool way of 
> embedding symbolic expressions inside C++ code.  They are both available 
> in the ports.

I you looked at MPC?  http://www.multiprecision.org/index.php?prog=mpc
>From the MPC manual:

4.6 Branch Cuts And Special Values

Some complex functions have branch cuts, across which the function is
discontinous.  In GNU MPC, the branch cuts chosen are the same as those
specified for the corresponding functions in the ISO C99 standard.

Likewise, when evaluated at a point whose real or imaginary part is
either infinite or a NaN or a signed zero, a function returns the same
value as those specified for the corresponding function in the ISO C99
standard. 

5.9 Trigonometric Functions

- Function: int mpc_asinh (mpc_t rop, mpc_t op, mpc_rnd_t rnd)
- Function: int mpc_acosh (mpc_t rop, mpc_t op, mpc_rnd_t rnd)
- Function: int mpc_atanh (mpc_t rop, mpc_t op, mpc_rnd_t rnd)

Set rop to the inverse hyperbolic sine, inverse hyperbolic cosine, inverse
hyperbolic tangent of op, rounded according to rnd with the precision of
rop. The branch cut of mpc_acosh is (-\infty, 1). 

-- 
Steve


More information about the freebsd-numerics mailing list