rskey's Calculator forensics in Fortran
|
03-09-2016, 09:27 PM
Post: #9
|
|||
|
|||
RE: rskey's Calculator forensics in Fortran
(03-09-2016 10:08 AM)Dieter Wrote: This leads to the question of the "perfect" forensic result for each compiler, depending on the implemented precision, i.e. the final value if every intermediate result is correctly rounded to working precision. No, it's not 9.000000.... ;-) You should expect to lose at least 5 digits in the final result. I'd expect most modern compilers would use IEEE 754 mathematics. While this standard doesn't guarantee correctly rounded trigonometric functions, a lot of libraries do, at least for 64 bit reals. Quote:BTW... wouldn't a really optimizing compiler replace x=asin(acos(atan(tan(cos(sin(9)))))) with a simple x=9 ? ;-) Absolutely not. Optimising compilers go to a lot of effort to preserve the floating point semantics of what the programmer wrote. In this case, it would be possible for the compiler to replace the expression by x = correctly rounded result near 9. There are usually compiler options to turn of this strict enforcement and then it might produce x=9. Pauli |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
rskey's Calculator forensics in Fortran - HP67 - 06-30-2014, 12:44 PM
RE: rskey's Calculator forensics in Fortran - Paul Berger (Canada) - 06-30-2014, 02:31 PM
RE: rskey's Calculator forensics in Fortran - HP67 - 06-30-2014, 02:35 PM
RE: rskey's Calculator forensics in Fortran - Martin Paech - 07-01-2014, 07:34 AM
RE: rskey's Calculator forensics in Fortran - HP67 - 07-01-2014, 07:53 AM
RE: rskey's Calculator forensics in Fortran - HP67 - 03-08-2016, 09:09 AM
RE: rskey's Calculator forensics in Fortran - Paul Berger (Canada) - 03-08-2016, 05:31 PM
RE: rskey's Calculator forensics in Fortran - HP67 - 03-13-2016, 02:15 PM
RE: rskey's Calculator forensics in Fortran - Paul Berger (Canada) - 03-13-2016, 04:51 PM
RE: rskey's Calculator forensics in Fortran - Dieter - 03-09-2016, 10:08 AM
RE: rskey's Calculator forensics in Fortran - Paul Dale - 03-09-2016 09:27 PM
RE: rskey's Calculator forensics in Fortran - HP67 - 03-13-2016, 02:24 PM
|
User(s) browsing this thread: 1 Guest(s)