Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jakes.fdlibm prints out incorrect results #1

Closed
rtoy opened this issue Sep 14, 2014 · 1 comment
Closed

jakes.fdlibm prints out incorrect results #1

rtoy opened this issue Sep 14, 2014 · 1 comment

Comments

@rtoy
Copy link
Owner

rtoy commented Sep 14, 2014

jakes (using the system libm on OSX) and jakes.crlibm print out

   0: -0.220863 5.83353
   1: -0.220863 5.83353
   2: -0.220863 5.83352
   3: -0.220864 5.83352
   4: -0.220865 5.83352
...
1249995: 0.659915   -2.04764
1249996: 0.659962   -2.04758
1249997: 0.660009   -2.04753
1249998: 0.660057   -2.04748
1249999: 0.660104   -2.04743

but jakes.fdlibm gives something totally different:

   0: 2.9168    4.6186
   1: 2.9168    4.6186
   2: 2.9168    4.6186
   3: 2.27267   2.76334
   4: 2.47508   4.6186
...
1249995: 1.745e+74  -1.42599e+25
1249996: -1.5558e+24    -1.42601e+25
1249997: -1.24162e+19   2.76334
1249998: -1.55583e+24   -1.42604e+25
1249999: -1.24162e+19   4.6186
@rtoy
Copy link
Owner Author

rtoy commented Sep 16, 2014

That's because fdlibm (as imported from netlib) still uses aliased pointers to extract out the words of a double. Replacing the uses of the pointers with a union fixes this and the results from fdlibm match those of libm and crlibm, as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant