3 ms·
I want to make the same objections (among others) but... interestingly, all of these actually reinforce the author's overarching point, which is less that every
by wwweston 7y ago
I want to make the same objections (among others) but... interestingly, all of these actually reinforce the author's overarching point, which is less that everyone should be using closed forms for fibonacci and factorial computations, and more that an analytical understanding of conceptual model and computing implementations often matters more than the due generally given. You're able to make the critical evaluation of closed-form solutions using doubles vs other options precisely because you're practicing the approach he's recommending (albeit, apparently, a little bit better!).
- lifthrasiir 7y agoThe GP demonstrates that the mathematics alone cannot produce a good software and does not necessarily refute the OP.
- KUcxrAVrtI 7y agoYou need to know a lot more computers than mathematics to know that floating point numbers are nothing like real numbers, neither are machine implemented integers.
- lifthrasiir 7y agoNot necessarily. Error analysis with floating point numbers is closely related to the mathematics, you have no other way. You can use several heuristics, like avoiding catastrophic cancellations or better summation algorithms, to improve error bounds and there is even an automatic approach like Herbie [1], but ultimately you can't be as sure without error analysis. (Note that the interval arithmetics or unum or posit or whatever are crude but useful approximations to the proper error analysis.) [1] https://herbie.uwplse.org/ https://herbie.uwplse.org/
- posix_me_less 7y ago> Note that the interval arithmetics or unum or posit or whatever are crude but useful approximations to the proper error analysis. "crude but useful approximations" is such a strange view. The purpose of machine-controlled error arithmetics is to give the programmer a powerful language construct that enables evaluation of a function or algorithm for arbitrarily small margin of error, using automatically revised accuracy in the intermediate steps. Error analysis is a math subject that gives us better algorithms. One needs both for hitting that desired margin of error with certainty within as short time as possible.
- 0815test 7y ago> a powerful language construct that enables evaluation of a function or algorithm for arbitrarily small margin of error, using automatically revised accuracy in the intermediate steps. AIUI, this is what "constructive (or 'exact') real numbers" give you, and it's quite computationally-intensive. Error arithmetic/interval arithmetic/etc. are only approximations to it. In many cases people don't even bother with the real deal because they're computing way more than one single result, so roundoff errors can be thought of as just one additional source of noise that is going to be averaged out over many 'steps'.
- posix_me_less 7y agoI agree, interval arithmetics/unums/$other_fancy_number_concept is just a start, not the end of getting reliable results. However, the roundoff errors that FPU generates are hardly controllable. In general they are not just a simple noise that cancels out on averaging. And some calculations do not do averaging at all.