Earlier quoted context omitted.
He want more than compile-time simplification. He wants runtime simplification depending on the values encountered at runtime. For example in the quadratic equation. And, he clearly isn't marketing it as a replacement for floating point. He says: "It is important to note, however, that the goal of the project is to make tools for symbolic calculations, not to create a viable alternative to the floating point." and he…
He says this about SymPy...
Flaky: datatypes for real world quantities
31–40 of 42 posts
Re: Flaky: datatypes for real world quantities
#32floating point will never be obsolete, it is a log scale datatype, and log scale datatypes represent most natural values perfectly. The only place where the shoe doesn't fit is where you need a minimum accuracy. In that case what you should be doing is using integers to represent your minimum quantifiable unit. For example, you could represent currency in millicents to give you respectably accurate rounding. Not accu…
Microcents with signed long long (64bit) means a maximum value of 263 / 100 / (106) = 92233720368. In words "92 billion", which might not be enough.
Re: Flaky: datatypes for real world quantities
#33> Floating point datatype is the de-facto standard for real world quantities. Whether it is a banking account [...] Is there any bank which uses floating point for accounting?
Re: Flaky: datatypes for real world quantities
#34The first rule of numerics is not to compare variables of very different magnitude. His first example has coefficients that differ by almost 200 orders. This example is totally outrageous, but still, what any reasonable person would do is introduce some scaling into the equation.
Yes, you have to think about scales, but you already do that. You never write programs with meters and seconds, you choose scaled dimensionless quantities. And unless you choose the scales very badly, you won't get any problems from floats.
Re: Flaky: datatypes for real world quantities
#35related: there is a short series of exercises in SICP that explore the idea of building an interval arithmetic library. i.e. numerical values are represented by intervals [a, b] which encode their uncertainty/error: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-14.html... Exercise 2.14 and onwards point out that two expressions that are algebraically equivalent for perfectly accurate values stop being equivale…
- go back and improve if necessary, or otherwise - express the uncertainty of a comparison
thanks for the link :)
Re: Flaky: datatypes for real world quantities
#36floating point will never be obsolete, it is a log scale datatype, and log scale datatypes represent most natural values perfectly. The only place where the shoe doesn't fit is where you need a minimum accuracy. In that case what you should be doing is using integers to represent your minimum quantifiable unit. For example, you could represent currency in millicents to give you respectably accurate rounding. Not accu…
In addition you must prevent overflows. Microcents with signed long long (64bit) means a maximum value of 2 63 / 100 / (10 6) = 92233720368. In words "92 billion", which might not be enough.
4 billion. eak.
Re: Flaky: datatypes for real world quantities
#37related: there is a short series of exercises in SICP that explore the idea of building an interval arithmetic library. i.e. numerical values are represented by intervals [a, b] which encode their uncertainty/error: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-14.html... Exercise 2.14 and onwards point out that two expressions that are algebraically equivalent for perfectly accurate values stop being equivale…
Re: Flaky: datatypes for real world quantities
#38> Floating point datatype is the de-facto standard for real world quantities. Whether it is a banking account [...] Is there any bank which uses floating point for accounting?
Most banking systems predate standardized FP and use fixed decimal representations.
Re: Flaky: datatypes for real world quantities
#39floating point will never be obsolete, it is a log scale datatype, and log scale datatypes represent most natural values perfectly. The only place where the shoe doesn't fit is where you need a minimum accuracy. In that case what you should be doing is using integers to represent your minimum quantifiable unit. For example, you could represent currency in millicents to give you respectably accurate rounding. Not accu…
Re: Flaky: datatypes for real world quantities
#40floating point will never be obsolete, it is a log scale datatype, and log scale datatypes represent most natural values perfectly. The only place where the shoe doesn't fit is where you need a minimum accuracy. In that case what you should be doing is using integers to represent your minimum quantifiable unit. For example, you could represent currency in millicents to give you respectably accurate rounding. Not accu…
In addition you must prevent overflows. Microcents with signed long long (64bit) means a maximum value of 2 63 / 100 / (10 6) = 92233720368. In words "92 billion", which might not be enough.