Scientific Calculator

(public) Alex/search

By Alex Alex

Tagged: search

//* f(x)=y(is known), search x *//
f=function(x){%};
y=%;
delta=0.01;
x=1;
step=10;
while(abs(y-f(x))>delta)->((abs(f(x+step)-y)>abs(f(x)-y))?(step=step/2-step;x+=step)  : x+=step);
x

spam? | offensive?

0 Comments

Sign in to leave a comment