HP Forums

Full Version: Question for Joe Horn, Dieter, and other
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Considering real numbers that are very close to integer. That is a real number R is close to an integer I:

R = I + e

Where e = +/- a small number like 1e-8 or even less.

If I represent R using complex number notation (I, e), would the use of complex math operations (adding, subtracting, etc.) between two near-integer-value floating-point numbers, yield more accurate results than straight forward operations between these same numbers? That is, for example:

R1 * R1 is less accurate than? (I1, e1) * (I2, e2)

Namir
(11-01-2017 05:32 PM)Namir Wrote: [ -> ]If I represent R using complex number notation (I, e), would the use of complex math operations (adding, subtracting, etc.) between two near-integer-value floating-point numbers, yield more accurate results than straight forward operations between these same numbers? That is, for example:

R1 * R1 is less accurate than? (I1, e1) * (I2, e2)

For addition and subtraction it seems obvious that adding/subtracting the integer parts and "e" separately improves accuracy. On the one hand because "e" may be represeted exactly where I+e may already show roundoff errors, on the other hand because the result (I1+I2, e1+e2) may yield a more exact value for e1+e2 as both I1+I2 and e1+e2 may be represented with, say, 10 or 12 significant digits each.

But how do you want to multiply two numbers with this method?
(I1+e1)*(I2+e2) equals I1*I2+e1*I2+I1*e2+e1*e2 while (I1, e1)*(I2, e2) is (I1*I2–e1*e2,  I1*e2+I2*e1). Note the minus !

Dieter
I don't think complex numbers are the answer.

7*X+.0000001

&

3*Y+.0000000045

With some manipulation that would be good for addition & multiplication.
For multiplication this is nice:

[[ 5. ]
[ .0016 ]]

[[ 1. .000123 ]]

[[ 5. .000615 ]
[ .0016 .0000001968 ]]
Interval arithmetic rather than complex is the answer here?

Pauli
Namir, do you have any concrete examples where using complex numbers as you propose would yield additional accuracy? If so, I'd love to see them.
With a little (but still constant) more work, Khahan summation is useful. This guarantees control of rounding errors in sum.
(11-02-2017 03:30 AM)Joe Horn Wrote: [ -> ]Namir, do you have any concrete examples where using complex numbers as you propose would yield additional accuracy? If so, I'd love to see them.

Say we have:

R1 = 5.00000001 = (5, 0.00000001) =(I1, e1)
R1 = 4.00000001 = (4, 0.00000001) =(I2, e2)

Is R1 * R2 less accurate than (I1, e1) * (I2, e2)?

Is R1/R2 less accurate than (I1, e1) / (I2, e2)?

Namir
As you are not using the structure of the complex numbers, a list or an array of reals (or integers) may be easier to use.
Hi Namir!

When I was Mechanical Engineer student (17 years ago! OMG!!), I wrote short routines on my 32SII for calculating numbers with errors.

For example if I want to calculate what is the error of volume of a cylinder if the diameter is (0.2 +/- 0.01)m and the height is (0.5 +/- 0.015)m I must to know how to calculate (0.2 +/- 0.01)^2×PI÷4×(0.5 +/- 0.015).

Here is my routines: HP32SII Calculation with intervals.pdf, please check it.

The available routines:
• LAST x
• LAST y
• ENTER
• x CHANGE y
• CLx ( == KILL)
• STO
• RCL
• SUBSTRACT
• MULTIPLICATE
• DIVIDE
• INVERSE
• POWER
• ROOT OF
• NAT. LOG
• --- and additionally ---
• SINE
• TAN

Enjoy!
Csaba
(11-03-2017 08:32 PM)Csaba Tizedes Wrote: [ -> ]calculating numbers with errors

...what a silence here I guess this is not so high.

It is based on this (Wikipedia).

17 years before my programming attitude was so strange and I found some unthinking part (eg. LBL K), so it is required to update. By the way with these routines easy to solve all error propagation calculation during engineering work. With new calculators which are capable to do differentiation, this task is more easily solvable.

Csaba
(11-05-2017 01:48 PM)Csaba Tizedes Wrote: [ -> ]...what a silence here I guess this is not so high.

Probably the main reason for lack of feedback is the document is not in English, and most readers here are English speaking, with a lot of Spanish, French and German as well, however the document appeared to me to be in a different language than any of these.
(11-05-2017 01:57 PM)rprosperi Wrote: [ -> ]
(11-05-2017 01:48 PM)Csaba Tizedes Wrote: [ -> ]...what a silence here I guess this is not so high.

Probably the main reason for lack of feedback is the document is not in English, and most readers here are English speaking, with a lot of Spanish, French and German as well, however the document appeared to me to be in a different language than any of these.

Looks Hungarian to me (Google Translate of one of the words, and Csaba Tizedes' profile).
(11-05-2017 06:06 PM)DGM Wrote: [ -> ]Looks Hungarian to me (Google Translate of one of the words, and Csaba Tizedes' profile).

Yes, this is Hungarian, but - unfortunately - I typed it without accents, therefore hard to translate it with Google (and Hungarian agglutinative language, therefore real challenge for the Google to translate from/to Hungarian).

By the way, this is not that what Namir is requested.

Csaba
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :