Floating point bug in Canon F-789SGA - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: Not HP Calculators (/forum-7.html) +--- Forum: Not remotely HP Calculators (/forum-9.html) +--- Thread: Floating point bug in Canon F-789SGA (/thread-2521.html) Floating point bug in Canon F-789SGA - Peter Van Roy - 11-30-2014 07:32 PM I recently bought a Canon F-789SGA calculator because its specification intriguingly mentions that it has 18 digit precision. Tests show that it actually has 20 digit internal precision, and transcendental functions actually achieve this precision. That is the nice part. Unfortunately, the calculator has bugs in its floating point operations. It took me a while to figure out what was going on, since there are several bugs that interact in unobvious ways. The main bug is an error in floating point addition. When doing a floating point addition A+B, if the difference in exponents between the two numbers A and B is 16, 17, 18, or 19, and if the lower four digits of the larger number are 0000, then the smaller number is not added in. That is, the lower four digits of the result stay 0000. For example, doing the addition 1 + 1E-16 gives exactly 1 instead of 1.0000000000000001. Floating point subtraction has a similar bug. There are other irregularities in the floating point operations, in particular, the value of the last (20th) digit also plays a role. My guess to the origin of this bug is that the calculator is an improved version of a Casio calculator with 16 digit precision. Possibly the internal precision was increased without proper testing. Has anyone else found similar bugs in these or other recent calculators? RE: Floating point bug in Canon F-789SGA - Steve Simpkin - 11-30-2014 08:36 PM Other than this bug, this model compares favorably to the Casio FX-115ES Plus, Sharp EL-W516B (or X) and TI TI-36X Pro with some features the others do not have. How do the buttons feel? RE: Floating point bug in Canon F-789SGA - Peter Van Roy - 12-01-2014 10:20 AM (11-30-2014 08:36 PM)Steve Simpkin Wrote:  Other than this bug, this model compares favorably to the Casio FX-115ES Plus, Sharp EL-W516B (or X) and TI TI-36X Pro with some features the others do not have. How do the buttons feel? The buttons are not the best I have seen, but they are usable. They do not detract from the use of the calculator. RE: Floating point bug in Canon F-789SGA - Gerald H - 12-05-2014 02:20 PM (11-30-2014 07:32 PM)Peter Van Roy Wrote:  I recently bought a Canon F-789SGA calculator because its specification intriguingly mentions that it has 18 digit precision. Tests show that it actually has 20 digit internal precision, and transcendental functions actually achieve this precision. That is the nice part. Unfortunately, the calculator has bugs in its floating point operations. It took me a while to figure out what was going on, since there are several bugs that interact in unobvious ways. The main bug is an error in floating point addition. When doing a floating point addition A+B, if the difference in exponents between the two numbers A and B is 16, 17, 18, or 19, and if the lower four digits of the larger number are 0000, then the smaller number is not added in. That is, the lower four digits of the result stay 0000. For example, doing the addition 1 + 1E-16 gives exactly 1 instead of 1.0000000000000001. Floating point subtraction has a similar bug. There are other irregularities in the floating point operations, in particular, the value of the last (20th) digit also plays a role. My guess to the origin of this bug is that the calculator is an improved version of a Casio calculator with 16 digit precision. Possibly the internal precision was increased without proper testing. Has anyone else found similar bugs in these or other recent calculators? i'm not sure it's a bug. Handbook says: "Precision +/- 1 at the 10th digit for a single calculation +/- 1 at the least significant for exponential display" (page 10) which I don't really understand, but could imply you are requiring accuracy above specifications. Specs are certainly exceeded by the PFact function, where the greatest factor is declared "unfactored" whether prime or composite - in fact, the greatest factor found is prime for all values < 1009^2. Overall a pleasant calculator & accurate & integration is annoyingly slow. RE: Floating point bug in Canon F-789SGA - Peter Van Roy - 12-05-2014 09:39 PM (12-05-2014 02:20 PM)Gerald H Wrote:  i'm not sure it's a bug. Handbook says: "Precision +/- 1 at the 10th digit for a single calculation +/- 1 at the least significant for exponential display" (page 10) which I don't really understand, but could imply you are requiring accuracy above specifications. The specification says clearly that internal precision is 18 digits (see page 11 of F-789SGA Scientific Calculator User Instructions). It is quite common for calculators to have higher internal precision than what they display. My observations show that floating point addition has a bug at the 17th and 18th digits. RE: Floating point bug in Canon F-789SGA - Gerald H - 12-06-2014 06:37 AM (12-05-2014 09:39 PM)Peter Van Roy Wrote:   (12-05-2014 02:20 PM)Gerald H Wrote:  i'm not sure it's a bug. Handbook says: "Precision +/- 1 at the 10th digit for a single calculation +/- 1 at the least significant for exponential display" (page 10) which I don't really understand, but could imply you are requiring accuracy above specifications. The specification says clearly that internal precision is 18 digits (see page 11 of F-789SGA Scientific Calculator User Instructions). It is quite common for calculators to have higher internal precision than what they display. My observations show that floating point addition has a bug at the 17th and 18th digits. Can't find the referenced text in "User Instructions" E-IM-2725 page 11 nor in f789sga.pdf E-IE-455 page 11. RE: Floating point bug in Canon F-789SGA - Peter Van Roy - 12-09-2014 07:38 PM (12-06-2014 06:37 AM)Gerald H Wrote:  Can't find the referenced text in "User Instructions" E-IM-2725 page 11 nor in f789sga.pdf E-IE-455 page 11. It's on the bottom of page 10 in E-IE-455, the first entry in the first table in section Input Range and Error Messages. It's page 11 when viewing the pdf document but numbered as page 10 on the page itself. RE: Floating point bug in Canon F-789SGA - Gerald H - 12-10-2014 06:35 AM (11-30-2014 07:32 PM)Peter Van Roy Wrote:  I recently bought a Canon F-789SGA calculator because its specification intriguingly mentions that it has 18 digit precision. Tests show that it actually has 20 digit internal precision, and transcendental functions actually achieve this precision. That is the nice part. Unfortunately, the calculator has bugs in its floating point operations. It took me a while to figure out what was going on, since there are several bugs that interact in unobvious ways. The main bug is an error in floating point addition. When doing a floating point addition A+B, if the difference in exponents between the two numbers A and B is 16, 17, 18, or 19, and if the lower four digits of the larger number are 0000, then the smaller number is not added in. That is, the lower four digits of the result stay 0000. For example, doing the addition 1 + 1E-16 gives exactly 1 instead of 1.0000000000000001. Floating point subtraction has a similar bug. There are other irregularities in the floating point operations, in particular, the value of the last (20th) digit also plays a role. My guess to the origin of this bug is that the calculator is an improved version of a Casio calculator with 16 digit precision. Possibly the internal precision was increased without proper testing. Has anyone else found similar bugs in these or other recent calculators? (12-09-2014 07:38 PM)Peter Van Roy Wrote:   (12-06-2014 06:37 AM)Gerald H Wrote:  Can't find the referenced text in "User Instructions" E-IM-2725 page 11 nor in f789sga.pdf E-IE-455 page 11. It's on the bottom of page 10 in E-IE-455, the first entry in the first table in section Input Range and Error Messages. It's page 11 when viewing the pdf document but numbered as page 10 on the page itself. No - in the pdf on page 10 "Nr of digits for internal calc : Up to 18", spec met by trig funcs & everything else too, as "up to" is a guarantee of nothing. In "Calculation Examples" paper document, example #6, page 4, Nr digits for internal prec 18 BUT also +/- 1 at the 10th digit. You can accuse Canon of sloppy, unclear documentation but I don't think the claim of calc not fulfilling specs is warranted. RE: Floating point bug in Canon F-789SGA - Peter Van Roy - 12-13-2014 06:17 PM (12-10-2014 06:35 AM)Gerald H Wrote:  You can accuse Canon of sloppy, unclear documentation but I don't think the claim of calc not fulfilling specs is warranted. Independent of whatever the spec claims or not, it is a fact that this calculator has bugs in its basic floating point operations. Caveat emptor if you want to use this calculator for any important computations. RE: Floating point bug in Canon F-789SGA - Gerald H - 12-14-2014 06:43 AM (12-13-2014 06:17 PM)Peter Van Roy Wrote:   (12-10-2014 06:35 AM)Gerald H Wrote:  You can accuse Canon of sloppy, unclear documentation but I don't think the claim of calc not fulfilling specs is warranted. Independent of whatever the spec claims or not, it is a fact that this calculator has bugs in its basic floating point operations. Caveat emptor if you want to use this calculator for any important computations. Certainly "Caveat calculator" when the calculator (in Latin he was a person, female calculatrix) uses an electrical friend to calculate. The Canon machine is still better than using extended reals in the HP 48G - I've tested this. As for comparisons of most calculation results on the current offerings I'd like to know more. RE: Floating point bug in Canon F-789SGA - daschel - 02-04-2018 04:01 AM (12-13-2014 06:17 PM)Peter Van Roy Wrote:   (12-10-2014 06:35 AM)Gerald H Wrote:  You can accuse Canon of sloppy, unclear documentation but I don't think the claim of calc not fulfilling specs is warranted. Independent of whatever the spec claims or not, it is a fact that this calculator has bugs in its basic floating point operations. Caveat emptor if you want to use this calculator for any important computations. Hello, and my apologies if this thread has long been forgotten. But I have some findings which might change your perspective on this. I came across your post and tried your original test on a Canon F-792SGA, as well as with an HP 33s. And they both showed a loss of accuracy before their respective internal precision limits were reached. The Canon (as you've already shown) loses precision with anything smaller than 1E-15, despite it's reputed 18-digit accuracy. This is not to be disputed; my results were exactly the same as yours. But it might surprise you that the HP 33s 'fails' your test with exponents lesser than -11. And this is in spite of its 15-digits of internal accuracy. It seems to me that you had singled out the Canon F-792SGA while other reputable (and pricier) calculators didn't fare any better, as they both fall short 3—5 digits of what would be expected, given their specs. Note: I asked the owner of an HP 35s to run the same test on his calculator and he notifed me of similar results. To say the Canon isn't worthy of "serious" computations based your test is to impugn the functionality of other well-respected calculators; I seriously doubt you'll find too many mathematicians, engineers or statisticians who'd agree that the HP 33s isn't up to serious work—despite it falling short of anticipated results. The same courtesy must therefore be extended to the Canons. I suspect the width of temporary memory registers and legacy numerical libraries might all play a role in causing this. But the Canon F-792SGA is not to be faulted on this point, especially when compared with other "serious" calculators. I hope you've found enjoyment with your F792SGA, or with another model that suits your requirements. Based on my experiment, I'm inclined to agree with the other poster who describes this as a documentation—but not a technical—problem. RE: Floating point bug in Canon F-789SGA - Albert Chan - 07-17-2018 12:55 AM Floating point bug is actually a "feature" (put inside intentionally). http://people.ku.edu/~wzhuang/CAMseminar/CAM06Fall/DirtySecrets.pdf Without this "feature", they might get many customer complains: https://www.askvg.com/microsoft-windows-calculator-bug/ It is hand-holding feature for people don't understand floating point. They expected sqrt(4) - 2 = 0, not some tiny tiny number. But, allowing calculator to "fix" the values, the final result is not as precise. The medicine is worse than the cure ... RE: Floating point bug in Canon F-789SGA - Tugdual - 07-17-2018 04:08 PM This calculator totally looks like a Casio, did you try the self test with shift+on+7 then 9 (or 8) ? RE: Floating point bug in Canon F-789SGA - Albert Chan - 07-17-2018 05:27 PM (07-17-2018 04:08 PM)Tugdual Wrote:  This calculator totally looks like a Casio, did you try the self test with shift+on+7 then 9 (or 8) ? No, I were not hit by the calculator collecting bug. From what I have read, Canon does look like a Casio ...