It is false that (sin +&*: cos) y not equal to 1 implies that sin y or cos y or both are wrong.
For example, suppose we have a machine with 15 decimal places of precision. Using code from http://www.jsoftware.com/jwiki/Essays/Sine_and_Cosine_%28Extended_Precision%29 we can calculate sin 1 and cos 1 to 40 places: 0j40 ": sin 1 0.8414709848078965066525023216302989996226 0j40 ": cos 1 0.5403023058681397174009366074429766037323 Formatting exactly the same numbers to 15 places, we get: 0j15 ": sin 1 0.841470984807897 0j15 ": cos 1 0.540302305868140 These are the best possible values for sin 1 and cos 1 to 15 decimal places. But an exact calculation with 15 decimal places yields: s=: 841470984807897x * 10x^_15 c=: 540302305868140x * 10x^_15 0j15 ": s +&*: c 1.000000000000001 ----- Original Message ----- From: Devon McCormick <[EMAIL PROTECTED]> Date: Sunday, December 17, 2006 1:23 pm Subject: Re: [Jgeneral] exp(y). sin(y) and accuracy. > This just in from the "Risks in Computing" (RISKS-24.51) Usenet group: > > Date: Sun, 10 Dec 2006 15:27:13 -0500 > From: Martin Ewing <[EMAIL PROTECTED]> > Subject: Trig error checking (Re: McIlroy, RISKS-24.49) > > Doug McIlroy's report of the effect of missing punched cards on trig > accuracy (RISKS-29.49) brought to mind another troubling trig > episode. In > the early 1990's, we were heavy into scientific calculations on > the Digital > VAX-11/780 -- ephemerides which required every last drop of precision. > Sometimes the answers weren't checking out. Eventually we found > that our > VAX floating point unit (a very large circuit board) was > malfunctioning. It > gave slightly wrong results, but quietly - there were no system error > reports. The diagnostic was that sin**2 + cos**2 was > intermittently not > quite equal to 1 for various arguments. [NOTE: This is a positive > exampleof circular reasoning! PGN] > > Field service got us new boards, but how could we have confidence > this bug > was not recurring? In the end we ran a background routine that > checkedsin**2 + cos**2 forever. (Today, we would make it a > screensaver program.) > > There is a RISKS issue -- how do you know your CPU is giving good > results?There aren't any check bits for trig functions. > > (Alluded to in RISKS-16.68.) > > -- > Devon McCormick > ^me^ at acm. > org is my > preferred e-mail > ------------------------------------------------------------------- > --- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
