But I got the same result when I ran a 32-bit version of Python (although I'm not sure it made a difference since I was still using a 64-bit OS) and I read that real*8 in Fortran means 8-byte precision, or 64 bits. What is going on? First I thought it's because Fortran was running in 32 bits while Python ran in 64 bits. But there are some finely tuned cancellation my code (precisely of order 1 part in 10^8) when I try to evaluate the numerical accuracy, so the error estimate from Fortran is sometimes twice as much as from the Python code. So these numbers are equal up to the 8th significant digit, which in general should be good enough. And it seems all of this stems from some rounding errors or whatnot in Fortran.įor instance, the fraction 277./14336. This is a Python 3 implementation of the Sloans improved version (FORTRAN 77 code) of the Nordbeck and Rystedt algorithm, published in the paper: SLOAN. You can help by splitting this big page into smaller ones. While I was testing my code, I realize my outputs were slighlty different from the Fortran code. A Wikibookian believes this page should be split into smaller pages with a narrower subtopic. Long story short, I'm trying to rewrite in Python a Fortran77 code my advisor sent me, as Python is more convenient for me.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |