Post Reply 
Polynomial with real coefficients —> array w/ real coeff
05-05-2023, 02:03 PM (This post was last modified: 05-05-2023 11:22 PM by Gil.)
Post: #9
RE: Polynomial with real coefficients —> array w/ real coeff
Very nice indeed.

Thanks.

Perhaps we could simplify your tests by a single one as follows:
« 0 { } —> N L
« DUP DEGREE 'N' STO N 1 <
IF
THEN 1 —>LIST
ELSE 0 N 1 -
START 0 HORNER 'L' STO+ DROP
NEXT L +
END AXL
»
»

And to have your program work without being asked if we want to go to real, add the following 3 instructions
-105 SF for real, PUSH to save the initial flags and POP to restore the initial flags:

« PUSH -105 SF 0 { } —> N L
« DUP DEGREE 'N' STO N 1 <
IF
THEN 1 —>LIST
ELSE 0 N 1 -
START 0 HORNER 'L' STO+ DROP
NEXT L +
END AXL POP
»
»
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Polynomial with real coefficients —> array w/ real coeff - Gil - 05-05-2023 02:03 PM



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