A solution, found this evening, follows the problem statement.  /Kip

Kip Murray wrote:
> Newton polynomial p below is based on table au whose first row contains 
> coefficients, second row, special values of the argument.
> 
>     ]au =: a ,: u
> 0 1 4 1
> 0 1 3 6
> 
>     p =: 3 : '+/ 0 1 4 1 * 1,(y-0),((y-0)*(y-1)),((y-0)*(y-1)*(y-3))'
> 
> ----------------------------------------------------------------------
> Can you write an adverb Np (Newton polynomial) such that verb au Np is 
> equivalent to the Newton polynomial specified in table au?
> ----------------------------------------------------------------------

    Np =: 1 : '(({.m) +/ . * [: */\ 1 , (}:{:m) -~ ])"0'

    (p ,: au Np) i. 5
0 1 8 27 64
0 1 8 27 64

    au
0 1 4 1
0 1 3 6
    p
3 : '+/ 0 1 4 1 * 1,(y-0),((y-0)*(y-1)),((y-0)*(y-1)*(y-3))'"0
    au Np
(0 1 4 1 +/ .* [: */\ 1 , 0 1 3 -~ ])"0

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to