Pathological floating point problems: Difference between revisions

Content added Content deleted
m (→‎Siegfried Rump's example: made the (visible) expressions for the formula in the F function to appear closer to the task's version. .)
Line 2,281: Line 2,281:
exit /*stick a fork in it, we're all done. */
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
f: procedure; parse arg a,b; a2=a**2; b2=b**2; b4=b2**2; b6=b4*b2; b8=b4**2
f: procedure; parse arg a,b; return 333.75* b**6 + a**2 * (11* a**2* b**2 - b**6,
return 333.75*b6 + a2*(11*a2*b2 - b6 - 121*b4 - 2) + 5.5*b8 + a/(2*b)</lang>
- 121*b**4 - 2) + 5.5*b**8 + a / (2*b)</lang>
{{out|output|text=&nbsp; when using the default inputs:}}
{{out|output|text=&nbsp; when using the default inputs:}}
<pre>
<pre>