
Central-difference numerical derivative (morie.fn grnud)
Source:R/geron_train_native.R
morie_geron_numerical_differentiation.Rd(f(x+h) - f(x-h)) / 2h with a Richardson extrapolation cross-check from the 2h estimate.
Examples
morie_geron_numerical_differentiation(function(t) sin(t)^2, 0.7)
#> $derivative
#> [1] 0.9854497
#>
#> $derivative_2h
#> [1] 0.9854497
#>
#> $richardson
#> [1] 0.9854497
#>
#> $step_error
#> [1] 1.915135e-10
#>
#> $estimate
#> [1] 0.9854497
#>
#> $n
#> [1] 1
#>