Scientific Calculator
Alex/search
By Alex
Tagged:
//* 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
0 Comments
Sign in to leave a comment