View source: R/MiniMaxApprox.R
minimaxEval | R Documentation |
Evaluates the rational or polynomial approximation stored in mmA
at
x
.
minimaxEval(x, mmA, basis = "Chebyshev")
x |
a numeric vector |
mmA |
a |
basis |
character; Which polynomial basis to use in to evaluate the
function; see |
This is a convenience function to evaluate the approximation at x
.
A vector of the same length as x
containing the approximated values.
Avraham Adler Avraham.Adler@gmail.com
minimaxApprox
, minimaxErr
# Show results
x <- seq(0, 0.5, length.out = 11L)
mmA <- minimaxApprox(exp, 0, 0.5, 5L)
apErr <- abs(exp(x) - minimaxEval(x, mmA))
all.equal(max(apErr), mmA$ExpErr)
# Plot results
curve(exp, 0.0, 0.5, lwd = 2)
curve(minimaxEval(x, mmA), 0.0, 0.5, add = TRUE, col = "red", lty = 2L, lwd = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.