Numeric error propagation: Difference between revisions

Content added Content deleted
(→‎{{header|Java}}: error shown is significantly different from others')
m (→‎{{header|REXX}}: moved a statement.)
Line 1,675: Line 1,675:
say ' A point (x,y)= ' ax "±" axE', ' ay "±" ayE /*display A point (with err)*/
say ' A point (x,y)= ' ax "±" axE', ' ay "±" ayE /*display A point (with err)*/
say ' B point (x.y)= ' bx "±" bxE', ' by "±" byE /* " B " " " */
say ' B point (x.y)= ' bx "±" bxE', ' by "±" byE /* " B " " " */
say /*blank line for the eyeballs.*/
dx=ax-bx; dxE=sqrt(axE**2 + bxE**2); xe=#(dx, 2, dxE) /*compute X distances (& err)*/
dx=ax-bx; dxE=sqrt(axE**2 + bxE**2); xe=#(dx, 2, dxE) /*compute X distances (& err)*/
dy=ay-by; dyE=sqrt(ayE**2 + byE**2); ye=#(dy, 2, dyE) /* " Y " " " */
dy=ay-by; dyE=sqrt(ayE**2 + byE**2); ye=#(dy, 2, dyE) /* " Y " " " */
D=sqrt(dx**2 + dy**2) /*compute the 2D distance. */
D=sqrt(dx**2 + dy**2) /*compute the 2D distance. */
say /*blank line for the eyeballs.*/
say 'distance=' D "±" #(D**2, .5, sqrt(xE**2 + yE**2)) /*display " " " */
say 'distance=' D "±" #(D**2, .5, sqrt(xE**2 + yE**2)) /*display " " " */
exit /*stick a fork in it, we're all done. */
exit /*stick a fork in it, we're all done. */