Bug 115553

Summary: SunSpider 1.0: 3d-morph: use epsilon to check result
Product: WebKit Reporter: Cosmin Truta <ctruta>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: commit-queue, fpizlo, ggaren, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Cosmin Truta
Reported 2013-05-03 09:57:25 PDT
3d-morph.js fails on QNX. The testOutput is expected to be a number that starts with a 6, but the actual output is approx. -4.97e-14. I reimplemented 3d-morph in C, and I executed it both with double and long double on x86_64 Linux. By using double calculations and sin(), the result was 6.75e-14. By using long double calculations and sinl(), the result was -6.279e-14. Is the theoretical result supposed to be zero, and the actual one closed to zero, due to error accumulations? Running the same program on ARM QNX, the result (using double and sin()) was -4.97e-14, i.e. same as inside JSC. Then I looked at all intermediate results returned by sin(). Out of 240 distinct calls to sin(), about ~65 of them are different by exactly 1ULP. In my understanding, that error should be acceptable.
Attachments
Patch (1.68 KB, patch)
2013-05-03 10:03 PDT, Cosmin Truta
no flags
Cosmin Truta
Comment 1 2013-05-03 10:03:04 PDT
Filip Pizlo
Comment 2 2013-05-03 10:53:43 PDT
Comment on attachment 200429 [details] Patch We should test this on other platforms as well. Note that sin() is not defined to have *any* precision guarantee in ECMAScript. So even if our engine can achieve this level of erro it might not be fair to require others to.
Filip Pizlo
Comment 3 2013-05-03 10:56:04 PDT
Comment on attachment 200429 [details] Patch Oh. Sorry. You're making the test even more lax. I'll have to think about it.
Cosmin Truta
Comment 4 2013-05-04 01:21:26 PDT
Comment on attachment 200429 [details] Patch Removing r? and cq? flags. I resubmitted this patch accidentally in bug 115580, and it landed over there.
Cosmin Truta
Comment 5 2013-05-04 01:21:56 PDT
*** This bug has been marked as a duplicate of bug 115580 ***
Cosmin Truta
Comment 6 2013-05-04 01:28:22 PDT
At the WebKit meeting, Filip Pizlo required additional data to back my precision claims regarding 1ULP roundoff errors. I will provide the test program and the intermediate output values, for comparison, in the other bug.
Note You need to log in before you can comment on or make changes to this bug.