xref: /aosp_15_r20/external/fdlibm/changes (revision 1e651e1ef2b613db2c4b29ae59c1de74cf0222ae)
1*1e651e1eSRoland Levillain21 Oct 2002
2*1e651e1eSRoland Levillainbug fix in e_pow.c from "David G Hough at validlab.com" <[email protected]>.
3*1e651e1eSRoland Levillaincredit for bug report goes to [email protected]
4*1e651e1eSRoland Levillaintest example:
5*1e651e1eSRoland Levillain-----------------------------
6*1e651e1eSRoland Levillainstatic int fail=0;
7*1e651e1eSRoland Levillain
8*1e651e1eSRoland Levillaintrypow(x,y,z)
9*1e651e1eSRoland Levillaindouble x,y,z;
10*1e651e1eSRoland Levillain{
11*1e651e1eSRoland Levillainextern double ieee_pow();
12*1e651e1eSRoland Levillaindouble p ;
13*1e651e1eSRoland Levillain
14*1e651e1eSRoland Levillainp = ieee_pow(x,y);
15*1e651e1eSRoland Levillainif (p != z) {
16*1e651e1eSRoland Levillain        printf(" pow failure x %e y %e computed %e correct %e \n",x,y,p,z);
17*1e651e1eSRoland Levillain        fail++;
18*1e651e1eSRoland Levillain        return;
19*1e651e1eSRoland Levillain}
20*1e651e1eSRoland Levillainif (1/p != 1/z) {
21*1e651e1eSRoland Levillain        printf(" pow failure x %e y %e computed %e correct %e \n",x,y,p,z);
22*1e651e1eSRoland Levillain        fail++;
23*1e651e1eSRoland Levillain        return;
24*1e651e1eSRoland Levillain}
25*1e651e1eSRoland Levillain}
26*1e651e1eSRoland Levillain
27*1e651e1eSRoland Levillainmain()
28*1e651e1eSRoland Levillain{
29*1e651e1eSRoland Levillain
30*1e651e1eSRoland Levillaintrypow( 1.0000000001, 1.0000000001E10, 2.7182820535066154);
31*1e651e1eSRoland Levillaintrypow(-1.0000000001, 1.0000000001E10, -2.7182820535066154);
32*1e651e1eSRoland Levillaintrypow(-0.001, 1.0000000001E10, -0.0);
33*1e651e1eSRoland Levillaintrypow(-1000.0, 1.0000000001E10, -1.0/0.0);
34*1e651e1eSRoland Levillain
35*1e651e1eSRoland Levillainif (fail == 0) {
36*1e651e1eSRoland Levillain        printf(" fdlibm e_pow.c seems to be current \n");
37*1e651e1eSRoland Levillain        exit(0);
38*1e651e1eSRoland Levillain}
39*1e651e1eSRoland Levillainelse {
40*1e651e1eSRoland Levillain        printf(" fdlibm e_pow.c seems to be out of date \n");
41*1e651e1eSRoland Levillain        exit(1);
42*1e651e1eSRoland Levillain}
43*1e651e1eSRoland Levillain
44*1e651e1eSRoland Levillain}
45*1e651e1eSRoland Levillain-----------------------------
46*1e651e1eSRoland Levillain
47*1e651e1eSRoland Levillain
48*1e651e1eSRoland Levillain
49*1e651e1eSRoland LevillainWhat's new in FDLIBM 5.3?
50*1e651e1eSRoland Levillain
51*1e651e1eSRoland LevillainCONFIGURE
52*1e651e1eSRoland Levillain        To build FDLIBM, edit the supplied Makefile or create
53*1e651e1eSRoland Levillain        a local Makefile by running "sh configure"
54*1e651e1eSRoland Levillain        using the supplied configure script contributed by Nelson Beebe
55*1e651e1eSRoland Levillain
56*1e651e1eSRoland LevillainBUGS FIXED
57*1e651e1eSRoland Levillain
58*1e651e1eSRoland Levillain    1. e_pow.c incorrect results when
59*1e651e1eSRoland Levillain        x is very close to -1.0 and y is very large, e.g.
60*1e651e1eSRoland Levillain        ieee_pow(-1.0000000000000002e+00,4.5035996273704970e+15) = 0
61*1e651e1eSRoland Levillain        ieee_pow(-9.9999999999999978e-01,4.5035996273704970e+15) = 0
62*1e651e1eSRoland Levillain        Correct results are close to -e and -1/e.
63*1e651e1eSRoland Levillain
64*1e651e1eSRoland Levillain    2. k_tan.c error was > 1 ulp target for FDLIBM
65*1e651e1eSRoland Levillain        5.2: Worst error at least 1.45 ulp at
66*1e651e1eSRoland Levillain        ieee_tan(1.7765241907548024E+269) = 1.7733884462610958E+16
67*1e651e1eSRoland Levillain        5.3: Worst error 0.96 ulp
68*1e651e1eSRoland Levillain
69*1e651e1eSRoland LevillainNOT FIXED YET
70*1e651e1eSRoland Levillain
71*1e651e1eSRoland Levillain    3. Compiler failure on non-standard code
72*1e651e1eSRoland Levillain        Statements like
73*1e651e1eSRoland Levillain                    *(1+(int*)&t1) = 0;
74*1e651e1eSRoland Levillain        are not standard C and cause some optimizing compilers (e.g. GCC)
75*1e651e1eSRoland Levillain        to generate bad code under optimization.    These cases
76*1e651e1eSRoland Levillain        are to be addressed in the next release.
77*1e651e1eSRoland Levillain
78