WP34S : is this result "zero" enough ?


I am still playing with the 15c examples and this time it is from the advanced functions handbook, page 78, calculating the nth roots of a complex number. I tried my best to translate the program, so here is my WP34s version:

001 LBL A
002 [cmplx]x[<->]y
003 [cmplx]1/x
004 [cmplx]RCL L
005 [cmplx]R[v]
006 [cmplx]y[^x]
007 [cmplx]STO 02
008 0
009 ENTER[^]
010 3
011 6
012 0
013 [cmplx]R[^]
014 [cmplx]/
015 [cmplx]STO 04
016 0
017 STO K
018 LBL 00
019 [cmplx]RCL 04
020 RCL[times] K
021 1
022 DEG
023 [->]REC
024 [cmplx]RCL[times] 02
025 1
026 STO+ K
027 R[v]
028 STOP
029 GTO 00

to run it, I first set the ssize8, then 0 FILL and then follow the example in the book, using 1^1/100 as the value. Here are the results:

k = 0,  z0  = 1 (check!)
k = 1, z1 = 0.9980+0.0628i (check!)
k = 50, z50 = -1+(1.2815^-38)i (check? 15C result is -1)

So, is this because the different precision between both machines and this is the good result? ... or am I that bad as a programer :-)



Edited: 1 Sept 2011, 8:41 p.m.


Miguel, you could try the various rounding modes (RM) which affect how the internal high precision numbers are rounded. The e-38 looks very much like a rounding artifact because the internal precision is in this range.

Looking more closely at your code I see you do calculate the inverse of the exponent and later multiply it by k. This may lead to different results then computing k/n.

Edited: 2 Sept 2011, 2:27 a.m.


Without having investigated specifically, the 10-38 result you are seeing is around the internal precision used for calculations.

My guess would be a slight rounding issue is present here. Probably in the polar to rectangular conversion.

Still, I'm not really concerned here, the result is close enough to zero for my liking.

- Pauli


I think the rounding issue may come from the y^x. I tried this simple example with (1+i)^2:

   1, ENTER, 1, 0, ENTER, 2, CPX, Y^X = (-7,5998)^-39 + 2i
1, ENTER, 1, CPX, X^2 = 2i

In both cases the 15c and 42s give 2i as the result, either with y^x or x^2.

I tried the RM command (thanks for calling me geek :-))and it did not make any difference.

As you say, it is close enough to zero.




you could try the various rounding modes (RM) which affect how the internal high precision numbers are rounded.

The RM modes only change how an internal high precision number is rounded to a sixteen digit register, not how rounding takes place during internal high precision calculations.

- Pauli

Possibly Related Threads…
Thread Author Replies Views Last Post
  HP 50g - displaying result in engineering format Sean Freeman 10 3,277 11-24-2013, 05:44 AM
Last Post: C.Ret
  program result display Richard Berler 2 1,268 10-02-2013, 06:57 PM
Last Post: Richard Berler
  [WP34S] WP34S firmware on the AT91SAM7L-STK dev kit? jerome ibanes 1 1,215 10-04-2012, 04:59 PM
Last Post: Paul Dale
  [wp34s] Incomplete Gamma on the wp34s Les Wright 18 5,117 12-06-2011, 11:07 AM
Last Post: Namir
  [wp34s] Romberg Integration on the wp34s Les Wright 2 1,481 12-04-2011, 10:49 PM
Last Post: Les Wright
  HP 12cP25thAE Self-Test Result? Kerem Kapkin (Silicon Valley, CA) 5 1,799 10-04-2011, 05:37 PM
Last Post: Katie Wasserman
  Rationale for 15C L.R. result order? Mike Fikes 9 2,409 09-20-2011, 05:59 PM
Last Post: Crawl
  HHC2007 Poll Result: Bring Back the HP42S Namir 70 12,181 10-11-2007, 03:15 PM
Last Post: Bruce Bergman
  MAJOR RESULT DISCREPANCY; 50g vs. 41CX Edward J Pec 5 1,557 03-06-2007, 10:09 AM
Last Post: Palmer O. Hanson, Jr.
  TTCALC: Can Result be Saved? G Weisbrot 4 1,253 02-25-2000, 08:42 PM
Last Post: G Weisbrot

Forum Jump: