This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libm-test.inc: Computing ulps near FP_ZERO.


On Tue, Apr 09, 2013 at 10:45:47PM -0400, Carlos O'Donell wrote:
> On 04/09/2013 07:05 PM, Andreas Schwab wrote:
> > "Carlos O'Donell" <carlos@redhat.com> writes:
> > 
> >> +#if defined TEST_LDOUBLE
> >> +  TEST_f_f (cos, M_PI_2l, -2.50827880633416601177866354016537e-20L);
> >> +#endif
> > 
> > Does that work for all long double types?
> 
> I doubt it. I need help fixing that.
> 
> See my post here:
> http://sourceware.org/ml/libc-alpha/2013-04/msg00273.html
> 
> As I mentioned in the previous email this is dependent
> on the rounding error representing PI/2 for your type.
> 
> If you have a build of something with an alternate long double type,
> say IBM double double for Power PC could you try the following?
> 
> (1) Compile and run:
> 
> cat >> test.c <<EOF
> #include <stdlib.h>
> #include <stdio.h>
> #include <math.h>
> 
> int
> main (void)
> {
>   printf ("%.100Le\n", (long double)(M_PIl/2.0L)); 
>   return 0;
> }
> EOF
> gcc -D_GNU_SOURCE -o test test.c
> ../test
> 1.5707963267948966192564044797030931022163713350892066955566406250000000000000000000000000000000000000e+00

If you use %g rather than %e you can avoid the excess zeros at the
end.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]