Tangent
Documentation for Tangent.
Tangent.numderiv — Functionnumderiv(f, x₀, ϵ = 1e-7)Returns the approximate numerical derivative of $f(x)$ at $x_0$ using the forward finite-difference method with a step $\epsilon$. Namely:
$f'(x_0) \approx \frac{f(x_0 + \epsilon) - f(x_0)}{\epsilon}$
Examples
julia> f(x) = x^2
f (generic function with 1 method)
julia> numderiv(f, 3, 1e-2)
6.009999999999849
julia> numderiv(f, 3, 1e-4)
6.000100000012054Tangent.plottangent — Functionplottangent(f, x₀, xs, ϵ=1e-7)Plots the approximate tangent of $f(x)$ at $x_0$.
Tangent.tangent — Functiontangent(f, x₀, ϵ = 1e-7)Returns the approximate tangent of $f(x)$ at $x_0$, as a function of x, namely:
$r(x) = f'(x_0) \cdot (x - x_0) + f(x_0)$