Use of C99 extra long double math functions after r236148

Peter Jeremy peter at rulingia.com
Sun Aug 12 23:08:19 UTC 2012


On 2012-Jul-18 10:07:41 -0500, Stephen Montgomery-Smith <stephen at missouri.edu> wrote:
>I went on a long road trip yesterday, so I didn't get any code written,
>but I did have a lot of thoughts about clog and casinh.

Can I suggest you have a read through "Implementing the Complex
Arcsine and Arccosine Functions Using Exception Handling" by
T. E. Hull Thomas F. Fairgrieve and Ping Tak Peter Tang, ACM
Transactions on Mathematical Software, Vol. 23, No. 3, September 1997.
Based on a quick skim, it includes fairly detailed pseudocode,
together with an error analysis.

On 2012-Jul-18 16:09:06 -0500, Stephen Montgomery-Smith <stephen at missouri.edu> wrote:
>Am I to understand that the inexact flag should be set anytime a 
>floating point operation produces an answer that is not guaranteed 
>exact?

My understanding is, yes.  For the transcendental functions, that
means the inexact flag should almost always be raised and the problem
becomes when not to raise it.  Eg sin(0) == 0 and presumably doesn't
set the inexact flag.

>  For example, should 1.0/3.0 and sqrt(2.0) raise the inexact flag?

Yes and yes.  I notice our sqrtl() actually tests the inexact flag of
an intermediate calculation to determine the correct rounding for the
result.

I've also found that Abramowitz and Stegun "Handbook of Mathematical
Functions", 10th printing, is available online at
http://people.maths.ox.ac.uk/~macdonald/aands/index.html
and various mirrors.  I'm still looking for a copy of Cody & Waite.

BTW, thanks to Steve & Bruce for the comments on my code.  I'll clean
it up and have another try but that will probably take a couple of
days.

-- 
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-numerics/attachments/20120812/0e81d4a1/attachment.pgp


More information about the freebsd-numerics mailing list