Post Reply 
Best Pol/Rect and Complex Number Decomp for 35S
01-27-2019, 09:14 AM (This post was last modified: 01-27-2019 03:05 PM by Dieter.)
Post: #13
RE: Best Pol/Rect and Complex Number Decomp for 35S
(01-27-2019 08:26 AM)Gerald H Wrote:  
4    ABS(I)*COS(ARG(I))+0*(ABS(I)*SIN(ARG(I))►I)

That's a nice approach, with a much less complicated formula than the one I used. Combining it with my original solution the result would look like this:

C001  LBL C
C002  FS? 10
C003  GTO C010
C004: ARG
C006  X<>Y
C007  R↓
C009  RTN
C010: CF 10
C011  XEQ C004
C012  SF 10
C013  RTN

Maybe this version is a bit more prone to roundoff errors so that the last digit may be slightly off here and there:

 1i1  =>  0,99999999998, 0,999999999997
-4i3  => -3,99999999999, 3,00000000001
 0i3  =>  1,4689...E-11, 3

The last example assumes radians mode.

OK, this may happen anytime as all we got are 12 digits instead of 15 the 35s uses internally. But on average the more complicated formulas in post #10 seem to exibit less of such problems. In all three cases it returns accurate results. Maybe because sine and cosine of the angle are avoided (only their sign is considered).

Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Best Pol/Rect and Complex Number Decomp for 35S - Dieter - 01-27-2019 09:14 AM

User(s) browsing this thread: 1 Guest(s)