Estimating accuracy in finite precision computations - Printable Version +- HP Forums ( https://archived.hpcalc.org/museumforum)+-- Forum: HP Museum Forums ( https://archived.hpcalc.org/museumforum/forum-1.html)+--- Forum: Old HP Forum Archives ( https://archived.hpcalc.org/museumforum/forum-2.html)+--- Thread: Estimating accuracy in finite precision computations ( /thread-239387.html) |

Estimating accuracy in finite precision computations - mpi - 02-20-2013
Is there any calculator able to provide actual accuracy information along with numeric value, at the end of a computation chain?
Re: Estimating accuracy in finite precision computations - Paul Dale - 02-20-2013
Interval arithmetic can provide a bounds estimate on a result. No calculator currently implements this natively, although I did consider it for the WP 34S. There are a few interval arithmetic libraries around (mpfi e.g.). None are really suitable for a calculator.
Re: Estimating accuracy in finite precision computations - Valentin Albillo - 02-21-2013
Quote:
in said result.estimate of the number of correct digits
A few years ago (2008 ?) I wrote a comprehensive 12-page article intended for timely publication in If and when I eventually find some suitable publication which will accept it (them), I'll let the HP Forum know.
Best regards from V. Re: Estimating accuracy in finite precision computations - Gjermund Skailand - 02-21-2013
In my longfloat library for hp49 and hp50g I did include interval arithmetic. It was not tested much, and It does not cover matrix calculations. see www.hpcalc.org
Re: Estimating accuracy in finite precision computations - Walter B - 02-21-2013
Buenas dias Valentin, Your post's mouth watering on one hand and frustrating on the other. I know about your dispute with Datafile but don't see any solution so far. OTOH I don't like the community being taken hostage for that. Is there a chance you find a way to share your findings with the people here? d:-)
P.S.: I'm no member of HPCC anymore for some years now (but have published a bit there, too, though far more basic than your contributions).
Re: Estimating accuracy in finite precision computations - Paul Dale - 02-21-2013
Does it cover trig, exponential and logarithmic functions? Doing basic arithmetic using intervals isn't difficult and the 34S would be more than capable of supporting the required operations -- it has a very good selection of rounding modes which are required for this.
Re: Estimating accuracy in finite precision computations - Gjermund Skailand - 02-21-2013
yes it covers trig, exponential and logarithmic functions, and you can use if for automatic evaluating of formulas. However it is sys-rpl and so it is rather slow... I have been trying to port it to hpgcc3 (for the hp50g) but can't get the decnumber library to round figures correctly. Re: Estimating accuracy in finite precision computations - Valentin Albillo - 02-21-2013
Quote:
Gutten Morgen, Walter. Quote:
Thanks a lot for your interest and kind appreciation but I must say it's not my intention to frustrate anyone, Quote:
It's probably the case that discussion about this dispute is out of topic in this Forum so I'll refrain
Nevertheless, for any dispute or problem, arriving at a solution requires as a bare minimum that the other Quote:
Quote:
As I see it, there are mainly two possibilities, namely: (a) The other part shows interest and attempts communication.
Once the articles appear in print I would make the PDF versions available online timely and for free, of course. Quote:
Neither am I.
It wasn't so I terminated my subscription as I wasn't paying to read
Best regards from V. Re: Estimating accuracy in finite precision computations - mpi - 02-21-2013
Thanks Paul and Valentin. Valentin, this is really great news, and I can't wait to see such function being tightly integrated by some manufacturer: that would be a really useful step-change feature!
Have you implemented a version on recent products such as HP50 or HP39gII?
Thanks!
Re: Estimating accuracy in finite precision computations - hugh steers - 02-21-2013
Some years ago i wrote a calculator on this basis. Also a version of LUA that incorporated a dynamic precision number type.
Here's a really old page with a calculator for the pocket PC
Also, you can download windows binary to play with the calculation engine, here. I just recompiled it so you wont have to find the DLLs from 1974 :-) The calculator uses dynamic precision. I did a talk a while back on the implementation of this idea. Basically you encode an interval as a single number and perform the appropriate interval arithmetic. For trig functions you have to widen your uncertainty by an upper error bound from your approximation. eg for Taylor series, use the truncated term as the error bound. and so on... Yes, it's definitely possible on handheld calculators. Personally, i think they should _all_ do this internally, even for a cheap college model. It would be educational to show kids where their calculations go bad.
Re: Estimating accuracy in finite precision computations - mpi - 02-21-2013
Thanks Hugh, Quote:Can't agree more! And I think first maker that integrates something like this (and of course properly market it to teachers), will see some good return on marketshare: it's a such a striking and valuable differentiator (until some else gets it done). PS: maybe a nice addition to contemplate for Reckon then! ;)
Re: Estimating accuracy in finite precision computations - hugh steers - 02-21-2013
Yes, i think something like this could be a market opener - the calculator that never gets the wrong answer or something. I'm sure marketing could come up with a great way to sell this idea. The Education and financial calculator market strike me as obvious targets. Regarding hardware, pretty much all existing platforms could easily accommodate the additional calculation overhead. CPU is plentiful, you'd need a little bit more RAM than before, but not a lot. My old code was a mashup of ideas during the time i was discovering this technique, that's why i never released source code. Maybe I'll rewrite it properly. If i do, it will be a lot smaller and faster. The Reckon project will morph into something else, as well as stuff like this, i wanted to add a programming language and a CAS. The idea is the CAS would be written in the programming language itself. Also, before anyone says so, i'd like to stress that the "CAS" will be of a fairly pedestrian nature. There's no point in dreaming it will be as good as the big cas packages, it can't be. But it could, nevertheless still be useful in a limited way when on a portable device (eg polynomials, series, simple calculus etc.).
Re: Estimating accuracy in finite precision computations - Thomas Klemm - 02-21-2013
Quote:
I'd be interested to see what's happening after a few iterations of the logistic map when
Kind regards Re: Estimating accuracy in finite precision computations - hugh steers - 02-21-2013
Regions that are stable will calculate quickly, but unstable regions - where lots of cancellation is happening, wind up calling in more and more precision. Your choices are to keep expanding the precision to try to meet a target, where eventually you have to stop due to constrains, OR to expand only to a limit then deliver the number of digits you can prove are correct. Some calculations can result in the total annihilation of all precision. Amusingly you need a new symbol to display in this case (eg "-" or just ".", or perhaps "-." if known negative!). But at least you know you haven't got an answer and, like i said, "never gets the wrong answer"
:-)
Re: Estimating accuracy in finite precision computations - Thomas Klemm - 02-21-2013
A fixed point of
This little program will illustrate this behavior: #!/usr/bin/python
This is the result: 0.749999 0.750000 0.750001 While the interval might indicate a "total annihilation of all precision" the main value is still 100% correct.
It might seem obvious in the case above where the periodicity is 1 because you notice that
Quote: You might return after 17 iteration to your initial value (or to something very close) but think after 16 iterations that the result is utter garbage because the interval indicates so.
Kind regards
Just to illustrate the last point we can calculate the fixed points of the n-th iteration using the formula: You can use the following lines in the program above to calculate the fixed point for 5 iterations:
from math import *
This results in the following table: 0 0.040520 As can be seen we return to the initial value after the 5th, 10th, 15th, ... iteration, while the interval degrades.
Or if you prefer the example where n = 17:
from math import *
0 0.392606
Re: Estimating accuracy in finite precision computations - mpi - 02-22-2013
Quote:Bart on the HP Community forum pointed me to prof. William Kahan's articles http://www.cs.berkeley.edu/~wkahan/ Following one is particularly interesting about causes & remedies... http://www.cs.berkeley.edu/~wkahan/Mind1ess.pdf (and it's longer version for the most courageous) Have similar type studies been of inspiration for the techniques you or Valentin developed?
Re: Estimating accuracy in finite precision computations - Wlodek Mier-Jedrzejowicz - 02-24-2013
Dear Valentin, as you say, this is not the right place to discuss Datafile, but where is? You were upset that we did not communicate to you the result of an AGM and you told me that you would consider sometimes writing for Datafile again, but not regularly. Can I ask you if you would write about this topic, please? Many thanks and Best Wishes.
Re: Estimating accuracy in finite precision computations - Valentin Albillo - 02-25-2013
Dear Wlodek:
Quote: First of all, thanks for replying to my post here, Wlodek, I really hope you're doing well.
Then again you might perhaps remember that I did send you a lengthy e-mail five months ago (2012-10-07), which you promptly replied to a few hours later. It was a very, very short reply as, in your own words:
Alas, it wasn't to be. You Of course I understand you're very busy with all kinds of matters, including personal ones and such, but actually that's also my case and it's probably the case for many people participating in this forum, many of which also have their hands full of things and businesses to attend to. In the end it's just a matter of interest and priorities, and it seems your interests and your priorities do not extend to emailing detailed replies to my emails or indulging in a productive exchange of ideas with me. This I can understand and fully respect but I also value my time and have my priorities so you'll receive no further "lengthy" emails from me unless and until you're willing to reply to them in a reasonable amount of detail, so that I'll know for sure that you're indeed interested and not going through the motions out of mere politeness.
Take care, and Best regards from V. |