Subject: Best way to use a compiled function in findroot
From: Robert Dodier
Date: Fri, 27 Aug 2010 12:21:08 -0600
On Fri, Aug 27, 2010 at 12:11 PM, Sergio Callegari
<sergio.callegari at gmail.com> wrote:
> f(x):=(mode_declare(x,float),sin(x));
> compile(x);
I guess you mean compile(f) here.
> find_root('f(x),x,-1,1);
For the record, find_root(f, x, -1, 1) (i.e. just name the function)
also works here. Also find_root(lambda([x], f(x)), x, -1, 1) works.
> g(y):=block([x:gensym()],findroot('f(x)-y,x,-1,1));
I guess you mean find_root instead of findroot here.
best,
Robert Dodier