minimaxErr {minimaxApprox}R Documentation

Evaluate the Minimax Approximation Error

Description

Evaluates the difference between the function and the minimax approximation at x.

Usage

minimaxErr(x, mmA)

Arguments

x

a numeric vector

mmA

a "minimaxApprox" return object

Details

This is a convenience function to evaluate the approximation error at x. It will use the same polynomial basis as was used in the approximation; see minimaxApprox for more details.

Value

A vector of the same length as x containing the approximation error values.

Author(s)

Avraham Adler Avraham.Adler@gmail.com

See Also

minimaxApprox, minimaxEval

Examples

# Show results
x <- seq(0, 0.5, length.out = 11L)
mmA <- minimaxApprox(exp, 0, 0.5, 5L)
err <- minimaxEval(x, mmA) - exp(x)
all.equal(err,  minimaxErr(x, mmA))

# Plot results
x <- seq(0, 0.5, length.out = 1001L)
plot(x, minimaxErr(x, mmA), type = "l")

[Package minimaxApprox version 0.4.2 Index]