News for hackers. Stuff that matters.
Re:Inventor Claims to Have Solved Floating Point Error Problem by tombert on Thursday January 18, 2018 @11:26AM (#16178331)
That's what I was thinking too; If I do 1 / 3, then of course it will have to truncate, and integration errors would still be inevitable.
Re:Inventor Claims to Have Solved Floating Point Error Problem by TallGuyShort on Thursday January 18, 2018 @11:35AM (#16178424)
There is inaccuracy, but the point is that it tracks how much inaccuracy there might be. I picture this as being similar to how computers can't trust time for all sorts of reasons, so Google's Spanner uses time ranges and estimates of potential inaccuracy to make it possible to work with that. It will truncate, so you won't really have 1/3, but you'll know it's approximately 0.333, definitely more than 6/20 but definitely less than 7/20, for instance, and if you ever exceed certain bounds of certainty the calculation and all resulting calculations are flagged as not being that trustable. As is my understanding from the article, anyway.
Re:Inventor Claims to Have Solved Floating Point Error Problem by geezerjay on Thursday January 18, 2018 @02:38PM (#16180557)
> but you'll know it's approximately 0.333, definitely more than 6/20 but definitely less than 7/20, for instance

What strikes me as odd is that in my intro course to numerical methods taught how to calculate floating point error bounds when introducing the concept of floating point numbers, including how errors propagated with each flop.

Re:Inventor Claims to Have Solved Floating Point Error Problem by TallGuyShort on Thursday January 18, 2018 @04:15PM (#16181530)
Yeah I doubt this is anything novel in the purely mathematical realm. It sounds like what's patented is a practical design for doing this on a chip.

Not sure if you were taught a different method, but I envision this being similar to counting "significant digits" in scientific notation, and it sounds like that's very similar to the approach he took. I wonder if that explains there statements about tracking to the last "digit". They obviously can't do that for irrational number, so maybe they mean the last "significant" digit as far as the underlying floating point implementation is concerned.

Re:Inventor Claims to Have Solved Floating Point Error Problem by koonsolo on Thursday January 18, 2018 @12:47PM (#16179328)
Yes, this is my exact understanding of the article too.

So in that case, "[it] allows representation of real numbers accurate to the last digit" doesn't really hold true.

Re:Inventor Claims to Have Solved Floating Point Error Problem by BFatts on Thursday January 18, 2018 @01:22PM (#16179764)
I think you're reading it wrong. I think the intended meaning was that it's accurate for real numbers up to, but not including, the final digit"

That's how I read it.

Re:Inventor Claims to Have Solved Floating Point Error Problem by emiliobumachar on Thursday January 18, 2018 @01:39PM (#16179952)
Many real numbers have an infinite number of digits
Re:Inventor Claims to Have Solved Floating Point Error Problem by LASR on Thursday January 18, 2018 @02:50PM (#16180677)
I think you're missing the point. Using the example above. 1/3 has no final digit. 0.333333 repeating infinitely.

So how do you then store this number to the final digit or final -1 digit using this mechanism?

Re:Inventor Claims to Have Solved Floating Point Error Problem by umanwizard on Thursday January 18, 2018 @11:58AM (#16178652)
Actually it's possible to represent 1/3 perfectly accurately, but what about all the numbers that it's theoretically impossible to compute? (Almost all real numbers have this property)
Re:Inventor Claims to Have Solved Floating Point Error Problem by mcny on Thursday January 18, 2018 @12:11PM (#16178794)
> Almost all real numbers have this property

> Almost all

I love this comment because it brings back memories of school.

In a layman's terms, I think almost all in this case means all but a finite amount

can we say almost all real numbers are irrational?

1 1/1 2/1 3/1 4/1 5/1 ... 2 1/2 2/2 3/2 4/2 5/2 ... 3 ...

so clearly we can count all the rational numbers but how many irrational numbers are there? are there (many) more irrational numbers than there are rational numbers?

Re:Inventor Claims to Have Solved Floating Point Error Problem by monktastic1 on Thursday January 18, 2018 @12:38PM (#16179207)
The rationals have measure zero, so almost all reals are irrational. The Cantor set is an example of an uncountable set which also has measure zero.

http://austinrochford.com/posts/2013-12-31-almost-no-rationa...

Re:Inventor Claims to Have Solved Floating Point Error Problem by ska on Thursday January 18, 2018 @12:50PM (#16179380)
It's not a finite amount, but an amount with measure zero.
Re:Inventor Claims to Have Solved Floating Point Error Problem by roywiggins on Thursday January 18, 2018 @12:46PM (#16179312)
You can count computable irrationals by numbering the algorithms that calculate (successive approximations to) them and lining them up in order. This is what Turing used his "Turing Machines" to do.

So all of the irrationals that we use or could ever use in calculations are countable. The uncountability of the irrationals comes entirely from the uncomputable ones, which we will probably never see.

The reals are deeply weird.

Re:Inventor Claims to Have Solved Floating Point Error Problem by Ma8ee on Thursday January 18, 2018 @12:37PM (#16179186)
The rational numbers are clearly countable. The irrational numbers are uncountable, which means that for every rational number there are infinitely many irrational numbers.
Re:Inventor Claims to Have Solved Floating Point Error Problem by btilly on Thursday January 18, 2018 @12:49PM (#16179367)
But for every integer there are also an infinite number of rationals. And since we can put the rationals into 1-1 correspondence with integers, that means that for every rational there are an infinite number of rationals.

Infinity is funny like that.

The conclusion that there are somehow more irrationals than rationals depends on subtle philosophical points that have no possible proof or disproof and usually get glossed over. Accepting that philosophy also leads to the conclusion that not only do numbers which can in no way ever be represented exist, but there are more of them than numbers which we can explicitly name. Now I ask you, in what sense do they REALLY exist?

Re:Inventor Claims to Have Solved Floating Point Error Problem by umanwizard on Thursday January 18, 2018 @01:52PM (#16180084)
> The conclusion that there are somehow more irrationals than rationals depends on subtle philosophical points that have no possible proof or disproof and usually get glossed over

Can you elaborate? The proof that there are more irrationals than rationals is very straightforward, from my perspective.

Re:Inventor Claims to Have Solved Floating Point Error Problem by btilly on Thursday January 18, 2018 @06:28PM (#16182611)
The easiest way to understand it is to look at the question from a philosophical framework where it makes no sense to claim that there are "more" irrationals than rationals. And then untangle why it came to a different answer.

In Constructivism, all statements have 3 possible values, not 2. They are true, false, and not proven. All possible objects must have a construction. So instead of talking about a vague "Cauchy sequence", we might instead have a computer program that given n will return a rational within 1/n of the answer.

The first thing to notice is that all possible things that could exist is contained within a countable set of all possible constructions. There can't be "more" irrationals than rationals.

But what about diagonalization? That proof still works. You still can't enumerate the reals. But why not? The answer is because determining whether a given program represents a real is a decision problem that cannot in general be solved by any algorithm. You are running into the same category of challenges that lie behind Gödel's theorem and The Halting Problem. It is not that there are "more" irrationals than rationals. It is that there are specific programs which you can't decide whether they represent reals.

From a constructivist's eyes, the traditional proof that there are more irrationals falls apart because you're reasoning about unprovable statements about arbitrary sequences whose logic could have been constructed with the same sort of logic that you're applying to them. Is it any wonder that you wind up concluding the "existence" of things that clearly don't actually exist?

Now stepping back from BOTH philosophies, the differences between them lie in different attitudes about existence and truth. Attitudes that underly the axioms which we use, and cannot possibly be proven one way or another. (Gödel actually proved that. Any contradiction in Constructivism is immediately a contradiction in classical mathematics. But conversely there is a purely mechanical transformation of any proof in classical mathematics which resulted in a contradiction, into a constructive proof that also results in a contradiction.)

Re:Inventor Claims to Have Solved Floating Point Error Problem by umanwizard on Thursday January 18, 2018 @09:11PM (#16183577)
Excellent explanation, thanks! But I feel compelled to point out that only a small minority of working mathematicians are constructivists.
Re:Inventor Claims to Have Solved Floating Point Error Problem by btilly on Sunday January 21, 2018 @01:18PM (#16199188)
This is true.

However there is no logical argument that can disprove the constructivist view, in which there aren't "more" irrationals than rationals. And therefore the logical argument that there is must have some hidden implicit assumptions.

Re:Inventor Claims to Have Solved Floating Point Error Problem by enedil on Thursday January 18, 2018 @12:50PM (#16179381)
For every rational, there are infinitely many rational numbers too, since finite cartesian product of countable sets is countable.
Re:Inventor Claims to Have Solved Floating Point Error Problem by umanwizard on Thursday January 18, 2018 @01:48PM (#16180047)
I wasn't talking about irrational numbers.
Re:Inventor Claims to Have Solved Floating Point Error Problem by pcvarmint on Thursday January 18, 2018 @08:09PM (#16183223)
But all non-computable numbers are irrational.
Re:Inventor Claims to Have Solved Floating Point Error Problem by TuringTest on Friday January 19, 2018 @04:36AM (#16185082)
No, there are also non-computable numbers that are imaginary, complex, or transfinite.
Re:Inventor Claims to Have Solved Floating Point Error Problem by pcvarmint on Friday January 19, 2018 @01:00PM (#16188259)
All rational numbers are real. Therefore all non-real numbers are irrational.
Re:Inventor Claims to Have Solved Floating Point Error Problem by TuringTest on Monday January 22, 2018 @05:39AM (#16203382)
Uh, no, "irrational" is defined as a subset of real numbers.
Re:Inventor Claims to Have Solved Floating Point Error Problem by pcvarmint on Wednesday January 24, 2018 @11:23PM (#16228751)
Non-rational, then.

This is about as consequential as debating whether 1 is a prime number.

Re:Inventor Claims to Have Solved Floating Point Error Problem by TuringTest on Thursday January 25, 2018 @03:44AM (#16229632)
This thread was about "all the numbers that it's theoretically impossible to compute". If you think the difference between "irrational" and "non-rational" in this context is irrelevant, you have a weak grasp of number theory. Yes, all are non-computable, but in different ways.
Re:Inventor Claims to Have Solved Floating Point Error Problem by umanwizard on Thursday January 18, 2018 @01:48PM (#16180052)
Yes, almost all real numbers are irrational, but I was talking about non-computable numbers, not irrational numbers.
Re:Inventor Claims to Have Solved Floating Point Error Problem by saltcured on Thursday January 18, 2018 @12:32PM (#16179110)
Well, if I remember correctly, a product of an irrational and a rational is still irrational, right?

If so, here's a simple argument: If you have N rational numbers and I have K irrationals to start with, I can produce roughly N*K additional irrationals. Since we know at least two irrationals (pi and e) we can make at least twice as many irrationals as rationals.

Re:Inventor Claims to Have Solved Floating Point Error Problem by jjgreen on Thursday January 18, 2018 @12:41PM (#16179250)
Unfortunately this argument fails -- there are twice as many whole numbers as there are odd numbers right? but they are in 1:1 correspondence

0 <-> 1

1 <-> 3

2 <-> 5

   :
so the odd and whole numbers have the same cardinality: there are the same number of each.
Re:Inventor Claims to Have Solved Floating Point Error Problem by jjgreen on Thursday January 18, 2018 @12:38PM (#16179190)
There are, see Cantor's diagonal argument.
Re:Inventor Claims to Have Solved Floating Point Error Problem by yarg on Thursday January 18, 2018 @12:43PM (#16179274)
If they can't be computed, what are you planning on using them for? The biggest problem is going to be with the useful transcendentals.
Re:Inventor Claims to Have Solved Floating Point Error Problem by dllthomas on Thursday January 18, 2018 @05:42PM (#16182315)
At the risk of explaining the joke, obviously if I can't compute a number I won't need to represent it...
Re:Inventor Claims to Have Solved Floating Point Error Problem by craftyguy on Thursday January 18, 2018 @01:34PM (#16179890)
>Actually it's possible to represent 1/3 perfectly accurately

I'm curious, how?

Re:Inventor Claims to Have Solved Floating Point Error Problem by ars on Thursday January 18, 2018 @01:36PM (#16179921)
> I'm curious, how?

As 1/3 - exactly as it's on your screen. All rational numbers can be represented exactly.

Re:Inventor Claims to Have Solved Floating Point Error Problem by craftyguy on Thursday January 18, 2018 @01:44PM (#16180011)
Hmm, yes, it can be represented in ASCII. But you still have to approximate when storing it in a way that is actually useful for computation using a finite number of bits.
Re:Inventor Claims to Have Solved Floating Point Error Problem by dragonwriter on Thursday January 18, 2018 @02:06PM (#16180246)
Many real programming languages support arbitrary precision decimal and/or rational numbers.

Sure, there are times when space or speed concerns favor inexact representation over correctness, but that's an optimization that ought to be properly evaluated; the fact that lots of languages are designed in a way which makes it the default everyone reaches for contributes to lots of errors.

Re:Inventor Claims to Have Solved Floating Point Error Problem by umanwizard on Thursday January 18, 2018 @01:47PM (#16180044)

    struct rational {
        int numerator;
        int denominator;
    };
Re:Inventor Claims to Have Solved Floating Point Error Problem by mamcx on Thursday January 18, 2018 @09:49PM (#16183781)
And another dumb questions:

Is possible to convert to rationals in calculations?

So if I do:

1/3 + 4 + sum / total it record values properly?

Re:Inventor Claims to Have Solved Floating Point Error Problem by dreamcompiler on Friday January 19, 2018 @12:06AM (#16184251)
Yes. Common Lisp is an example of a language that can represent rationals exactly and do arithmetic on them. You can avoid floating-point precision loss by using this method. But there are drawbacks: 1) The numerator and denominator will often turn into bignums as a calculation progresses, consuming ever-larger amounts of space and time, and 2) This won't help you with any calculation involving irrationals, except to prevent your initial imprecision from growing larger.
Re:Inventor Claims to Have Solved Floating Point Error Problem by squeaky-clean on Thursday January 18, 2018 @02:15PM (#16180341)
I've definitely owned a Casio calculator that worked on fractions rather than decimals and could even work in terms of roots and certain irrational numbers like e and pi.

For example, sqrt(2) + sqrt(8) would print 3 sqrt(2) rather than 4.242640687119286~

I wish I knew how it worked, it's probably something simple like suggested in another comment.

Re:Inventor Claims to Have Solved Floating Point Error Problem by enedil on Thursday January 18, 2018 @04:27PM (#16181629)
Look at any computer algebra system, for exaple sympy (https://sympy.org) and see how they implement it (it's open source).