minimaxEval {minimaxApprox} | R Documentation |
Evaluate Minimax Approximation
Description
Evaluates the rational or polynomial approximation stored in mmA
at
x
.
Usage
minimaxEval(x, mmA, basis = "Chebyshev")
Arguments
x |
a numeric vector |
mmA |
a |
basis |
character; Which polynomial basis to use in to evaluate the
function; see |
Details
This is a convenience function to evaluate the approximation at x
.
Value
A vector of the same length as x
containing the approximated values.
Author(s)
Avraham Adler Avraham.Adler@gmail.com
See Also
Examples
# 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)
[Package minimaxApprox version 0.4.3 Index]