Previous Page Next Page Contents

exp -- the exponential function

Introduction

exp(x) represents the value of the exponential function at the point x.

Call(s)

exp(x)

Parameters

x - an arithmetical expression

Returns

an arithmetical expression

Overloadable:

x

Side Effects

When called with a floating point argument, the function is sensitive to the environment variable DIGITS which determines the numerical working precision.

Related Functions

ln, log

Details

Example 1

We demonstrate some calls with exact and symbolic input data:

>> E, exp(2), exp(-3), exp(1/4), exp(1 + I), exp(x^2)
                                                              2
          exp(1), exp(2), exp(-3), exp(1/4), exp(1 + I), exp(x )

Floating point values are computed for floating point arguments:

>> exp(1.23), exp(4.5 + 6.7*I), exp(1.0/10^20), exp(123456.7)
      3.421229536, 82.31014791 + 36.44342846 I, 1.0,
      
         3.660698702e53616

Some special symbolic simplifications are implemented:

>> exp(I*PI), exp(x - 22*PI*I), exp(3 + I*PI)
                            -1, exp(x), -exp(3)
>> exp(ln(-2)), exp(ln(x)*PI), exp(lambertW(5))
                                PI       5
                           -2, x  , -----------
                                    lambertW(5)

Example 2

The truncated result 0.0 may be returned for floating point arguments with negative real parts. This prevents numerical underflow:

>> exp(-5.81*10^6), exp(-5.82*10^6)
                         1.148529374e-2523251, 0.0
>> exp(-5.81*10^6 + 10^10*I), exp(-5.82*10^6 + 10^10*I)
            1.002803534e-2523251 - 5.599149896e-2523252 I, 0.0

No such protection is implemented for numerical overflow:

>> exp(5.81*10^6)
                            8.706786458e2523250
>> exp(5.82*10^6)
      Error: Overflow/underflow in arithmetical operation;
      during evaluation of 'exp::float'

Example 3

System functions such as limit, series, expand, combine etc. handle expressions involving exp:

>> limit(x*exp(-x), x = infinity), series(exp(x/(x + 1)), x = 0)
                              2    3    4       5
                             x    x    x    19 x       6
                  0, 1 + x - -- + -- + -- - ----- + O(x )
                             2    6    24    120
>> expand(exp(x + y + (sqrt(2) + 5)*PI*I))
                                                1/2
                      - exp(x) exp(y) exp(I PI 2   )
>> combine(%, exp)
                                             1/2
                         - exp(x + y + I PI 2   )

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000