Fix ctan, ctanh overflow (bug 11521)

Ryan S. Arnold ryan.arnold@gmail.com
Thu Apr 26 16:03:00 GMT 2012


On Wed, Apr 25, 2012 at 12:43 PM, Adhemerval Zanella
<azanella@linux.vnet.ibm.com> wrote:
> I tracked down the ulps issues your saw they are related to expression 'h*(t+t/(t+one))'
> on sysdeps/ieee754/ldbl-128ibm/e_sinhl.c being rounding in newer GCCs (I tested using
> GCC 4.3.4 and got the ulp issues with GCC 4.6.4) to more approximated values, but the
> for ctanl/ctanhl it generates more ULPs. Below there is a newer patch that simply break
> down the expression in two subexpressions and get rid off ulps issues.

Ok, I see that we have a few larger ulps changes as a result....

>
>
> 2012-04-25  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
>
>        [BZ #11521]
>        * sysdeps/ieee754/ldbl-128ibm/s_ctanhl.c: (__ctanhl) Avoid internal
>        overflow or cancellation in calculating denominator.
>        * sysdeps/ieee754/ldbl-128ibm/s_ctanl.c: (__ctanl) Likewise.
>        * sysdeps/ieee754/ldbl-128ibm/e_sinhl.c: (__ieee754_sinhl) Breaking
>        down expression to avoid unexpected rounding in newer GCCs.
>        * sysdeps/powerpc/fpu/libm-test-ulps: Update for ctan, ctanh fix.
>

Proper form is:

* sysdeps/ieee754/ldbl-128ibm/s_ctanhl.c (__ctanhl): Avoid internal
overflow or cancellation in calculating denominator.

Notice the placement of the colon.  I'll fix them up this time.

Otherwise the patch itself looks good and cleans up the problem.  I'll
push upstream shortly.

Ryan S. Arnold



More information about the Libc-alpha mailing list