| vc_tangent | R Documentation |
Use vc_derivative() to construct the local line y0 + slope * (x - x0). The numerical line is not proof that a mathematical tangent exists.
vc_tangent(
f,
x0,
method = c("central", "forward", "backward"),
h = NULL,
atol = 1e-08,
rtol = 1e-04,
warn = TRUE
)
f |
Deterministic function accepting a real scalar and returning one finite real scalar. Vectorization is not required. |
x0 |
Finite real scalar evaluation point of the local model. |
method |
One of "central", "forward", or "backward". |
h |
Positive finite real initial derivative step, or NULL for the heuristic used by vc_derivative(), evaluated with x = x0. |
atol |
Nonnegative finite absolute tolerance for sensitivity comparisons. |
rtol |
Nonnegative finite relative tolerance for sensitivity comparisons. |
warn |
Logical scalar; warn when sensitivity diagnostics fail. |
A two-sided tangent requires differentiability at x0. One-sided methods instead construct a one-sided approximation, which may differ from a two-sided tangent. All limitations of vc_derivative apply.
Plain list with type ("tangent"), x0, y0, slope, derivative (the full vc_derivative result), and note. Inspect derivative$reliable and its diagnostics before interpreting the slope. Failed diagnostics retain the approximation, with a warning unless warn = FALSE.
vc_tangent(function(x) x^2, 1)
sin |> vc_tangent(x0 = 0)
vc_tangent(abs, 0, warn = FALSE)$derivative$reliable
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.