May 27, 2008

Polynomials in APL

coeffs „ 3 ¯2 9 4
coeffs
3 ¯2 9 4

powers „ ¯1 + ¼4
powers
0 1 2 3

x „ 10

+/coeffs × x * powers
4883
3 + (-2×x) + (9×x*2) + 4×x*3
4883