Polynomial derivative: Difference between revisions
m
→RPL: fancy output
Line 615:
</pre>
===Classical programming===
Assuming we ignore the existence of the <code>∂</code> operator, here is a typical RPL program that handles polynoms as
≪ →
≪
scalars j GET j 1 - * + ▼
NEXT
ELSE { 0
END
≫ ≫
'DPDX' STO
{{out}}
<pre>
5:
4:
3:
2:
1:
</pre>
=== Fancy output ===
≪ → coeffs
≪ coeffs 1 GET
coeffs SIZE 2 FOR j
-1 STEP
≫ COLCT
≫
‘→EQ’ STO
{1 1 0 -1 -1} DPDX
DUP →EQ
{{out}}
<pre>
2: { 1 0 -3 -4 }
1: '1-3*x^2-4*x^3'
</pre>
|