Complex arg-trig functions

Stephen Montgomery-Smith stephen at missouri.edu
Sat Sep 22 20:54:15 UTC 2012


On 09/22/2012 03:09 PM, Bruce Evans wrote:

> % +static const volatile float
> %  tiny =            0x1p-10000L;

I assume you meant to also change tiny to 0x1p-100.

> %
>
> That's all the new changes.  Now from the old patch:
>
> @ diff -u2 catrig.c~ catrig.c
> @ --- catrig.c~    2012-09-21 15:51:00.000000000 +0000
> @ +++ catrig.c    2012-09-22 18:41:34.779454000 +0000
> @ @@ -577,20 +607,24 @@
> @  ...
> @      if (ax == 1)
> @          ry = atan2(2, -ay) / 2;
> @ -    else if (ay < FOUR_SQRT_MIN)
> @ +    else if (ay < DBL_EPSILON)
> @          ry = atan2(2*ay, (1-ax)*(1+ax)) / 2;
> @      else
>
> You accepted this without comment.  My calculation is that since ax
> != 1, |1-ax*ax| is at lease 2*DBL_EPSILON; ay < DBL_EPSILON makes
> ay*ay < DBL_EPSILON**2, so it is insignificant.  This threshold might
> be off by a small factor.

Yes, I think I wasn't paying attention.  But I agree with you.



More information about the freebsd-numerics mailing list