1 /* specfunc/gsl_sf_exp.h
3 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2004 Gerard Jungman
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 /* Author: G. Jungman */
22 #ifndef __GSL_SF_EXP_H__
23 #define __GSL_SF_EXP_H__
25 #include <gsl/gsl_sf_result.h>
26 #include <gsl/gsl_precision.h>
31 # define __BEGIN_DECLS extern "C" {
32 # define __END_DECLS }
34 # define __BEGIN_DECLS /* empty */
35 # define __END_DECLS /* empty */
40 /* Provide an exp() function with GSL semantics,
41 * i.e. with proper error checking, etc.
43 * exceptions: GSL_EOVRFLW, GSL_EUNDRFLW
45 int gsl_sf_exp_e(const double x, gsl_sf_result * result);
46 double gsl_sf_exp(const double x);
51 * exceptions: GSL_EOVRFLW, GSL_EUNDRFLW
53 int gsl_sf_exp_e10_e(const double x, gsl_sf_result_e10 * result);
56 /* Exponentiate and multiply by a given factor: y * Exp(x)
58 * exceptions: GSL_EOVRFLW, GSL_EUNDRFLW
60 int gsl_sf_exp_mult_e(const double x, const double y, gsl_sf_result * result);
61 double gsl_sf_exp_mult(const double x, const double y);
64 /* Exponentiate and multiply by a given factor: y * Exp(x)
66 * exceptions: GSL_EOVRFLW, GSL_EUNDRFLW
68 int gsl_sf_exp_mult_e10_e(const double x, const double y, gsl_sf_result_e10 * result);
73 * exceptions: GSL_EOVRFLW
75 int gsl_sf_expm1_e(const double x, gsl_sf_result * result);
76 double gsl_sf_expm1(const double x);
79 /* (exp(x)-1)/x = 1 + x/2 + x^2/(2*3) + x^3/(2*3*4) + ...
81 * exceptions: GSL_EOVRFLW
83 int gsl_sf_exprel_e(const double x, gsl_sf_result * result);
84 double gsl_sf_exprel(const double x);
87 /* 2(exp(x)-1-x)/x^2 = 1 + x/3 + x^2/(3*4) + x^3/(3*4*5) + ...
89 * exceptions: GSL_EOVRFLW
91 int gsl_sf_exprel_2_e(double x, gsl_sf_result * result);
92 double gsl_sf_exprel_2(const double x);
95 /* Similarly for the N-th generalization of
96 * the above. The so-called N-relative exponential
98 * exprel_N(x) = N!/x^N (exp(x) - Sum[x^k/k!, {k,0,N-1}])
99 * = 1 + x/(N+1) + x^2/((N+1)(N+2)) + ...
102 int gsl_sf_exprel_n_e(const int n, const double x, gsl_sf_result * result);
103 double gsl_sf_exprel_n(const int n, const double x);
106 /* Exponentiate a quantity with an associated error.
108 int gsl_sf_exp_err_e(const double x, const double dx, gsl_sf_result * result);
110 /* Exponentiate a quantity with an associated error.
112 int gsl_sf_exp_err_e10_e(const double x, const double dx, gsl_sf_result_e10 * result);
115 /* Exponentiate and multiply by a given factor: y * Exp(x),
116 * for quantities with associated errors.
118 * exceptions: GSL_EOVRFLW, GSL_EUNDRFLW
120 int gsl_sf_exp_mult_err_e(const double x, const double dx, const double y, const double dy, gsl_sf_result * result);
123 /* Exponentiate and multiply by a given factor: y * Exp(x),
124 * for quantities with associated errors.
126 * exceptions: GSL_EOVRFLW, GSL_EUNDRFLW
128 int gsl_sf_exp_mult_err_e10_e(const double x, const double dx, const double y, const double dy, gsl_sf_result_e10 * result);
132 #endif /* __GSL_SF_EXP_H__ */