(f(x+h) - f(x)) / has h approaches 0, for the function f evaluated at x. In javascript, we can write this as
function derive(f, h) { function fprime(x) { return (f(x + h) - f(x)) / h; } return fprime; }where `fprime(x)` is the derivative of `f`. This demonstrates three aspects of FP:
function | |
h | |
x min | |
x max | |
number of data points | |
refresh data |