more question regarding complex operations using complex number on wp34s - 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: more question regarding complex operations using complex number on wp34s ( /thread-230584.html) |

more question regarding complex operations using complex number on wp34s - wildpig - 09-02-2012
Question 1 (2+2i)^4 on the wp34s gives (-64-3.7x10-37i), not (-64+0i).. Interesting..... wassup with that?
If i enter "2 (enter) 2 (enter) 4 (cpx) y^x " what is the operation i am doing (as can someone write it out what this is as it would looks like "on paper" ? thanks
Re: more question regarding complex operations using complex number on wp34s - Paul Dale - 09-02-2012
2 ENTER 2 ENTER 0 ENTER 4 CPX y^x is what you want here.
Re: more question regarding complex operations using complex number on wp34s - Walter B - 09-02-2012
When/if you perform a complex two-number function, both numbers must be complex. Thus it's called a
Alternative: 2 ENTER 2 CPX x^2 CPX x^2 executes two complex one-number functions, where (surprise!) only one number has to be complex.
Re: more question regarding complex operations using complex number on wp34s - wildpig - 09-02-2012
Ya, after playing around with wp34s even before you answer, that was what i was expecting... But 2+2i)^(4+0i) on the wp34s still gives (-64-3.7x10-37i), not (-64+0i)..
Some strange algorthm bug?
Re: more question regarding complex operations using complex number on wp34s - Walter B - 09-02-2012
No, some plain thinking bug ;-) 2 ENTER 2 ENTER 0 ENTER 4 CPX y^x returns -64 + O(10^-37) *i
Edit:The term O(10^-37) is due to the way such operations are actually computed. If you know you just need an integer exponentiation, you're better off with the alternative I mentioned above.
Re: more question regarding complex operations using complex number on wp34s - wildpig - 09-02-2012
Quote:
Re: more question regarding complex operations using complex number on wp34s - Gilles Carpentier - 09-02-2012
I dont know but : HP39gII -> -64+2.....E-13*i HP50G -> (-64.,0.) (Approx mode and -64 in exact mode)
Re: more question regarding complex operations using complex number on wp34s - Walter B - 09-02-2012
Oiiik wildpig, It's not as weird as you think - please see my remarks above. BTW:
Quote:... even today the algorithm of the WP 34S will take (2+2i)^(4+0i) and return -64 - 4 * 10^(-37) * i. Some exactitude in spelling words and equations helps a lot, not only in math. In old Europe, people used to say "Before learning a foreign language, learn your own." I'm not so sure, however, about the applicability of this saying to the USA and their forests especially ;-) Re: more question regarding complex operations using complex number on wp34s - Dieter - 09-02-2012
Question 1: In a way this is similar to calculating sin(pi). Since pi cannot be exact, the result is off by O(10^-16) resp. O(10^-34). So if the true result is zero, this is what you see. All this happens to any calculator with finite precision. At least if it does not apply "cosmetic rounding".
In your case actually something very similar happens. The complex power z1^z2 is evaluated as e^(z2 * ln(z1)). In this case this leads to e^(4 * ((ln 8)/2 + pi/4 i)where the term 4*pi/4 (or even pi itself) cannot be given with infinite precision so that its sine will never become exactly zero.
Question 2:
The correct entry is 2 ENTER 2i.e. (2i+2)^(0i+4)
For low integer (non-complex) exponents using x^2 or x^3 is the better way. This also avoids roundoff errors like the one you posted: 2 ENTER 2This returns exactly -64. Dieter
Re: more question regarding complex operations using complex number on wp34s - wildpig - 09-02-2012
Interesting to know... Because on 42S, you do get -64+0i. And 42s is not a symbolic calc.
Re: more question regarding complex operations using complex number on wp34s - Dieter - 09-02-2012
My 35s returns this as well (-64 i0). This may be the result of some intentional internal rounding, or - more probably - HPs algorithm for these calculators uses a different approach for (real) integer exponents. Dieter
Re: more question regarding complex operations using complex number on wp34s - Damir - 09-02-2012
Try HP39gII emulator in DEG mode.
Damir
Re: more question regarding complex operations using complex number on wp34s - Mark Scheuern - 09-02-2012
The 15C also produces -64 + 0i.
Re: more question regarding complex operations using complex number on wp34s - Dieter - 09-02-2012
I tried a few examples of complex powers on the 34s, and indeed there are cases where the error becomes substantial. Which can be expected since as the exponent grows, so does the error if the real resp. imaginary part should be exactly zero. For instance try (2 + 2i)^80. The 34s returns 1,329 E36 + 0,341i. The imaginary part should be zero. Then try (2 + 2i)^82. This returns -2,375 + 1,063 E37. Here the real part should be zero. All this seems to be caused by the limited precision of pi and thus the trig functions near pi, so that the error seems to grow proportionally with the (real) exponent. A first idea for a quick and easy workaround might be this: simply round the real resp. imaginary part to zero if their ratio is beyond something like 1 : 10^36.
Here is a quick and dirty routine for the 34s: 001 LBL'CPW'Maybe someone else (Pauli?) has a better idea? At least for larger exponents the error does not seem to be negligible, so something should be done here. Dieter
Re: more question regarding complex operations using complex number on wp34s - Walter B - 09-02-2012
IMHO a test for integer exponents would be a better solution. If true and the exponent is even, then it can be substituted by a limited number of subsequent complex x^2's. If it is odd instead, one x^3 must join the team. Quick and mathematically correct :-)
Re: more question regarding complex operations using complex number on wp34s - wildpig - 09-02-2012
35s also return 0i
I guess complex number operation testing really put a calc numerical algorthm to work ;)
Re: more question regarding complex operations using complex number on wp34s - Gilles Carpentier - 09-02-2012
In DEG, - with 39gII i get -64
- 50G DEG (-64.,0.)
Re: more question regarding complex operations using complex number on wp34s - wildpig - 09-02-2012
on the same thought, e^(i*pi), so far on all the hp calc I got none given me the correct answer with -1 i0 yet. all of them given coefficent of i to E-15 or something like that. Is there a way to get the almighty 50G to give the correct symbolic answer? TI nspire does symbolically give the correct answer to this
Re: more question regarding complex operations using complex number on wp34s - Dieter - 09-02-2012
No. If the calculator returned exactly -1 (i.e. with zero imaginary part) the result was plain wrong. Simply because you cannot enter e^(i*pi). The best you can do on a 12-digit machine is e^(i*3,14159265359). And that constant is The correct 12-digit result is -1 - 2,06761537357E-13*i. The imaginary part is sin(3,14159265359). As opposed to sin(pi) which is exactly zero. So the only way to get exactly -1 is a symbolic evaluation that "knows" that pi is not 3,14159265...something but simply ...pi with a sine of 0. Dieter
Re: more question regarding complex operations using complex number on wp34s - wildpig - 09-02-2012
Quote:
Re: more question regarding complex operations using complex number on wp34s - Dieter - 09-02-2012
As far as I can see the problem is not caused by integer exponents. It's a general issue for every complex number z raised to the k-th power where Im(z) : Re(z) = tan(pi/k)Usually the problem is obscured by the fact that the tangent is an irrational number that cannot be respresented exactly as the quotient of two integers (or at least two n-digit numbers) anyway.
The only exception I see is k = 4, so that Im(z) = Re(z). Here the imaginary part numerically becomes non-zero not because of the slightly inexact representation of z (the tangent Dieter
Re: more question regarding complex operations using complex number on wp34s - John Mosand - 09-02-2012
What it boils down to, is that no irrational number can be entered exactly. Symbolically, yes - numerically, no.
Re: more question regarding complex operations using complex number on wp34s - Walter B - 09-02-2012
Quote:Holds even for many rational numbers, e.g. 2/3. |