Skip to main content
Ctrl+K

XlCalcNet Documentation

  • Preface

Getting started

  • Setup and general usage
    • Setting up XlCalcNet
    • General and user interface functions
    • More on XlCalcNet with MS Excel
    • Calling Python from C#
    • Mathematical functions based on Mpmath, Gmpy2 and Python-Flint (only Python)
    • Mathematical functions in fixed precision (C#, can be called from Python)
    • Mathematical functions based on XlCalcNet2 (C#, can be called from Python)
    • A quick look at Numpy
    • A quick look at Matplotlib and related libraries
    • A quick look at Pandas and Xlxswriter
    • A quick look at Scipy
    • A quick look at R, RStudio and Rpy2
  • Basic floating point functions
    • Operator overloading, general real functions
    • Machine constants, general
    • Properties of numbers
    • Integer related functions
    • Floating point functions for real numbers
    • Fraction and remainder related functions
    • Functions related to mantissa width and exponent range
    • Mathematical Constants
  • Elementary scalar functions (real and complex)
    • Complex components
    • Roots and quadratic, cubic, and quartic equations
    • Exponential and related functions
    • Logarithms and related functions
    • Power functions
    • Trigonometric functions, in radians
    • Trigonometric functions, in multiples of \(\pi\)
    • Hyperbolic functions
    • Inverse trigonometric functions, in radians
    • Inverse hyperbolic functions
    • Factorials, Gamma and related functions
    • Miscellaneous functions
  • Statistical Distributions
    • Introduction to random variables and distributions
    • Base class for univariate distributions
    • Base class for continuous univariate distributions
    • Base class for discrete univariate distributions
    • Closed form distributions, based on elementary functions
      • Boost: Arcsine Distribution
      • Boost: Cauchy distribution
      • Boost: Exponential distribution
      • Boost: Gumbel (Generalized Extreme Value distribution Type-I) distribution
      • Boost: Hyperexponential Distribution
      • !!!Boost: Kumaraswamy distribution
      • Boost: Laplace distribution
      • Boost: Logistic distribution
      • Boost: Pareto distribution
      • Boost: Rayleigh distribution
      • Boost: Triangular Distribution
      • Boost: Uniform distribution
      • Boost: Weibull (Minimum-Type-III) distribution
      • Dagum (Burr Type III) distribution
      • Fisk (log-logistic) distribution
      • Fréchet (Maximum/Minimum-Type-II or Inverse Weibull) distribution
      • Generalized Extreme Value (Maximum) or GEV distribution
      • Generalized Pareto distribution
      • Gompertz-Makeham distribution
      • Lomax distribution
      • Shifted Gompertz distribution
      • Singh-Maddala (Burr Type XII) distribution
    • Closed form distributions, based on the error function
      • !!!Boost: Lévy distribution
      • Boost: Lognormal (Johnson \(S_L\)) distribution
      • !!!Boost: Moyal Distribution
      • Boost: Normal (Johnson \(S_N\)) distribution
      • Boost: Skew normal Distribution
      • Boost: Wald (or Inverse Gaussian) distribution
      • Birnbaum-Saunders Distribution
      • Exponentially Modified Gaussian (EMG) distribution
      • Folded normal distribution
      • Half-normal distribution
      • Johnson \(S_B\) distribution
      • Johnson \(S_U\) distribution
      • Normal maximum distribution, \(\rho_{ij, i \ne j} = 0\)
      • Normal maximum modulus distribution, \(\rho_{ij, i \ne j} = 0\)
      • Sinh-arcsinh normal distribution
      • Truncated normal distribution
    • Closed form distributions, based on the incomplete gamma function
      • !!!Boost: Chi Distribution
      • Boost: Chi-Squared distribution
      • Boost: Gamma (Pearson Type III, Erlang) distribution
      • Boost: Inverse chisquared distribution
      • Boost: Inverse Gamma (Pearson Type V) distribution
      • !!!Boost: Maxwell Distribution
      • !!!Boost: Nakagami distribution
      • Amoroso distribution
      • Distribution of the logarithm of a \(\chi^2\) random variable
      • Hypoexponential (Generalized Erlang) Distribution
      • Lindley distribution (generalized)
      • Skew exponential power distribution
      • Stacy (generalized gamma) distribution
    • Closed form distributions, based on the incomplete beta function
      • Boost: Beta (Pearson Type I and II) distribution
      • Boost: Central Fisher F distribution
      • Boost: Student \(t\) (Pearson Type VII) distribution
      • Distribution of the negative logarithm of a beta variable
      • Beta-prime (Pearson Type VI) distribution
      • Generalized Beta (Type 1) distribution
      • Generalized Beta (Type 2) distribution
      • Generalized logistic distribution (JKB Types I - IV)
      • Generalized beta-exponential distribution
      • Feller-Pareto distribution
      • Fisher \(z\) distribution
      • Skew t-distribution (Jones)
      • Pearson’s rho distribution (under \(H_0\))
    • Noncentral distributions
      • Boost: Noncentral \(\chi^2\) distribution
      • Boost: Noncentral Student \(t\) distribution
      • Boost: Noncentral Fisher \(F\) distribution
      • Boost: Noncentral Beta Type I distribution
      • Noncentral Chi distribution
      • Rice (Nakagami-n) distribution
      • Noncentral distribution of the sample correlation coefficient
      • Distribution of the logarithm of a noncentral Beta Type II variable
      • Noncentral distribution (Type I) of Fisher’s \(R^2\)
      • Distribution of the logarithm of a noncentral Fisher \(1-R^2\) variable
      • Doubly non-central Student \(t\) distribution
      • Doubly non-central Fisher \(F\) distribution
    • Distributions related to multiple comparisons of means
      • Overview and literature
      • Normal maximum distribution, \(\rho_{ij, i \ne j} = \rho\)
      • Normal maximum modulus distribution, \(\rho_{ij, i \ne j} = \rho\)
      • Normal maximum distribution, \(\rho_{ij, i \ne j} = \lambda_i \lambda_j\)
      • Normal maximum modulus distribution, \(\rho_{ij, i \ne j} = \lambda_i \lambda_j\)
      • Normal range distribution
      • Studentized maximum distribution
      • Studentized maximum modulus distribution
      • Distribution of Dunnett’s \(t\), one-sided
      • Distribution of Dunnett’s \(t\), two-sided
      • Nair’s \(t\)-distribution
      • Halperin’s \(t\)-distribution
      • Nelson’s \(h\)-distribution
      • Studentized range distribution
    • Distributions related to multivariate statistical analysis
      • Distribution of the sum of the negative logarithms of independent beta variables
      • Distribution of the product of independent beta variables
      • Distribution of Wilks’ \(\Lambda\)
      • Distribution of Wilks’ \(L_{vc}\)
      • Distribution of Wilks’ \(L_{vcm}\)
      • Distribution of Wilks’ test of independence of \(p\) variates
      • Distribution of Wilks’ test of independence of \(k\) groups of variates
      • Distribution of Mauchly’s test of sphericity vs general structure
      • Distribution of Box’s test of equality of covariance matrices, equal sample sizes
      • Distribution of Box’s test of equality of k covariance matrices, unequal sample sizes
      • Distribution of Box’s test for same multivariate normal distributions, unequal sample sizes
      • Distribution of the modified likelihood ratio test (LRT) for a given covariance matrix
      • Distribution of the modified likelihood ratio test (LRT) for a given covariance matrix and mean vector
      • Central distribution of Roy’s largest root
      • Central distribution of Pillai’s \(V\)
      • Central distribution of Hotelling’s \(T^2\)
      • Noncentral Distribution of Wilks’ \(\Lambda\): MANOVA
      • Noncentral Distribution of Wilks’ \(\Lambda\): Canonical Correlation
    • Miscellaneous continuous distributions
      • Boost: Kolmogorov-Smirnov distribution (limiting form)
      • Boost: Landau Distribution
      • Boost: Holtsmark distribution
      • Boost: Map-Airy distribution
      • Boost: Saspoint5 distribution
      • Lévy alpha-stable distribution
      • Pearson Type IV distribution
      • Meixner distribution
      • Voigt Profile Distribution
      • Wrapped Cauchy distribution
      • Wrapped normal distribution
      • Von Mises distribution
      • Generalized inverse Gaussian distribution
      • Harmonic distribution
      • Halphen A distribution
      • Halphen B distribution
      • Halphen IB distribution
      • Generalized hyperbolic distribution
      • Hyperbolic distribution
      • Variance-gamma distribution
    • Elementary discrete (lattice) distributions
      • Boost: Bernoulli distribution
      • Boost: Geometric distribution
      • Boost: Poisson distribution
      • Boost: Binomial distribution
      • Boost: Negative binomial distribution
      • Boost: Classical hypergeometric distribution
      • Log-series distribution
      • Zeta distribution
      • Skellam distribution
      • Delaporte distribution
      • Beta-Poisson distribution (Quinkert)
      • Beta-binomial distribution
      • Beta-negative binomial distribution (Waring)
      • Negative hypergeometric distribution
      • Pólya-Eggenberger distribution
      • General hypergeometric distribution
      • Noncentral hypergeometric distribution, Fisher alternatives
    • Discrete (lattice) distributions related to (stratified) rank tests
      • Wilcoxon signed rank T distribution, continuous data
      • Noncentral Wilcoxon signed rank T distribution, Bennett alternatives
      • Mann-Whitney U distribution, continuous data
      • Noncentral Mann-Whitney U distribution, Lehmann alternatives
      • Noncentral Mann-Whitney U distribution, Milton alternatives
      • Kendall’s tau distribution, continuous data
      • Jonckheere-Terpsta \(T\) distribution, continuous data
      • Generalized Page \(L\) distribution, continuous data
      • Noncentral generalized Page \(L\) distribution, Milton alternatives
    • Discrete (non-lattice) distributions related to rank tests
      • Cochran-Friedman-Quade distribution
      • Kruskal-Wallis distribution
  • Numerical calculus
    • Introduction
    • DAMath: Numerical Rootfinding and Minimization
    • Boost/Math: Root Finding and Minimization Algorithms
    • Mpmath: Rootfinding and optimization
    • DAMath: Numerical Quadrature
    • Boost/Math: Numerical integration
    • Mpmath: Numerical integration
    • Mpmath: Numerical inverse Laplace transform
    • Boost/Odeint: Ordinary differential equations
    • Mpmath: Numerical differentiation
    • Mpmath: Asymptotic expansions
    • Mpmath: Function approximation
    • Mpmath: Sums, products, limits and extrapolation
    • Mpmath: Number identification
    • Mpmath: Polynomials
    • Eigen: Polynomials
    • Eigen/MinPack: non linear optimization
    • Eigen/CppOptLib: multidimensional optimization
    • Flint/Functions for polynomials
    • Flint/Power series and Taylor arithmetic
    • Flint/Verified numerical differentiation
    • Flint/Verified numerical integration
  • Eigen: Dense and Sparse Matrices
    • Creating scalars and matrices
    • Read-only properties: information about a matrix
    • Accessing and setting parts of a matrix
    • Changing the shape of a matrix and/or the order of coefficients
    • Basic arithmetic operations
    • Descriptive Statistics
    • Standard decompositions and linear solving
    • Singular Value and Eigen (selfadjoint) decompositions
    • Eigen decompositions of general square matrices
    • Eigen: Functions of matrix argument
    • Eigen: Fast Fourier Transform
  • Numpy: use with multiprecision data types
    • Numpy array creation from shape or value
    • Numpy array creation from existing data
    • Building special arrays for numerical work
    • Numpy indexing
    • Numpy basic array manipulation routines
    • Numpy array manipulation: Transpose-like operations
    • Numpy array manipulation: Changing number of dimensions
    • Numpy array manipulation: Joining arrays
    • Numpy array manipulation: Splitting and tiling arrays
    • Numpy array manipulation: Adding and removing elements
    • Numpy array manipulation: Rearranging elements
    • Numpy array manipulation: Sorting
    • Numpy array manipulation: Searching
    • Numpy mathematical functions: Sums, products, differences
    • Numpy mathematical functions: Extrema Finding
    • Numpy mathematical functions: Arithmetic operations, elementwise
    • Numpy mathematical functions: Averages and variances
    • Numpy mathematical functions: Matrix and vector products
    • Numpy logical functions: Truth value testing
    • Numpy mathematical functions: Integer and fractional
    • Numpy mathematical functions: Miscellaneous
    • Summary and examples: Numpy utility functions
    • Arithmetic operations with scalars and iterables
    • Numerical transformations and descriptive statistics
    • Standard decompositions and linear solving
    • Singular Value and Eigen decompositions
    • Analytic functions of a matrix
    • Discrete Fourier transform (DFT)
    • Flint/Functions for matrices

Special Functions

  • Elliptic functions and related
    • Carlson symmetric elliptic integrals
    • Legendre elliptic integrals (elliptic parameter \(m\))
    • Legendre elliptic integrals (elliptic modulus \(k\)), and related functions
    • Jacobi elliptic functions
    • Jacobi theta functions and related functions
    • Conversions of parameters of Weierstrass \(\wp\)
    • Weierstrass elliptic functions, in terms of elliptic period ratio \(\tau\)
    • Modular forms, in terms of half-period \(\omega_1\) and elliptic period ratio \(\tau\)
  • Lerch’s phi and related
    • Lerch’s transcendent and Lerch’s zeta
    • Polygamma and related functions
    • Polylogarithm and related functions
    • Hurwitz zeta and related functions
    • Riemann zeta function, and related functions
  • Hypergeometric function \(\,_0F_1\) and related
    • Hypergeometric Limit Function \(\,_0F_1\)
    • Bessel functions
    • Modified Bessel functions
    • Spherical Bessel functions
    • Modified spherical Bessel functions
    • Hankel functions
    • Airy functions
    • Kelvin functions
  • Hypergeometric function \(\,_1F_1\) and related
    • Hypergeometric Functions \(\,_1F_1\) (Kummer) and \(U\) (Tricomi)
    • Incomplete gamma functions
    • Coulomb, Whittaker and parabolic cylinder function
    • Error function and related functions
    • Exponential integrals, and related functions
  • Hypergeometric functions \(\,_2F_1\) and \(\,_1F_2\) (and related functions)
    • Gauss Hypergeometric Function \(\,_2F_1\)
    • Chebyshev, Gegenbauer and Jacobi polynomials
    • Legendre polynomials and related
    • Incomplete beta functions
    • Hypergeometric function \({}_1F_2\)
    • Scorer functions
    • Struve functions
    • Anger, Weber and Lommel functions

Supporting Functions

  • Algebra with random variables
    • Probability density function (pdf)
    • Probability mass function (pmf)
    • Cumulative distribution function (cdf)
    • Quantile function
    • Characteristic function
    • Moment generating function
    • Cumulant generating function
    • Probability generating function
    • Factorial Moments
    • Raw Moments
    • Central Moments
    • Cumulants
  • Series and integrals
    • Finite series algorithms for selected distributions
    • Infinite series algorithms for selected functions and distributions
    • Finite series for lattice distributions, based on factorial moments
    • Efficient integration of bell-shaped functions
    • Verified numerical integration
  • Pmf vectors
    • Basic discrete (lattice) distribution functions
    • Discrete (lattice) distribution functions related to (stratified) rank tests
    • Discrete (non-lattice) distribution functions related to rank tests
  • Fast approximations
    • Approximations based on the normal distribution
    • Approximations based on the chi-squared distribution
    • Approximations based on the central \(t\), \(F\) or beta distribution
    • Approximations based on the noncentral chi-squared distribution
    • Approximations based on the noncentral F or beta distribution
    • Approximations based on hypergeometric functions of scalar argument

Gallery of Plots

  • Visualisation of datasets
    • Bar Charts
    • Line and lollipop charts
    • Area Plots
    • Boxplot, Violinplot and Raincloud plot
    • Correlation and regression
    • Financial plots (requires mplfinance)
    • Geographic data (requires cartopy)
    • Geographic data (requires geopandas)
    • Parts of a whole
    • Arcplots, dendrograms, heatmaps and clustermaps
    • PlotTable
    • Flow and connections
    • Circular plots and flows
    • Network data (requires networkx)
  • Visualisation of functions and curves (2D)
    • Introduction to 2D functions and curves
    • Basic curves
    • Spirals
    • Decorative curves
    • General curve families
    • Field lines
    • Contours
    • Complex functions rendered as contours
    • Streams, barbs and quivers (some require cartopy)
  • Bitmaps
    • Fractals: introduction
    • Fractals related to the Mandelbrot set
    • Fractals related to the Julia set
    • Newton Fractals
    • Domain coloring options
    • Domain coloring: Examples part 1
  • Matplotlib 3D Graphics
    • Introduction
    • Matplotlib: 3D Graphics, part 2
    • S3dlib: Basic geometric figures
    • S3dlib: Real functions
    • S3dlib: Parametric Surfaces
    • S3dlib: Image mapping and clipping
    • S3dlib: Edge-to-edge surface coloring
    • S3dlib: Decorative parametric surfaces
    • S3dlib: Geometric and color datagrid mapping (requires scipy)
    • S3dlib: Implicit surfaces (requires scikit-image)
  • Plotly
    • General surface plots in 3D
    • Geographical plots
    • Sankey plots

Interactive 3D Wpf Plots

  • Wpf: Altitude surfaces in 3D, real and complex functions
    • Special techniques for height surfaces, real and complex functions
    • Scatterplots and building 3D scenes
    • Height plots of general bivariate real functions
  • Wpf: Parametric surfaces
    • Surfaces of translation
    • Surfaces of revolution: spheres and related
    • Generalisations of common surfaces
    • Minimal surfaces
    • Nonorientable (one-sided) Surfaces
    • Decorative parametric surfaces
  • Wpf: Path surfaces in 3D
    • Introduction to path surfaces
    • Functions with real input and complex results
    • Characteristic functions of statistical distributions
    • Helices and related curves traced on cylinders, cones and spheres
    • Coil springs
    • General knots
    • Torus knots
    • Lissajous knots
    • Polynomial knots
  • Wpf: Built-in 3D objects
    • Builtin solids with support for textures
    • Builtin solids without support for textures
    • Platonic solids, and related solids

User library: numerical

  • Additional Classes
    • User defined functions based on multiple precision arithmetic (Python)
    • User defined functions based on fixed precision arithmetic (C#)
    • User defined functions based on arbitrary precision arithmetic (C#)
    • Scalar functions
  • Distribution functions
    • Distributions related to multiple comparisons of means
    • Discrete (lattice) distribution functions related to (stratified) rank tests
    • Discrete (non-lattice) distribution functions related to rank tests
  • Inferential statistics
    • Basic classical statistical tests (stratified)
    • Basic classical statistical tests for 2 independent samples (stratified)
    • Basic classical statistical tests for 2 correlated samples (stratified)
    • Analysis of variance (ANOVA), orthogonal polynomials, and analysis of means (AOM)
    • Multiple comparisons of means
    • Nonparametric statistical tests, 1 or 2 samples
    • Nonparametric statistical tests, k samples
    • Multivariate statistical tests
  • Addditional elementary functions (real arguments, double precision)
    • Additional root, exponential, logarithmic and power functions
    • Additional Trigonometric functions (real arguments only)
    • Additional real error functions (real arguments only)
    • Additional real gamma functions (real arguments only)
    • Additional real incomplete gamma functions (real arguments only)
  • Addditional special functions (real arguments, double precision)
    • Conversions of parameters of elliptic functions
    • Additional elliptic integrals
    • Bulirsch elliptic integrals
    • Maple style elliptic integrals
    • Jacobi theta functions at \(x=0\) for \(0 \le q <1\)
    • Inverse Jacobi elliptic functions
    • Lemniscate functions
    • Neville theta functions
    • Polygamma, and related functions
    • Polylogarithm, and related functions
    • Riemann zeta, and related functions
    • Bessel functions of integer order
    • Modified Bessel functions of integer order
    • Integrals of zero-order Bessel functions
    • Kelvin functions of order 0
    • Synchrotron functions
    • Error function, and related functions
    • Exponential integrals, and related functions
    • Coulomb, Whittaker and parabolic cylinder function
    • Hypergeometric pFq, and related functions
    • Miscellaneous functions
  • Addditional special functions (complex arguments, double precision)
    • Conversions of parameters of Weierstrass \(\wp\)
    • Weierstrass elliptic functions, in terms of (real) lattice invariants \(g_2, g_3\)
    • Weierstrass elliptic functions, in terms of (real) lattice roots \(e_1, e_2\)
    • Weierstrass elliptic functions, in terms of lattice half-periods \(\omega_1\) and \(\omega_2\)
  • Addditional special functions (Mpmath)
    • Mpmath: Conversions of parameters of elliptic functions
    • Related to Lerch’s phi
    • Additional numbertheoretic functions
    • Generalized hypergeometric functions
    • Appell Functions
    • Q Functions
    • Further generalizations of gamma and hypergeometric functions

Back matter

  • License and History
    • Mozilla Public License Version 2.0
    • History

Indices

  • General Index
  • .rst

Exponential and related functions

Contents

  • Exponential function \(\exp(x) = e^x\)
    • ctx.exp()
  • Auxiliary function \(\mathrm{expj}(x) = e^{ix}\)
    • ctx.expj()
  • Auxiliary function \(\mathrm{expjpi}(x) = e^{i \pi x} = (-1)^x\)
    • ctx.expjpi()
  • Exponential function with base \(10\), \(\mathrm{exp10}(x) = 10^z\)
    • ctx.exp10()
  • Exponential function with base \(2\), \(\mathrm{exp2}(x) = 2^x\)
    • ctx.exp2()
  • Auxiliary function \(\mathrm{expm1}(x) = e^x-1\)
    • ctx.expm1()
  • Auxiliary function \(\mathrm{exp10m1}(x) = 10^x - 1\)
    • ctx.exp10m1()
  • Auxiliary function \(\mathrm{exp2m1}(x) = 2^x - 1\)
    • ctx.exp2m1()

Exponential and related functions#

Exponential function \(\exp(x) = e^x\)#

ctx.exp(z)#

where ctx is ctx_pm (see Python contexts for details), ctx53, ctxcpp, ctxflint (see .NET contexts for details).

Returns \(\exp(x)\), the exponential function of \(x\). See also Wikipedia [1342], MathWorld [919], NIST [515], Ehrhardt [309] (4.2.34), Flint [804], Flint [794], Mpmath [573].

For complex numbers, the exponential function satisfies \(\exp(x + iy) = e^x (\cos y + i \sin y)\).

04a_TestExp_re \(\quad\) 04b_TestExp_im \(\quad\) 04c_TestExp_abs

3D wpf plot: real part (left figure), imaginary part (middle figure) and absolute value with color-coded phase (right figure) of the complex sine function \(z = \sin(x + iy)\), with \(-6 \le x \le 6\) (blue axis), \(-6 \le y \le 6\) (red axis), \(-10 \le z \le 10\) (green axis). Function values are loglog-transformed.

An example with real input:

>>> from xlcalcnet import *
>>> x = -5.1; dps = 90
>>> for ctx in ctxlistreal: print(ctx.fmtname + ': ' + ctx.fmt(ctx.exp(x)))
    fpm:  0.00609674656551564
    mpm:  0.00609674656551563610713456478542490178906004208066809730839371569595697636773934832576013656
    dpm:  0.00609674656551563610713456478542490178906004208066809730839371569595697636773934832576013656
    ipm: [0.0060967465655156361071345647854249017890600420806680973083937156959569763677393483257601365613434,
          0.0060967465655156361071345647854249017890600420806680973083937156959569763677393483257601365690139]
    gpm:  0.0060967465655156361071345647854249017890600420806680973083937156959569763677393483257601365623
    apm: [0.00609674656551563610713456478542490178906004208066809730839371569595697636773934832576013657 +/- 8.90e-93]
  dreal:  0.00609674656551564
  sreal:  0.006096747
  dreal:  0.00609674656551564
  ereal:  0.0060967465655156361078
  qreal:  0.0060967465655156361071345647854249
  oreal:  0.0060967465655156361071345647854249017890600420806680973083937156959569763
  mreal:  0.00609674656551563610713456478542490178906004208066809730839371569595697636773934832576013657
 sflint:  0.006096747
 dflint:  0.00609674656551564
 eflint:  0.0060967465655156361078
 qflint:  0.0060967465655156361071345647854249
 oflint:  0.0060967465655156361071345647854249017890600420806680973083937156959569764
 mflint:  0.00609674656551563610713456478542490178906004208066809730839371569595697636773934832576013657
 aflint: [0.0060967465655156361071345647854249017890600420806680973083937156959569763677393483257601366 +/- 4.16e-92]

An example with complex input, using C#-style formatting for complex numbers for the result

>>> from xlcalcnet import *
>>> x = -5.1+2j; gui.setdps(50)
>>> for ctx in [fpm, mpm, cmath53, qcplx]: print(ctx.fmtname + ': ' + ctx.fmt(ctx.exp(x)))
    fpm:  (-0.00253714179646899, 0.00554375596403168)
    mpm:  (-0.0025371417964689871432868572987332349386956711932343, 0.0055437559640316803155849317223325676631201581872807)
cmath53:  (-0.00253714179646899, 0.00554375596403168)
  qcplx:  (-0.00253714179646898714328685729873324, 0.00554375596403168031558493172233257)

The above and additional examples can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder for Python (real input), Python (complex input), and C# (real or complex input).

Auxiliary function \(\mathrm{expj}(x) = e^{ix}\)#

ctx.expj(z)#

where ctx is math53, mathc53, ctxcpp, ctxflint.

Returns \(e^{iz} = \cos(z) + i \sin(z)\). See also Wikipedia [1492], MathWorld [1094], Mpmath [752].

An example with real input:

>>> from xlcalcnet import *
>>> x = -5.1; dps = 50
>>> for ctx in gui.ctxlist_real: print(ctx.fmtname + ': ' + ctx.cplxctx.fmt(ctx.expj(x)))
    fpm:  (0.37797774271298, 0.925814682327732)
    mpm:  (0.37797774271298056332057555292898167089864157613427, 0.92581468232773229694614624754486331250940301635561)
    dpm:  (0.37797774271298056332057555292898167089864157613428, 0.9258146823277322969461462475448633125094030163556)
    ipm: ([0.3779777427129805633205755529289816708986415761342730157, 0.3779777427129805633205755529289816708986415761342837068],
          [0.9258146823277322969461462475448633125094030163556011089, 0.9258146823277322969461462475448633125094030163556064544])
    gpm:  (0.3779777427129805633205755529289816708986415761342737, 0.9258146823277322969461462475448633125094030163556051)
    apm: ([0.3779777427129805633205755529289816708986415761343 +/- 3.78e-50], [0.9258146823277322969461462475448633125094030163556 +/- 1.06e-50])
  dreal:  (0.37797774271298, 0.925814682327732)
  sreal:  (0.3779777, 0.9258147)
  dreal:  (0.37797774271298, 0.925814682327732)
  ereal:  (0.37797774271298056325, 0.92581468232773229699)
  qreal:  (0.377977742712980563320575552928981, 0.925814682327732296946146247544863)
  oreal:  (0.37797774271298056332057555292898167089864157613427757054176691301095088, 0.92581468232773229694614624754486331250940301635560394879705455193228186)
  mreal:  (0.37797774271298056332057555292898167089864157613429, 0.92581468232773229694614624754486331250940301635559)
 sflint:  (0.3779777, 0.9258147)
 dflint:  (0.37797774271298, 0.925814682327732)
 eflint:  (0.37797774271298056325, 0.92581468232773229699)
 qflint:  (0.377977742712980563320575552928981, 0.925814682327732296946146247544863)
 oflint:  (0.37797774271298056332057555292898167089864157613427757054176691301095088, 0.92581468232773229694614624754486331250940301635560394879705455193228185)
 mflint:  (0.37797774271298056332057555292898167089864157613429, 0.92581468232773229694614624754486331250940301635559)
 aflint: ([0.3779777427129805633205755529289816708986415761343 +/- 2.92e-50], [0.9258146823277322969461462475448633125094030163556 +/- 2.44e-50])

An example with complex input, using C#-style formatting for complex numbers for the result

>>> from xlcalcnet import *
>>> x = -5.1+2j; gui.setdps(50)
>>> for ctx in [fpm, mpm, cmath53, qcplx]: print(ctx.fmtname + ': ' + ctx.fmt(ctx.expj(x)))
    fpm:  (0.0511537248671967, 0.125295392257438)
    mpm:  (0.0511537248671967434898253949927467610442454662229, 0.1252953922574382533359994793180146319527429028572)
cmath53:  (0.0511537248671967, 0.125295392257438)
  qcplx:  (0.0511537248671967434898253949927467, 0.125295392257438253335999479318014)

The above and additional examples can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder for Python (real input), Python (complex input), and C# (real or complex input).

Auxiliary function \(\mathrm{expjpi}(x) = e^{i \pi x} = (-1)^x\)#

ctx.expjpi(z)#

where ctx is math53, mathc53, ctxcpp or ctxflint.

Returns \(e^{i \pi z} = \cos(\pi z) + i \sin(\pi z)\). See also Wikipedia [1492], MathWorld [1094], Flint [794], Mpmath [753].

Evaluation is accurate near zeros (see also cospi() and sinpi()):

An example with real input:

>>> from xlcalcnet import *
>>> x = -5.1; dps = 50
>>> for ctx in gui.ctxlist_real: print(ctx.fmtname + ': ' + ctx.cplxctx.fmt(ctx.expjpi(x)))
    fpm:  (-0.951056516295154, 0.309016994374946)
    mpm:  (-0.95105651629515357211643933337938214340569863412575, 0.30901699437494742410229341718281905886015458990287)
    dpm:  (-0.95105651629515357211643933337938214340569863412575, 0.30901699437494742410229341718281905886015458990288)
    ipm: ([-0.951056516295153572116439333379382143405698634125765038, -0.951056516295153572116439333379382143405698634125736974], [0.3090169943749474241022934171828190588601545899028378188, 0.3090169943749474241022934171828190588601545899029200063])
    gpm:  (-0.9510565162951535721164393333793821434056986341257517, 0.3090169943749474241022934171828190588601545899028786)
    apm: ([-0.9510565162951535721164393333793821434056986341258 +/- 5.79e-50], [0.3090169943749474241022934171828190588601545899029 +/- 6.59e-50])
  dreal:  (-0.951056516295154, 0.309016994374946)
  sreal:  (-0.9510566, 0.3090167)
  dreal:  (-0.951056516295154, 0.309016994374946)
  ereal:  (-0.95105651629515357222, 0.30901699437494742386)
  qreal:  (-0.951056516295153572116439333379382, 0.309016994374947424102293417182818)
  oreal:  (-0.95105651629515357211643933337938214340569863412575022244730564443015319, 0.30901699437494742410229341718281905886015458990288143106772431135263019)
  mreal:  (-0.95105651629515357211643933337938214340569863412573, 0.30901699437494742410229341718281905886015458990293)
 sflint:  (-0.9510566, 0.3090167)
 dflint:  (-0.951056516295154, 0.309016994374946)
 eflint:  (-0.95105651629515357222, 0.30901699437494742383)
 qflint:  (-0.951056516295153572116439333379382, 0.309016994374947424102293417182818)
 oflint:  (-0.95105651629515357211643933337938214340569863412575022244730564443015318, 0.30901699437494742410229341718281905886015458990288143106772431135263019)
 mflint:  (-0.95105651629515357211643933337938214340569863412573, 0.30901699437494742410229341718281905886015458990292)
 aflint: ([-0.9510565162951535721164393333793821434056986341257 +/- 6.44e-50], [0.3090169943749474241022934171828190588601545899029 +/- 8.93e-50])

An example with complex input, using C#-style formatting for complex numbers for the result

>>> from xlcalcnet import *
>>> x = -5.1+2j; gui.setdps(50)
>>> for ctx in [fpm, mpm, cmath53, qcplx]: print(ctx.fmtname + ': ' + ctx.fmt(ctx.expjpi(x)))
    fpm:  (-0.00177604357879891, 0.000577071540119742)
    mpm:  (-0.0017760435787989049642054631852541036755960880447526, 0.00057707154011974403113330884851121775451896357682577)
cmath53:  (-0.00177604357725158, 0.000577071540703855)
  qcplx:  (-0.00177604357879890496420546318529556, 0.000577071540119744031133308848517094)

The above and additional examples can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder for Python (real input), Python (complex input), and C# (real or complex input).

Exponential function with base \(10\), \(\mathrm{exp10}(x) = 10^z\)#

ctx.exp10(x)#

where ctx is math53, mathc53, ctxcpp or ctxflint.

Returns \(\mathrm{exp10}(x) = 10^z = \exp(x \cdot \log(10))\), the base-10 exponential function of \(z\). See also Wikipedia [1348], MathWorld [919], NIST [515], Ehrhardt [309] (4.2.36), Mpmath [579].

An example with real input:

>>> from xlcalcnet import *
>>> x = -5.1; dps = 90
>>>     for ctx in gui.ctxlist_real: print(ctx.fmtname + ': ' + ctx.fmt(ctx.exp10(x))
    fpm:  7.94328234724282E-06
    mpm:  0.00000794328234724281502065918282836387932588960631755484332092323929316955697191487537497095251
    dpm:  0.00000794328234724281502065918282836387932588960631755484332092323929316955697191487537497095252
    ipm: [0.0000079432823472428150206591828283638793258896063175548433209232392931695569719148753749709524789891,
          0.0000079432823472428150206591828283638793258896063175548433209232392931695569719148753749709525445325]
    gpm:  7.9432823472428150206591828283638793258896063175548433209232392931695569719148753749709525146e-06
    apm: [7.943282347242815020659182828363879325889606317554843320923239293169556971914875374970953e-6 +/- 5.13e-94]
  dreal:  7.94328234724282E-06
  sreal:  7.943281E-06
  dreal:  7.94328234724281E-06
  ereal:  7.9432823472428150204e-06
  qreal:  7.94328234724281502065918282836389e-06
  oreal:  7.9432823472428150206591828283638793258896063175548433209232392931695569e-06
  mreal:  7.94328234724281502065918282836387932588960631755484332092323929316955697191487537497095253E-06
 sflint:  7.943284E-06
 dflint:  7.94328234724282E-06
 eflint:  7.9432823472428150221e-06
 qflint:  7.94328234724281502065918282836388e-06
 oflint:  7.9432823472428150206591828283638793258896063175548433209232392931695572e-06
 mflint:  7.94328234724281502065918282836387932588960631755484332092323929316955697191487537497095253E-06
 aflint: [7.943282347242815020659182828363879325889606317554843320923239293169556971914875374970953e-6 +/- 5.60e-94]

An example with complex input, using C#-style formatting for complex numbers for the result

>>> from xlcalcnet import *
>>> x = -5.1+2j; gui.setdps(50)
>>> for ctx in [fpm, mpm, cmath53, qcplx]: print(ctx.fmtname + ': ' + ctx.fmt(ctx.exp10(x)))
    fpm:  (-8.50038314869339E-07, -7.89766859973711E-06)
    mpm:  (-0.0000008500383148693386092398053603383376816809556042249, -0.0000078976685997371034342479584101601100277547297776704)
cmath53:  (-8.50038314869336E-07, -7.89766859973711E-06)
  qcplx:  (-8.50038314869338609239805360338339e-07, -7.89766859973710343424795841016012e-06)

The above and additional examples can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder for Python (real input), Python (complex input), and C# (real or complex input).

Exponential function with base \(2\), \(\mathrm{exp2}(x) = 2^x\)#

ctx.exp2(x)#

where ctx is math53, mathc53, ctxcpp or ctxflint.

Returns \(\mathrm{exp2}(x) = 2^x = \exp(x \cdot \log(2))\), the base-2 exponential function of \(x\). See also Wikipedia [1349], MathWorld [919], NIST [515], Ehrhardt [309] (4.2.35).

An example with real input:

>>> from xlcalcnet import *
>>> x = -5.1; dps = 90
>>> for ctx in gui.ctxlist_real: print(ctx.fmtname + ': ' + ctx.fmt(ctx.exp2(x)))
    fpm:  0.0291572809855252
    mpm:  0.0291572809855252317494169770671856927196009363859841887156405432964186568847051108626158585
    dpm:  0.0291572809855252317494169770671856927196009363859841887156405432964186568847051108626158585
    ipm: [0.0291572809855252317494169770671856927196009363859841887156405432964186568847051108626158585305,
          0.029157280985525231749416977067185692719600936385984188715640543296418656884705110862615858591864]
    gpm:  0.029157280985525231749416977067185692719600936385984188715640543296418656884705110862615858538
    apm: [0.0291572809855252317494169770671856927196009363859841887156405432964186568847051108626158586 +/- 8.98e-92]
  dreal:  0.0291572809855252
  sreal:  0.02915728
  dreal:  0.0291572809855252
  ereal:  0.029157280985525231751
  qreal:  0.0291572809855252317494169770671857
  oreal:  0.029157280985525231749416977067185692719600936385984188715640543296418657
  mreal:  0.0291572809855252317494169770671856927196009363859841887156405432964186568847051108626158586
 sflint:  0.02915728
 dflint:  0.0291572809855252
 eflint:  0.029157280985525231751
 qflint:  0.0291572809855252317494169770671857
 oflint:  0.029157280985525231749416977067185692719600936385984188715640543296418657
 mflint:  0.0291572809855252317494169770671856927196009363859841887156405432964186568847051108626158586
 aflint: [0.029157280985525231749416977067185692719600936385984188715640543296418656884705110862615859 +/- 5.38e-91]

An example with complex input, using C#-style formatting for complex numbers for the result

>>> from xlcalcnet import *
>>> x = -5.1+2j; gui.setdps(50)
>>> for ctx in [fpm, mpm, cmath53, qcplx]: print(ctx.fmtname + ': ' + ctx.fmt(ctx.exp2(x)))
    fpm:  (0.00534910656134485, 0.0286624160437366)
    mpm:  (0.0053491065613448526660310040295797895499084770752861, 0.028662416043736589994269252987760995841700161519681)
cmath53:  (0.00534910656134486, 0.0286624160437366)
  qcplx:  (0.00534910656134485266603100402957979, 0.028662416043736589994269252987761)

The above and additional examples can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder for Python (real input), Python (complex input), and C# (real or complex input).

Auxiliary function \(\mathrm{expm1}(x) = e^x-1\)#

ctx.expm1(x)#

where ctx is math53, mathc53, ctxcpp or ctxflint.

Returns \(\mathrm{expm1}(x) = \exp(x)-1 = e^x-1\), computed accurately also for small \(x\). See also Wikipedia [1341], MathWorld [919], NIST [515], BoostMath [81], Ehrhardt [309] (4.2.37), Flint [804], Flint [794], Mpmath [574].

An example with real input:

>>> from xlcalcnet import *
>>> x = -5.1; dps = 90
>>> for ctx in gui.ctxlist_real: print(ctx.fmtname + ': ' + ctx.fmt(ctx.expm1(x)))
    fpm:  -0.993903253434484
    mpm:  -0.993903253434484363892865435214575098210939957919331902691606284304043023632260651674239863
    dpm:  -0.993903253434484363892865435214575098210939957919331902691606284304043023632260651674239863
    ipm: [-0.99390325343448436389286543521457509821093995791933190269160628430404302363226065167423986352495,
          -0.99390325343448436389286543521457509821093995791933190269160628430404302363226065167423986340222]
    gpm:  -0.9939032534344843638928654352145750982109399579193319026916062843040430236322606516742398634
    apm: [-0.993903253434484363892865435214575098210939957919331902691606284304043023632260651674239863 +/- 5.31e-91]
  dreal:  -0.993903253434484
  sreal:  -0.9939033
  dreal:  -0.993903253434484
  ereal:  -0.99390325343448436389
  qreal:  -0.993903253434484363892865435214575
  oreal:  -0.99390325343448436389286543521457509821093995791933190269160628430404302
  mreal:  -0.993903253434484363892865435214575098210939957919331902691606284304043023632260651674239864
 sflint:  -0.9939033
 dflint:  -0.993903253434484
 eflint:  -0.99390325343448436389
 qflint:  -0.993903253434484363892865435214575
 oflint:  -0.99390325343448436389286543521457509821093995791933190269160628430404302
 mflint:  -0.993903253434484363892865435214575098210939957919331902691606284304043023632260651674239864
 aflint: [-0.993903253434484363892865435214575098210939957919331902691606284304043023632260651674239863 +/- 6.53e-91]

An example with complex input, using C#-style formatting for complex numbers for the result

>>> from xlcalcnet import *
>>> x = -5.1+2j; gui.setdps(50)
>>> for ctx in [fpm, mpm, cmath53, qcplx]: print(ctx.fmtname + ': ' + ctx.fmt(ctx.expm1(x)))
    fpm:  (-1.00253714179647, 0.00554375596403168)
    mpm:  (-1.0025371417964689871432868572987332349386956711932, 0.0055437559640316803155849317223325676631201581872807)
cmath53:  (-1.00253714179647, 0.00554375596403168)
  qcplx:  (-1.00253714179646898714328685729873, 0.00554375596403168031558493172233257)

The above and additional examples can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder for Python (real input), Python (complex input), and C# (real or complex input).

Auxiliary function \(\mathrm{exp10m1}(x) = 10^x - 1\)#

ctx.exp10m1(x)#

where ctx is math53, mathc53, ctxcpp or ctxflint.

Returns \(10^x - 1 = \mathrm{expm1}(x \cdot \log(10))\). See also expm1().

An example with real input:

>>> from xlcalcnet import *
>>> x = -5.1; dps = 90
>>> for ctx in gui.ctxlist_real: print(ctx.fmtname + ': ' + ctx.fmt(ctx.exp10m1(x)))
    fpm:  -0.999992056717653
    mpm:  -0.999992056717652757184979340817171636120674110393682445156679076760706830443028085124625029
    dpm:  -0.999992056717652757184979340817171636120674110393682445156679076760706830443028085124625029
    ipm: [-0.99999205671765275718497934081717163612067411039368244515667907676070683044302808512462502915426,
          -0.99999205671765275718497934081717163612067411039368244515667907676070683044302808512462502903153]
    gpm:  -0.99999205671765275718497934081717163612067411039368244515667907676070683044302808512462502903
    apm: [-0.999992056717652757184979340817171636120674110393682445156679076760706830443028085124625029 +/- 1.55e-91]
  dreal:  -0.999992056717653
  sreal:  -0.9999921
  dreal:  -0.999992056717653
  ereal:  -0.99999205671765275719
  qreal:  -0.999992056717652757184979340817172
  oreal:  -0.99999205671765275718497934081717163612067411039368244515667907676070683
  mreal:  -0.999992056717652757184979340817171636120674110393682445156679076760706830443028085124625029
 sflint:  -0.9999921
 dflint:  -0.999992056717653
 eflint:  -0.99999205671765275719
 qflint:  -0.999992056717652757184979340817172
 oflint:  -0.99999205671765275718497934081717163612067411039368244515667907676070683
 mflint:  -0.999992056717652757184979340817171636120674110393682445156679076760706830443028085124625029
 aflint: [-0.999992056717652757184979340817171636120674110393682445156679076760706830443028085124625029 +/- 7.06e-91]

An example with complex input, using C#-style formatting for complex numbers for the result

>>> from xlcalcnet import *
>>> x = -5.1+2j; gui.setdps(50)
>>> for ctx in [fpm, mpm, cmath53, qcplx]: print(ctx.fmtname + ': ' + ctx.fmt(ctx.exp10m1(x)))
    fpm:  (-1.00000085003831, -7.89766859973711E-06)
    mpm:  (-1.0000008500383148693386092398053603383376816809556, -0.0000078976685997371034342479584101601100277547297776704)
cmath53:  (-1.00000085003831, -7.8976685997371E-06)
  qcplx:  (-1.00000085003831486933860923980536, -7.89766859973710343424795841016012e-06)

The above and additional examples can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder for Python (real input), Python (complex input), and C# (real or complex input).

Auxiliary function \(\mathrm{exp2m1}(x) = 2^x - 1\)#

ctx.exp2m1(x)#

where ctx is math53, mathc53, ctxcpp or ctxflint.

Returns \(2^x - 1 = \mathrm{expm1}(x \cdot \log(2))\). See also expm1().

An example with real input:

>>> from xlcalcnet import *
>>> x = -5.1; dps = 90
>>> for ctx in gui.ctxlist_real: print(ctx.fmtname + ': ' + ctx.fmt(ctx.exp2m1(x)))
    fpm:  -0.970842719014475
    mpm:  -0.970842719014474768250583022932814307280399063614015811284359456703581343115294889137384141
    dpm:  -0.970842719014474768250583022932814307280399063614015811284359456703581343115294889137384141
    ipm: [-0.9708427190144747682505830229328143072803990636140158112843594567035813431152948891373841415347,
          -0.97084271901447476825058302293281430728039906361401581128435945670358134311529488913738414128924]
    gpm:  -0.97084271901447476825058302293281430728039906361401581128435945670358134311529488913738414141
    apm: [-0.970842719014474768250583022932814307280399063614015811284359456703581343115294889137384141 +/- 5.79e-91]
  dreal:  -0.970842719014475
  sreal:  -0.9708427
  dreal:  -0.970842719014475
  ereal:  -0.97084271901447476827
  qreal:  -0.970842719014474768250583022932814
  oreal:  -0.97084271901447476825058302293281430728039906361401581128435945670358134
  mreal:  -0.970842719014474768250583022932814307280399063614015811284359456703581343115294889137384142
 sflint:  -0.9708427
 dflint:  -0.970842719014475
 eflint:  -0.97084271901447476827
 qflint:  -0.970842719014474768250583022932814
 oflint:  -0.97084271901447476825058302293281430728039906361401581128435945670358134
 mflint:  -0.970842719014474768250583022932814307280399063614015811284359456703581343115294889137384142
 aflint: [-0.970842719014474768250583022932814307280399063614015811284359456703581343115294889137384141 +/- 7.68e-91]

An example with complex input, using C#-style formatting for complex numbers for the result

>>> from xlcalcnet import *
>>> x = -5.1+2j; gui.setdps(50)
>>> for ctx in [fpm, mpm, cmath53, qcplx]: print(ctx.fmtname + ': ' + ctx.fmt(ctx.exp2m1(x)))
    fpm:  (-0.994650893438655, 0.0286624160437366)
    mpm:  (-0.99465089343865514733396899597042021045009152292471, 0.028662416043736589994269252987760995841700161519681)
cmath53:  (-0.994650893438655, 0.0286624160437366)
  qcplx:  (-0.99465089343865514733396899597042, 0.028662416043736589994269252987761)

The above and additional examples can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder for Python (real input), Python (complex input), and C# (real or complex input).

previous

Roots and quadratic, cubic, and quartic equations

next

Logarithms and related functions

Contents
  • Exponential function \(\exp(x) = e^x\)
    • ctx.exp()
  • Auxiliary function \(\mathrm{expj}(x) = e^{ix}\)
    • ctx.expj()
  • Auxiliary function \(\mathrm{expjpi}(x) = e^{i \pi x} = (-1)^x\)
    • ctx.expjpi()
  • Exponential function with base \(10\), \(\mathrm{exp10}(x) = 10^z\)
    • ctx.exp10()
  • Exponential function with base \(2\), \(\mathrm{exp2}(x) = 2^x\)
    • ctx.exp2()
  • Auxiliary function \(\mathrm{expm1}(x) = e^x-1\)
    • ctx.expm1()
  • Auxiliary function \(\mathrm{exp10m1}(x) = 10^x - 1\)
    • ctx.exp10m1()
  • Auxiliary function \(\mathrm{exp2m1}(x) = 2^x - 1\)
    • ctx.exp2m1()

By Dietrich Hadler

© Copyright 2026, Dietrich Hadler. .

Last updated on Aug 27, 2026.