This is the mail archive of the libc-alpha@sources.redhat.com 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]

Math problems on PPC with gcc-2.96 20000928


Hi,

since a while I have math testsuite failures with mainline gcc, test-double 
and test-idouble fail with:

testing double (without inline functions)
Failure: Test: tan (0.7) == 0.84228838046307944813
Result:
 is:          8.42639198734796535106e-01   
0x1.af6e67b1c985600000000000000000000p-1
 should be:   8.42288380463079411342e-01   
0x1.af406c2fc78ae00000000000000000000p-1
 difference:  3.50818271717123764120e-04   
0x1.6fdc100fd400000000000000000000000p-12
 ulp       :  3159890075560.0000
 max.ulp   :  0.0000
Maximal error of `tan'
 is      :  3159890075560.0000 ulp
 accepted:  1.0000 ulp
Failure: Test: pow (0.7, 1.2) == 0.65180494056638638188
Result:
 is:          7.75054287150474419121e-01   
0x1.8cd3ea5fdf2bc00000000000000000000p-1
 should be:   6.51804940566386381562e-01   
0x1.4db9608e352c400000000000000000000p-1
 difference:  1.23249346584088037559e-01   0x1.f8d44e8d4ffc000000000000000000000p-4
 ulp       :  1110131422699512.0000
 max.ulp   :  0.0000
Maximal error of `pow'
 is      :  1110131422699512.0000 ulp
 accepted:  0.0000 ulp
 
Test suite completed:
  2475 test cases plus 2267 tests for exception flags executed.
  4 errors occured.

The pow problems go away if  sysdeps/ieee754/dbl-64/e_pow.c is compiled with 
-O1, haven't found the miscompiled routine for tan yet. Is anyone else seeing 
this? I'll try to find the bug(s) in gcc, but I'm a bit unfamiliar with math 
in gcc, so it may take a while.

Another problem showed up during test-float, but this was caused by an 
oversight while making glibc aliasing safe, fixed by the attached patch.

Franz.

	* sysdeps/ieee754/flt-32/s_frexpf.c: Make it aliasing safe.

Index: sysdeps/ieee754/flt-32/s_frexpf.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/ieee754/flt-32/s_frexpf.c,v
retrieving revision 1.1
diff -u -p -r1.1 s_frexpf.c
--- sysdeps/ieee754/flt-32/s_frexpf.c	1999/07/14 00:01:23	1.1
+++ sysdeps/ieee754/flt-32/s_frexpf.c	2000/09/30 13:26:46
@@ -47,7 +47,7 @@ two25 =  3.3554432000e+07; /* 0x4c000000
 	}
 	*eptr += (ix>>23)-126;
 	hx = (hx&0x807fffff)|0x3f000000;
-	*(int*)&x = hx;
+	SET_FLOAT_WORD(x,hx);
 	return x;
 }
 weak_alias (__frexpf, frexpf)

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