minimaxErr function

Evaluate the Minimax Approximation Error

Evaluate the Minimax Approximation Error

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

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.

Returns

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")
  • Maintainer: Avraham Adler
  • License: MPL-2.0
  • Last published: 2024-06-20