Skip to main content
17 events
when toggle format what by license comment
Apr 24, 2015 at 23:41 comment added Michaël Le Barbier @CharlesE.Grant Well I think this refers quite to the plain text of the question, which mentions scientific computing. In scientific computing, one will not go anywhere without the exponential function, and so, rational numbers or any countable class of numbers will not allow us to compute exactly. You are definitely right in your explanation why floating point arithmetic is confusing for “them”. Few people realise that most numbers cannot be computed and how much mathematics is about reasoning on quantities despite them not being computable!
Apr 24, 2015 at 18:25 comment added user4828 @MichaelGrünewald, What you say is certainly true, but I think primarily of interest to mathematicians and their fellow travelers. The subtext of the original question is that many work-a-day programmers find floating point arithmetic baffling. I suspect this is because they mostly work with computations that can be made with perfect precision using integers from a finite range (think bookkeeping and inventory). Floating point arithmetic is confusing for them because they don't appreciate that they've entered a problem domain where perfect precision is impossible.
Apr 24, 2015 at 17:57 comment added user4828 @PaulChernoch, sure, but there is a performance cost to that. Nobody is going to re-write their finite element modeling package or their machine learning library to use a continued fraction representation or even arbitrary precision rationals because they can't afford the performance penalty. As I said in my answer, scientific computing is a trade-off among precision, range, and speed.
Apr 24, 2015 at 17:45 comment added Paul Chernoch @CharlesE.Grant - We can represent many real numbers exactly, using continued fractions and lazy algorithms that can deliver any desired degree of precision. See Gosper's algorithm for arithmetic using continued fractions. Numbers like Pi, e, sqrt(2), etc. can be manipulated exactly. Results of functions like log and tangent as well.
Oct 27, 2014 at 17:57 comment added Martin Thoma It should probably be noted that in science / engineering you have measurements that you take to start calculations. Those measurements very rarely have more than 6 digits of precision.
Oct 22, 2014 at 18:54 comment added Michaël Le Barbier @CharlesE.Grant I am well aware of all that. The important point for the OP is that we do not use computations with perfect precision just because the corresponding computation methods do not exist. Of course, floating point arithmetic is faster than non-existant arithmetic.
Oct 22, 2014 at 16:58 comment added Jules No, I really did mean rational... arbitrary precision arithmetic only works as long as you have enough memory to store the numerator and divisor. This means you can only work on a finite subset of rationals. In any arbitrarily chosen range of rationals there are infinitely many that you cannot represent exactly on any real computer system, and only a finite number that you can. Hence, for a randomly chosen rational in that range, the probability of it being representable is zero.
Oct 22, 2014 at 16:46 comment added Maja Piechotka @Jules You made a type - you mean real, not rational, number. As rationals are enumerable you can do it by storing their number in a series (though easier way is through 2 bignums AKA arbitrary precision arithmetic).
Oct 22, 2014 at 16:40 comment added Jules That's a very big limitation to be subject to. If one were to choose a rational number drawn from the set of all rational numbers with equal probability, the chance of the selected number being representable in any arbitrary finite quantity of memory is essentially zero. Unless a process includes some kind of bias towards simple numbers, we simply cannot model it exactly.
Oct 22, 2014 at 16:07 comment added user4828 @MichaelGrünewald, we can't represent real numbers exactly, but we are able to solve problems to a close enough approximation that we can build structures a couple thousand feet high, identify genes in DNA, and rendezvous a satellite with a comet after two years in space. To paraphrase Randy Newman, that may not be exact, but it is all right. In fact we can represent rationals exactly using arbitrary precision libraries (subject to limitations of memory).
Oct 22, 2014 at 15:26 vote accept DoubleDouble
Oct 22, 2014 at 8:47 comment added Michaël Le Barbier “The crux of the matter is that most scientific and engineering calculations need high speed, and huge range” If I give you long time, you still cannot compute exactly because algorithms to compute exactly are widely unknown. And first of all, we cannot even represent numbers exactly. This is just a problem we do not know how to solve, neither quickly nor slowly.
Oct 21, 2014 at 23:32 comment added Jonathan Eunice @luk32 We violently agree about most of those points. One can model some thing exactly (volume of a sphere, e.g.), but can never measure exactly. And reality never perfectly fits a perfect model. Better to get slightly imprecise, useful values/models than wait for perfect measurements or computations--something that will always be one step away.
Oct 21, 2014 at 22:23 comment added luk32 @JonathanEunice You cannot exactly model the reality. The input for the model comes from measurements and you will probably never able to measure things so precisely that a native real number in modern computer/software (at the time) would limit it. In other words, you can have perfect model, software or mathematical, it doesn't matter. E.g. Calculate a volume of a box. a*b*c easy stuff, however you need to measure the dimensions which you cannot do with absolute certainty, thus you don't really need infinite precision of calculation anyways, just enough to be bound by measurement error.
Oct 21, 2014 at 20:20 history edited user4828 CC BY-SA 3.0
deleted 2 characters in body
Oct 21, 2014 at 19:55 comment added Jonathan Eunice Good answer. While the underlying functions may be perfectly continuous, which would require perfect precision to exactly model, the reality is that everything in science and engineering is an approximation. We'd rather have decent, useful approximations and accomplish something than infinite precision, for which we'd wait forever for many operations to complete.
Oct 21, 2014 at 19:12 history answered user4828 CC BY-SA 3.0