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
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: Best Pol/Rect and Complex Number Decomp for 35S
(01-27-2019 08:26 AM)Gerald H Wrote:
Code:
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:

Code:
C001  LBL C C002  FS? 10 C003  GTO C010 C004: ARG C005  eqn ABS(LASTX)*SIN(REGX) C006  X<>Y C007  R↓ C008  eqn ABS(LASTX)*COS(REGT) 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).

Dieter
 « Next Oldest | Next Newest »

 Messages In This Thread Best Pol/Rect and Complex Number Decomp for 35S - Matt Agajanian - 01-26-2019, 12:43 AM RE: Best Pol/Rect and Complex Number Decomp for 35S - rprosperi - 01-26-2019, 02:21 AM RE: Best Pol/Rect and Complex Number Decomp for 35S - Matt Agajanian - 01-26-2019, 03:37 AM RE: Best Pol/Rect and Complex Number Decomp for 35S - ijabbott - 01-26-2019, 10:40 AM RE: Best Pol/Rect and Complex Number Decomp for 35S - rprosperi - 01-26-2019, 01:04 PM RE: Best Pol/Rect and Complex Number Decomp for 35S - Dieter - 01-26-2019, 04:23 PM RE: Best Pol/Rect and Complex Number Decomp for 35S - rprosperi - 01-27-2019, 03:47 AM RE: Best Pol/Rect and Complex Number Decomp for 35S - Matt Agajanian - 01-26-2019, 03:29 AM RE: Best Pol/Rect and Complex Number Decomp for 35S - Gene - 01-26-2019, 07:02 PM RE: Best Pol/Rect and Complex Number Decomp for 35S - Matt Agajanian - 01-26-2019, 07:17 PM RE: Best Pol/Rect and Complex Number Decomp for 35S - Dieter - 01-26-2019, 08:49 PM RE: Best Pol/Rect and Complex Number Decomp for 35S - Gerald H - 01-27-2019, 08:26 AM 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)