evalf - Maple Programming Help

evalf

evaluate using floating-point arithmetic

 Calling Sequence evalf(expression)

Parameters

 expression - expression to be evaluated

Basic Information

Description

 • The evalf command numerically evaluates expressions (or subexpressions) involving constants (for example, $\mathrm{\pi }$, $ⅇ$, and $\mathrm{\gamma }$ ) and mathematical functions (for example, exp, ln, sin, arctan, cosh, GAMMA, and erf).
 For a complete list of constants, see Initially Known Names. For a complete list of mathematical functions, see Initially Known Mathematical Functions.

Output

 • The evalf command returns a floating-point or complex floating-point number or expression.

Examples

 > $\mathrm{π}$
 ${\mathrm{π}}$ (1)
 > $\mathrm{evalf}\left(\mathrm{π}\right)$
 ${3.141592654}$ (2)
 > $\mathrm{evalf}\left(\mathrm{cos}\left(1\right)+\mathrm{sin}\left(1\right)I\right)$
 ${0.5403023059}{+}{0.8414709848}{}{I}$ (3)
 > $\mathrm{evalf}\left(\frac{3{x}^{2}}{4}+\frac{1x}{3}-\sqrt{2}\right)$
 ${0.7500000000}{}{{x}}^{{2}}{+}{0.3333333333}{}{x}{-}{1.414213562}$ (4)

The evalf command can be used to evaluate more complex mathematical functions.

 > $f≔{∫}_{0}^{1}{ⅇ}^{{x}^{3}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 ${f}{≔}{{∫}}_{{0}}^{{1}}{{ⅇ}}^{{{x}}^{{3}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (5)
 > $\mathrm{evalf}\left(f\right)$
 ${1.341904418}$ (6)
 > $g≔{\sum }_{x=1}^{1000}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}\frac{1}{\sqrt{x}}$
 ${g}{≔}{\sum }_{{x}{=}{1}}^{{1000}}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}\frac{{1}}{\sqrt{{x}}}$ (7)
 > $\mathrm{evalf}\left(g\right)$
 ${61.80100877}$ (8)

The number of significant digits can be restricted with the evalf command.

 > $\mathrm{evalf}[3]\left(\mathrm{π}\right)$
 ${3.14}$ (9)
 > $\mathrm{evalf}[15]\left(\mathrm{π}\right)$
 ${3.14159265358979}$ (10)

Details

 For detailed information including:
 • Complete description of all parameters
 • Controlling numeric precision of computations
 • Special evaluation for user-defined constants and functions
 see the evalf/details help page.