HP Forums
Euler Identity in Home - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Euler Identity in Home (/thread-1033.html)

Pages: 1 2 3 4


Euler Identity in Home - ColinJDenman - 04-04-2014 12:09 AM

Apparently, despite Euler, e^ipi + 1 = -2.07E-13i, which seems quite a large difference


RE: Euler Identity in Home - Helge Gabert - 04-04-2014 12:57 AM

Of course, Home view is approximate by design.

Do it in CAS, and you will get zero exactly, as Euler intended.


RE: Euler Identity in Home - ColinJDenman - 04-04-2014 01:14 AM

Hmm...

I'm surprised by the size of the approximation, and also observe that other traditional approximations (on other, ancient non-HP calculators) tend to make their presence felt with basic trig like sin(90) etc, which are caught on HP calcs.

On an old (semi-notorious National Semiconductor) RPN calculator sin(90) yields 0.999999999997 or thereabouts, leading to much amusement amongst rich HP owners.

I wonder what other e^ix capable HPs yield -- does the 50/38/39 yield a similar answer?


RE: Euler Identity in Home - Helge Gabert - 04-04-2014 01:48 AM

HP50G: -2.0676 . . . E-13i


RE: Euler Identity in Home - ColinJDenman - 04-04-2014 05:09 AM

Hmmm... part 2

Further fiddling shows, in Home mode,
in degrees mode sin(180) = 0
in radians mode sin(pi) = -2.07E-13

But e^i*pi in degrees mode gives the 2.07E-13. I begin to feel this is less a question of Exact versus Approximate, but rather some inconsistency internally.

In CAS with exact checked (with Solve as the app (just because it was set to Radians))
sin(pi) = 0
and with Parametric as the app (set to degrees)
sin(180) = 0

With exact, CAS, degrees (Para)
e^i*pi +1 = 0 // yippee
exact, CAS, radians (Solve)
e^i*pi + 1 = 0
With exact unchecked, in CAS, degrees (Parametric)
e^i*pi + 1 = 1.078E-14i
in radians (Solve)
... exactly the same

Am I wrong to be confused :-) It's making me suspicious of the results I get (which on some level is probably a good thing). I'm not sure I can trust my Prime any more, which isn't a good attribute in a calculator.


RE: Euler Identity in Home - HP67 - 04-04-2014 06:05 AM

50g CAS mode

Code:
 0



RE: Euler Identity in Home - Marcus von Cube - 04-04-2014 12:41 PM

(04-04-2014 05:09 AM)ColinJDenman Wrote:  But e^i*pi in degrees mode gives the 2.07E-13. I begin to feel this is less a question of Exact versus Approximate, but rather some inconsistency internally.

In Home, π is just a floating point (BCD) number, not a symbolic constant. Thus, sin(π) simply isn't zero. I wouldn't be surprised if the result is the correctly rounded result of computing sin(3.14159265359).


RE: Euler Identity in Home - orcinus - 04-04-2014 04:18 PM

I honestly don't get what the confusion is.

Home = numeric
CAS = symbolic

Numeric pi is a numeric (!) float constant, with a limited precision.
Symbolic pi is treated as a symbolic (!) entity, not a number.

Therefore, you'll get an approximation limited by the precision of numeric pi on the Home screen and an exact symbolic result on the CAS screen.

If you replace pi with 180 in degrees mode on Home, of course you'll get an exact result - 180 is a natural number, pi is transcedental.


RE: Euler Identity in Home - Joe Horn - 04-04-2014 09:26 PM

(04-04-2014 12:41 PM)Marcus von Cube Wrote:  In Home, π is just a floating point (BCD) number, not a symbolic constant. Thus, sin(π) simply isn't zero. I wouldn't be surprised if the result is the correctly rounded result of computing sin(3.14159265359).

You're right: it is. SIN(exactly 3.14159265359 radians) = -2.0676153735661672...E-13, which rounds to the same result as given by all HP 12-digit BCD calculators.

Edit: Some HP 10-digit BCD calculators were not as accurate. For example, the HP-19C, '97, and '41 return only 2 significant digits: exactly -4.1E-10 for SIN(exactly 3.141592654 radians), whereas the correct answer is -4.102067615373566167...E-10.

HEY... the HP-65 returns 0 for SIN(3.141592654). What's up with that?


RE: Euler Identity in Home - orcinus - 04-05-2014 04:08 AM

(04-04-2014 09:26 PM)Joe Horn Wrote:  HEY... the HP-65 returns 0 for SIN(3.141592654). What's up with that?

I think i've seen a Casio model do that once.


RE: Euler Identity in Home - jebem - 04-05-2014 04:18 PM

(04-04-2014 09:26 PM)Joe Horn Wrote:  HEY... the HP-65 returns 0 for SIN(3.141592654). What's up with that?

The same result for HP-25. Just tried it a few minutes ago.
"f" "SCI" "3"
"g" "RAD";
"g" "PI";
"ENTER";
"f" "sin";
Result: 0.000 00

"Rotate down";
"f" "cos";
Result: -1.000 00

"g" "PI";
"ENTER";
"2";
"/"
"f" "sin";
Result: 1.000 00

That's what I remember from the classic calculators like the HP-55 and HP-67 as well.


RE: Euler Identity in Home - jebem - 04-05-2014 04:28 PM

(04-04-2014 09:26 PM)Joe Horn Wrote:  HEY... the HP-65 returns 0 for SIN(3.141592654). What's up with that?

And now with a Texas TI-57, exactly the same result as well:
"2nd" "Rad";
"2nd" "PI";
"2nd" "sin";
Result: 0

"2nd" "PI";
"2nd" "cos";
Result: -1

"2nd" "PI";
"/";
"2";
"="
"2nd" "sin";
Result: 1


RE: Euler Identity in Home - jebem - 04-05-2014 04:35 PM

(04-04-2014 09:26 PM)Joe Horn Wrote:  HEY... the HP-65 returns 0 for SIN(3.141592654). What's up with that?

Also, using a Texas TI-51-III, got the same result again:
"2nd" "Rad";
"2nd" "PI";
"sin";
Result: 0

"2nd" "PI";
"cos";
Result: -1

"2nd" "PI";
"/";
"2";
"="
"sin";
Result: 1


RE: Euler Identity in Home - jebem - 04-05-2014 04:41 PM

(04-04-2014 09:26 PM)Joe Horn Wrote:  HEY... the HP-65 returns 0 for SIN(3.141592654). What's up with that?

And what about a CASIO FX-39?
Guess what... the same result again:
Select "RAD" on the right side sliding switch;
"INV" "PI";
"sin";
Result: 0

"INV" "PI";
"cos";
Result: -1

"INV" "PI";
"/";
"2";
"="
"sin";
Result: 1


RE: Euler Identity in Home - jebem - 04-05-2014 04:59 PM

(04-04-2014 09:26 PM)Joe Horn Wrote:  HEY... the HP-65 returns 0 for SIN(3.141592654). What's up with that?

Sorry people for polluting this thread with so many posts in a row.
That's my last one on this theme.

I just tried with a CASIO FX-5000F, and again, the same result as before:
"mode" "Sci" "3";
"sin" "shift" "PI";
Result: 0.00 00

"cos" "shift" "PI";
Result: -1.00 00

"sin" "(" "shift" "PI" "/" "2" ")" ;
Result: 1.00 00


RE: Euler Identity in Home - DrD - 04-05-2014 06:11 PM

One can look to http://www.wolframalpha.com/ for another take on this:

sin(pi)=1.2246467991473532x10-16
(double).sin(pi)=0


RE: Euler Identity in Home - jebem - 04-05-2014 07:32 PM

(04-05-2014 06:11 PM)DrD Wrote:  One can look to http://www.wolframalpha.com/ for another take on this:
sin(pi)=1.2246467991473532x10-16
(double).sin(pi)=0

And again, on HP Prime in Home mode:
1) So, it is expected to not get an answer of Zero for SIN(Pi), as previously explained by others (I got a result = -2.06761537357E-13);

2) However, it will give "exact" rounded values for different situations (using Scientific 4 digit format):
2.1) SIN(Pi/2) --> Result = 1.0000
2.2) COS(Pi) ---> Result = -1.0000
To be honest, I was not expecting the results to be so rounded here, for the same reasons used to explain the SIN(Pi).

I just checked my HP-50G, and the results are exactly the same ones I get on my HP-Prime, so I'm happy to find out that the behavior is consistent between the two calculators. There is no reason to not trust the Prime here, unless we don't trust the 50G either.


RE: Euler Identity in Home - ColinJDenman - 04-05-2014 08:44 PM

These older calculator results are essentially what I was expecting to see. If a 30/40 year old non CAS non Exact calculator can display the goods, why do you not expect the same from a 400Mhz ARM with 32MB of RAM?

I was tempted to ask for a poll of old HPs on the general forum, asking for the calculation of sin(pi) in radians with max Sci format display. On real hardware, since I don't know how the various emulators work.

Plain and simple truth (to me): I expect better, not worse after 30 years. And no amout of telling me to use CAS or the limits of BCD (which isn't limited in the way that IEEE floats are) is likely to change my mind.

I'm just a grumpy old man, reminiscing about non existent golden ages, ignore me.


RE: Euler Identity in Home - jebem - 04-05-2014 09:18 PM

(04-05-2014 08:44 PM)ColinJDenman Wrote:  These older calculator results are essentially what I was expecting to see. If a 30/40 year old non CAS non Exact calculator can display the goods, why do you not expect the same from a 400Mhz ARM with 32MB of RAM?

I was tempted to ask for a poll of old HPs on the general forum, asking for the calculation of sin(pi) in radians with max Sci format display. On real hardware, since I don't know how the various emulators work.

Plain and simple truth (to me): I expect better, not worse after 30 years. And no amout of telling me to use CAS or the limits of BCD (which isn't limited in the way that IEEE floats are) is likely to change my mind.

Yap, I have made myself the same question over and over, when looking to the results from a HP-50G and now from a HP-Prime.
Apparently, what the classic 70's calculators are doing is to round internally to Zero when the difference is below a specific value. If this is true, then they were "faking" the calculation a bit. Probably this kind of algorithms are still used in other low cost calculators, who knows.

By the way, I have the real calculators with me, so the above posted results are from physical calculators from my modest collection.
I am into electronics and physics as a hobby now, so mathematics are needed here and there, and I have using calculators since the 70's in school (Casio and HP).


RE: Euler Identity in Home - ColinJDenman - 04-05-2014 09:54 PM

(04-05-2014 09:18 PM)jebem Wrote:  Yap, I have made myself the same question over and over, when looking to the results from a HP-50G and now from a HP-Prime.
Apparently, what the classic 70's calculators are doing is to round internally to Zero when the difference is below a specific value. If this is true, then they were "faking" the calculation a bit. Probably this kind of algorithms are still used in other low cost calculators, who knows.

By the way, I have the real calculators with me, so the above posted results are from physical calculators from my modest collection.
I am into electronics and physics as a hobby now, so mathematics are needed here and there, and I have using calculators since the 70's in school (Casio and HP).

I expect calculators and any digital computer to be approximate, to have cumulative errors on complex calculations. I don't expect those results to be visible on such a simple calculation. I think there is a reasonable expectation that calculation precision is better that display precision. As I mentioned in a previous post, I regard this a hallmark of older HP calcuators. I owned the notorious NatSemi I mentioned, at University in the 70s. I worked with assember on PDP-11s in my first job as a programmer.

I feel as though we are going backwards. It leaks out occasionally :-) But let us never forget that the correct answer to sin(pi) is zero. Some bits of the Prime know this. Bits that don't, shouldn't be there.

http://xkcd.com/1349/