https://github.com/qedsoftware/floating-point-test
Floating point computation test.
https://github.com/qedsoftware/floating-point-test
Last synced: 3 months ago
JSON representation
Floating point computation test.
- Host: GitHub
- URL: https://github.com/qedsoftware/floating-point-test
- Owner: qedsoftware
- Created: 2014-03-13T22:11:49.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-13T23:26:51.000Z (over 12 years ago)
- Last Synced: 2025-01-01T00:44:50.366Z (over 1 year ago)
- Language: Java
- Size: 121 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Floating Point Computation Test
===================================
These programs are inspired by a note (*) that I found outside of the office of Prof. William Kahan.
Define a function h(x) that does the following operations:
1. Given a non-negative number, repeatedly square root it 128 times.
2. Then "undo" these actions by repeatedly squaring that result 128 times.
The result should be what we started with, such that h(x) = x.
However, most computers will not yield the correct answer.
(Sometimes they correctly compute that h(0) = 0 and h(1) = 1, but other values of x produce incorrect results.)
(*) "Why is Floating-Point Computation so Hard to Debug when it Goes Wrong?", William Kahan.
- William Wu (w@qe-design.com), 2013 March 13