Published
Edited
Jul 12, 2018
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function findZero(f, x0, epsilon = 0.001, )
{
let x = x0;
let deriv = (x) => (f(x + epsilon) - f(x)) / (epsilon)
while(Math.abs(f(x)) >= epsilon) x -= f(x0) / deriv(x0);
return x;
}
Insert cell
findZero((x) => -(x-3)*(x-2)*(x-3), 1)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more