Overview - Maple 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{\pi }$
 ${\mathrm{\pi }}$ (1)
 > $\mathrm{evalf}\left(\mathrm{\pi }\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}{4}{x}^{2}+\frac{1}{3}x-\mathrm{sqrt}\left(2\right)\right)$
 ${0.7500000000}{}{{x}}^{{2}}{+}{0.3333333333}{}{x}{-}{1.414213562}$ (4)

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

 > $f≔\mathrm{int}\left(\mathrm{exp}\left({x}^{3}\right),x=0..1\right)$
 ${f}{≔}{{\int }}_{{0}}^{{1}}{{ⅇ}}^{{{x}}^{{3}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (5)
 > $\mathrm{evalf}\left(f\right)$
 ${1.341904418}$ (6)
 > $g≔\mathrm{Sum}\left(\frac{1}{\mathrm{sqrt}\left(x\right)},x=1..1000\right)$
 ${g}{≔}{\sum }_{{x}{=}{1}}^{{1000}}{}\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}\left[3\right]\left(\mathrm{\pi }\right)$
 ${3.14}$ (9)
 > $\mathrm{evalf}\left[15\right]\left(\mathrm{\pi }\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.