RelativeError - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Student[NumericalAnalysis]

 RelativeError
 compute the relative error of an approximation

 Calling Sequence RelativeError(xe, xa, opts)

Parameters

 xe - realcons; the exact value xa - realcons; the approximated value opts - optional equation(s) of the form keyword = value, where keyword is: digits; the options for computing the relative error of xa

Options

 • digits = posint
 A positive integer; the environment variable Digits will be set to this integer during the execution of this procedure. By default, Digits is 10.

Description

 • The RelativeError command computes the relative error of xa with respect to the exact value xe.

Examples

 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{NumericalAnalysis}\right]\right):$
 > $\mathrm{appr}≔2.89×{10}^{8}$
 ${\mathrm{appr}}{≔}{2.89}{×}{{10}}^{{8}}$ (1)
 > $\mathrm{exac}≔2.98×{10}^{8}$
 ${\mathrm{exac}}{≔}{2.98}{×}{{10}}^{{8}}$ (2)
 > $\mathrm{RelativeError}\left(\mathrm{exac},\mathrm{appr},\mathrm{digits}=5\right)$
 ${0.030201}$ (3)