|
Packit |
67cb25 |
.. index::
|
|
Packit |
67cb25 |
single: exponential function
|
|
Packit |
67cb25 |
single: exp
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
The functions described in this section are declared in the header file
|
|
Packit |
67cb25 |
:file:`gsl_sf_exp.h`.
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
Exponential Function
|
|
Packit |
67cb25 |
--------------------
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. function:: double gsl_sf_exp (double x)
|
|
Packit |
67cb25 |
int gsl_sf_exp_e (double x, gsl_sf_result * result)
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
These routines provide an exponential function :math:`\exp(x)` using GSL
|
|
Packit |
67cb25 |
semantics and error checking.
|
|
Packit |
67cb25 |
.. Exceptional Return Values: GSL_EOVRFLW, GSL_EUNDRFLW
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. function:: int gsl_sf_exp_e10_e (double x, gsl_sf_result_e10 * result)
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
This function computes the exponential :math:`\exp(x)` using the
|
|
Packit |
67cb25 |
:type:`gsl_sf_result_e10` type to return a result with extended range.
|
|
Packit |
67cb25 |
This function may be useful if the value of :math:`\exp(x)` would
|
|
Packit |
67cb25 |
overflow the numeric range of :code:`double`.
|
|
Packit |
67cb25 |
.. Exceptional Return Values: GSL_EOVRFLW, GSL_EUNDRFLW
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. function:: double gsl_sf_exp_mult (double x, double y)
|
|
Packit |
67cb25 |
int gsl_sf_exp_mult_e (double x, double y, gsl_sf_result * result)
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
These routines exponentiate :data:`x` and multiply by the factor :data:`y`
|
|
Packit |
67cb25 |
to return the product :math:`y \exp(x)`.
|
|
Packit |
67cb25 |
.. Exceptional Return Values: GSL_EOVRFLW, GSL_EUNDRFLW
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. function:: int gsl_sf_exp_mult_e10_e (const double x, const double y, gsl_sf_result_e10 * result)
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
This function computes the product :math:`y \exp(x)` using the
|
|
Packit |
67cb25 |
:type:`gsl_sf_result_e10` type to return a result with extended numeric
|
|
Packit |
67cb25 |
range.
|
|
Packit |
67cb25 |
.. Exceptional Return Values: GSL_EOVRFLW, GSL_EUNDRFLW
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
Relative Exponential Functions
|
|
Packit |
67cb25 |
------------------------------
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. function:: double gsl_sf_expm1 (double x)
|
|
Packit |
67cb25 |
int gsl_sf_expm1_e (double x, gsl_sf_result * result)
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
These routines compute the quantity :math:`\exp(x)-1` using an algorithm
|
|
Packit |
67cb25 |
that is accurate for small :math:`x`.
|
|
Packit |
67cb25 |
.. Exceptional Return Values: GSL_EOVRFLW
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. function:: double gsl_sf_exprel (double x)
|
|
Packit |
67cb25 |
int gsl_sf_exprel_e (double x, gsl_sf_result * result)
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
These routines compute the quantity :math:`(\exp(x)-1)/x` using an
|
|
Packit |
67cb25 |
algorithm that is accurate for small :data:`x`. For small :data:`x` the
|
|
Packit |
67cb25 |
algorithm is based on the expansion
|
|
Packit |
67cb25 |
:math:`(\exp(x)-1)/x = 1 + x/2 + x^2/(2*3) + x^3/(2*3*4) + \dots`.
|
|
Packit |
67cb25 |
.. Exceptional Return Values: GSL_EOVRFLW
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. function:: double gsl_sf_exprel_2 (double x)
|
|
Packit |
67cb25 |
int gsl_sf_exprel_2_e (double x, gsl_sf_result * result)
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
These routines compute the quantity :math:`2(\exp(x)-1-x)/x^2` using an
|
|
Packit |
67cb25 |
algorithm that is accurate for small :data:`x`. For small :data:`x` the
|
|
Packit |
67cb25 |
algorithm is based on the expansion
|
|
Packit |
67cb25 |
:math:`2(\exp(x)-1-x)/x^2 = 1 + x/3 + x^2/(3*4) + x^3/(3*4*5) + \dots`.
|
|
Packit |
67cb25 |
.. Exceptional Return Values: GSL_EOVRFLW
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. function:: double gsl_sf_exprel_n (int n, double x)
|
|
Packit |
67cb25 |
int gsl_sf_exprel_n_e (int n, double x, gsl_sf_result * result)
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
These routines compute the :math:`N`-relative exponential, which is the
|
|
Packit |
67cb25 |
:data:`n`-th generalization of the functions :func:`gsl_sf_exprel` and
|
|
Packit |
67cb25 |
:func:`gsl_sf_exprel_2`. The :math:`N`-relative exponential is given by,
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. only:: not texinfo
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. math::
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
\hbox{exprel}_N(x)
|
|
Packit |
67cb25 |
&= N!/x^N \left(\exp(x) - \sum_{k=0}^{N-1} x^k/k!\right)\cr
|
|
Packit |
67cb25 |
&= 1 + x/(N+1) + x^2/((N+1)(N+2)) + \dots\cr
|
|
Packit |
67cb25 |
&= {}_1F_1(1,1+N,x)\cr
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. only:: texinfo
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
::
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
exprel_N(x) = N!/x^N (\exp(x) - \sum_{k=0}^{N-1} x^k/k!)
|
|
Packit |
67cb25 |
= 1 + x/(N+1) + x^2/((N+1)(N+2)) + ...
|
|
Packit |
67cb25 |
= 1F1 (1,1+N,x)
|
|
Packit |
67cb25 |
.. Exceptional Return Values:
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
Exponentiation With Error Estimate
|
|
Packit |
67cb25 |
----------------------------------
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. function:: int gsl_sf_exp_err_e (double x, double dx, gsl_sf_result * result)
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
This function exponentiates :data:`x` with an associated absolute error
|
|
Packit |
67cb25 |
:data:`dx`.
|
|
Packit |
67cb25 |
.. Exceptional Return Values:
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. function:: int gsl_sf_exp_err_e10_e (double x, double dx, gsl_sf_result_e10 * result)
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
This function exponentiates a quantity :data:`x` with an associated absolute
|
|
Packit |
67cb25 |
error :data:`dx` using the :type:`gsl_sf_result_e10` type to return a result with
|
|
Packit |
67cb25 |
extended range.
|
|
Packit |
67cb25 |
.. Exceptional Return Values:
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. function:: int gsl_sf_exp_mult_err_e (double x, double dx, double y, double dy, gsl_sf_result * result)
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
This routine computes the product :math:`y \exp(x)` for the quantities
|
|
Packit |
67cb25 |
:data:`x`, :data:`y` with associated absolute errors :data:`dx`, :data:`dy`.
|
|
Packit |
67cb25 |
.. Exceptional Return Values: GSL_EOVRFLW, GSL_EUNDRFLW
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
.. function:: int gsl_sf_exp_mult_err_e10_e (double x, double dx, double y, double dy, gsl_sf_result_e10 * result)
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
This routine computes the product :math:`y \exp(x)` for the quantities
|
|
Packit |
67cb25 |
:data:`x`, :data:`y` with associated absolute errors :data:`dx`, :data:`dy` using the
|
|
Packit |
67cb25 |
:type:`gsl_sf_result_e10` type to return a result with extended range.
|
|
Packit |
67cb25 |
.. Exceptional Return Values: GSL_EOVRFLW, GSL_EUNDRFLW
|