[VA] SRC#001 - Spiky Integral
|
07-15-2018, 07:10 PM
(This post was last modified: 07-15-2018 07:16 PM by Gerson W. Barbosa.)
Post: #18
|
|||
|
|||
RE: [VA] SRC#001 - Spiky Integral
The RPL program has been rewritten so as not to needlessly waste time expanding a polynomial when results are supposed to be zero. %%HP: T(3)A(R)F(.); \<< DUPDUP DUPDUP * + 2 / 2 MOD IF NOT THEN DUP 'X' 1 ROT OVER SWAP FOR i OVER i ^ DUP INV + * NEXT NIP EXPAND FXND DROP \->STR "*X^" ROT DUPDUP * + 2 / DUP 2 + \->STR "+" + UNROT \->STR + "+" + "X^" ROT + PICK3 SWAP POS PICK3 ROT POS 1 - SUB DUP SIZE OVER "+" POS 1 + SWAP SUB OBJ\-> 2 ROT 1 - ^ / \pi * ELSE DROP2 0 END \>> 71 -> '335205518724079925/73786976294838206464*π' -> NUM -> 1.42718843886E-2 267.5 bytes, but it takes too long for this example (28m 34s... on the emulator!) As a comparison, the RPN program on Free42 returns 1.4271(9054304)E-2 instantly (maybe a couple of seconds on a real 42S). |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)