Error function and related functions#
Error function, \(\mathrm{erf}(x)\)#
- ctx.erf(x)#
where
ctxismath53,mathc53,ctxboost,ctxflint.Returns the real error function \(\displaystyle \mathrm{erf}(x) = \frac{2}{\sqrt \pi} \int_0^x \exp(-t^2) \mathrm{d}t\). See also BoostMath [100], BoostMath [80], Wikipedia [1340], MathWorld [916], NIST [843], Ehrhardt [309] (4.2.32), Flint [803], Flint [793], Mpmath [571].
This function returns the value of the error function defined by
\[\text{erf}(z) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-z^2} \mathrm{d}t = \frac{2 z}{\sqrt{\pi}} {}_1F_1 \left(\tfrac{1}{2}, \tfrac{3}{2}, -z^2 \right).\]Left figure: real part of the Erf function. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Middle figure: imaginary part of the Erf function. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Right figure: absolute value of the Erf function, with color-coded phase. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
An example in Python
>>> from xlcalcnet import xreal >>> xreal.Dawson(0.5) xreal('5.2359877559829887307E-1') >>> xreal.Dawson('0.51') xreal('5.3518479027559984754E-1')
An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.Dawson(0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.Dawson('0.51') Gpr('5.3518479027559984754E-1')
An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 40; x = 3.0 >>> \mathrm{d}x = dec.erf(x); mx = mpm.erf(x); gx = gmp.erf(x) >>> fx = fpm.erf(x); ax = apm.erf(x) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax]) dec: 9.999779095030014145586272238704176796201E-1 mpm: 9.999779095030014145586272238704176796201e-1 gmp: 9.999779095030014145586272238704176796201E-01 fpm: 9.99977909503001E-01 apm: 9.999779095030014145586272238704176796202e-1 (5.74e-40%)
An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; z = '3.0 + 4.0j' >>> \mathrm{d}z = dec.erf(z); mz = mpm.erf(z); gz = gmp.erf(z) >>> fz = fpm.erf(z); az = apm.erf(z) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: -1.2018699139507944410E+2 - 2.7750337293623902498E+1j mpm: -1.2018699139507944410e+2 - 2.7750337293623902498e+1j gmp: -1.2018699139507944410E+02 - 2.7750337293623902498E+01j fpm: -1.20186991395079E+02 - 2.77503372936239E+01j apm: -1.2018699139507944410e+2 (-9.021e-20%) - 2.7750337293623902498e+1 (-4.884e-20%)j
Complementary error function, \(\mathrm{erfc}(x)\)#
- ctx.erfc(x)#
where
ctxismath53,mathc53,ctxboost,ctxflint.Returns the complementary error function \(\displaystyle \mathrm{erfc}(x) = 1-\mathrm{erf}(x) = \frac{2}{\sqrt \pi} \int_x^{\infty} \exp(-t^2)\, \mathrm{d}t\).
See also BoostMath [80], Wikipedia [1337], MathWorld [917], NIST [843], MathWorld [1051], Ehrhardt [309] (3.3.5), Ehrhardt [309] (4.2.33), Mpmath [570].
Returns the value of the complementary error function defined by
\[\text{erfc}(x) = 1-\text{erfc}(x) = \frac{2}{\sqrt{\pi}} \int_x^\infty e^{-x^2} \mathrm{d}t,\]Left figure: real part of the Erfc function. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Middle figure: imaginary part of the Erfc function. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Right figure: absolute value of the Erfc function, with color-coded phase. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
An example in Python
>>> from xlcalcnet import xreal >>> xreal.Erfc(0.5) xreal('5.2359877559829887307E-1') >>> xreal.Erfc('0.51') xreal('5.3518479027559984754E-1')
An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.Erfc(0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.Erfc('0.51') Gpr('5.3518479027559984754E-1')
An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 40; x = 3.0 >>> \mathrm{d}x = dec.erfc(x); mx = mpm.erfc(x); gx = gmp.erfc(x) >>> fx = fpm.erfc(x); ax = apm.erfc(x) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax]) dec: 2.209049699858544137277612958232037984771E-5 mpm: 2.209049699858544137277612958232037984771e-5 gmp: 2.209049699858544137277612958232037984771E-05 fpm: 2.20904969985854E-05 apm: 2.209049699858544137277612958232037984771e-5 (1.586e-39%)
An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; z = '3.0 + 4.0j' >>> \mathrm{d}z = dec.erfc(z); mz = mpm.erfc(z); gz = gmp.erfc(z) >>> fz = fpm.erfc(z); az = apm.erfc(z) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: 1.2118699139507944410E+2 + 2.7750337293623902498E+1j mpm: 1.2118699139507944410e+2 + 2.7750337293623902498e+1j gmp: 1.2118699139507944410E+02 + 2.7750337293623902498E+01j fpm: 1.21186991395079E+02 + 2.77503372936239E+01j apm: 1.2118699139507944410e+2 (8.947e-20%) + 2.7750337293623902498e+1 (4.884e-20%)j
Inverse of the real error function, \(\mathrm{erf}^{-1}(x)\)#
- ctx.erf_inv(q)#
where
ctxismath53,ctxcpp,ctxboostorctxflint.Returns the inverse of the real error function, satisfying \(\mathrm{erf}(\mathrm{erfinv}(x)) = \mathrm{erfinv}(\mathrm{erf}(x)) = x\). See also BoostMath [79], Wikipedia [1340], MathWorld [922], NIST [843], Flint [803], Mpmath [577].
This function is defined only for \(-1 \le x \le 1\).
>>> from xlcalcnet import dec, mpm, ipm, fpm, gmp, apm >>> mpm.dps = 40; q = '0.007' >>> \mathrm{d}x = dec.real_erfinv(q); mx = mpm.real_erfinv(q); ix = ipm.real_erfinv(q) >>> fx = fpm.real_erfinv(q); gx = gmp.real_erfinv(q); ax = apm.real_erfinv(q) >>> mpm.show([\mathrm{d}x, mx, ix, fx, gx, ax]) dec: 6.203668061000835402417689089205287381720E-3 mpm: 6.203668061000835531560785950441696784170e-3 ipm: 6.203668061000835531560785950441696784170e-3 (7.228e-40%) fpm: 6.20366806100084E-03 gmp: 6.203668061000835315388357571464439388365E-03 apm: 6.203668061000835531560785950441696784170e-3 (7.228e-40%)
Inverse of the real complementory error function, \(\mathrm{erfc}^{-1}(x)\)#
- ctx.erfc_inv(q)#
where
ctxismath53,ctxcpp,ctxboostorctxflint.Returns the inverse of the real complementory error function, satisfying \(\mathrm{erfc}(\mathrm{erfcinv}(x)) = \mathrm{erfcinv}(\mathrm{erfc}(x)) = x\). See also BoostMath [79], Wikipedia [1337], MathWorld [923], NIST [843], Flint [803].
This function is defined only for \(-1 \le x \le 1\).
>>> from xlcalcnet import dec, mpm, ipm, fpm, gmp, apm >>> mpm.dps = 40; q = '0.007' >>> \mathrm{d}x = dec.real_erfcinv(q); mx = mpm.real_erfcinv(q); ix = ipm.real_erfcinv(q) >>> fx = fpm.real_erfcinv(q); gx = gmp.real_erfcinv(q); ax = apm.real_erfcinv(q) >>> mpm.show([gx, fx, ax]) dec: 1.906956864670945611335498085438891420125E+0 mpm: 1.906956864670945606433652487714446631717e+0 ipm: 1.906956864670945606433652487714446631717e+0 (6.02e-40%) fpm: 1.90695686467095E+00 gmp: 1.906956864670945611335498085438891420125E+00 apm: 1.906956864670945606433652487714446631717e+0 (6.02e-40%)
Standard normal density function \(\phi(x)\)#
- ctx.ndens(x)#
where
ctxismath53,ctxcpp,ctxboostorctxflint.Note: also math53.erfZ(x), math53.ndens(x), mathc53.Ndens(x)
Returns the Gaussian density function \(\displaystyle \phi(z) = \frac{1}{\sqrt {2\pi}} \exp(-z^2)\). See also: Ehrhardt [309] (3.3.12.3) and (3.9.28).
An example:
>>> from xlcalcnet import dec, mpm, ipm, fpm, gmp, apm >>> mpm.dps = 40; x = '1.2'; mu = '0'; sd = '1'; >>> \mathrm{d}x = dec.normal_pdf(x, mu, sd); mx = mpm.normal_pdf(x, mu, sd) >>> ix = ipm.normal_pdf(x, mu, sd); fx = fpm.normal_pdf(x, mu, sd) >>> gx = gmp.normal_pdf(x, mu, sd); ax = apm.normal_pdf(x, mu, sd) >>> mpm.show([\mathrm{d}x, mx, ix, fx, gx, ax]) dec: 1.941860549832129404120911390335162607571E-1 mpm: 1.941860549832129404120911390335162607571e-1 ipm: 1.941860549832129404120911390335162607571e-1 (5.173e-39%) fpm: 1.94186054983213E-01 gmp: 1.941860549832129404120911390335162607571E-01 ipm: 1.941860549832129404120911390335162607571e-1 (5.173e-39%)
Standard normal cumulative distribution function \(\Phi(x)\)#
- ctx.ndis(x)#
where
ctxismath53,ctxcpp,ctxboostorctxflint.Note: also math53.erfP(x), math53.ndis(x), mathc53.Ndis(x)
Returns the integral \(\displaystyle \Phi(z) = \frac{1}{\sqrt 2\pi} \int_{-\infty}^z \exp(-t^2)\, \mathrm{d}t = \frac{1}{2} \mathrm{erfc}\left(-\frac{z}{\sqrt{2}} \right)\).
See also BoostMath [80], Wikipedia [1337], MathWorld [917], NIST [843], MathWorld [1051], Ehrhardt [309] (3.3.12.1) and (3.9.28).
An example:
>>> from xlcalcnet import dec, mpm, ipm, fpm, gmp, apm >>> mpm.dps = 40; x = '1.2'; mu = '0'; sd = '1'; >>> \mathrm{d}x = dec.normal_cdf(x, mu, sd); mx = mpm.normal_cdf(x, mu, sd) >>> ix = ipm.normal_cdf(x, mu, sd); fx = fpm.normal_cdf(x, mu, sd) >>> gx = gmp.normal_cdf(x, mu, sd); ax = apm.normal_cdf(x, mu, sd) >>> mpm.show([\mathrm{d}x, mx, ix, fx, gx, ax]) dec: 8.849303297782917319777797930433648513245E-1 mpm: 8.849303297782917319777797930433648513246e-1 ipm: 8.849303297782917319777797930433648513245e-1 (6.486e-40%) fpm: 8.84930329778292E-01 gmp: 8.849303297782917319777797930433648513246E-01 ipm: 8.849303297782917319777797930433648513246e-1 (1.297e-39%)
Imaginary error function, \(\mathrm{erfi}(x)\)#
- ctx.erfi(x)#
where
ctxismath53,mathc53,ctxflint.Returns the imaginary error function \(\displaystyle \mathrm{erfi}(x) = \frac{2}{\sqrt \pi} \int_0^x \exp(t^2)\, \mathrm{d}t = \frac{2}{\sqrt \pi} e^{x^2} \mathrm{dawson}(x)\).
Returns the imaginary error function \(\displaystyle \mathrm{erfi}(z) = -i \mathrm{erf}(i z)\).
See also Wikipedia [1345], MathWorld [918], Ehrhardt [309] (3.3.8), Flint [803], Flint [793], Mpmath [572].
The function is defined as:
\[\text{erfi}(x) = \frac{1}{i} \text{erf}(ix).\]\(\text{erfi}(x)\) is computed using the Dawson integral as
\[\text{erfi}(x) = \frac{2}{\sqrt{\pi}} e^{x^2} \text{dawson}(x).\]An example in Python
>>> from xlcalcnet import xreal >>> xreal.Erfi(0.5) xreal('5.2359877559829887307E-1') >>> xreal.Erfi('0.51') xreal('5.3518479027559984754E-1')
An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.Erfi(0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.Erfi('0.51') Gpr('5.3518479027559984754E-1')
An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 40; x = 3.0 >>> \mathrm{d}x = dec.erfi(x); mx = mpm.erfi(x); gx = gmp.erfi(x) >>> fx = fpm.erfi(x); ax = apm.erfi(x) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax]) dec: 1.629994622601565651061647952076274162779E+3 mpm: 1.629994622601565651061647952076274162779e+3 gmp: 1.629994622601565651061647952076274162779E+03 fpm: 1.62999462260157E+03 apm: 1.629994622601565651061647952076274162779e+3 (7.212e-40%)
An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; z = '3.0 + 4.0j' >>> \mathrm{d}z = dec.erfi(z); mz = mpm.erfi(z); gz = gmp.erfi(z) >>> fz = fpm.erfi(z); az = apm.erfi(z) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: -4.9720260544966036460E-5 + 9.9991066178539168236E-1j mpm: -4.9720260544966036460e-5 + 9.9991066178539168236e-1j gmp: -4.9720260544966036460E-05 + 9.9991066178539168236E-01j fpm: -4.97202605449660E-05 + 9.99910661785392E-01j apm: -4.9720260544966036460e-5 (-1.56e-18%) + 9.9991066178539168236e-1 (4.236e-20%)j
Dawson integral, \(F(x)\)#
- math53.dawson(x)#
Returns the Dawson integral \(\displaystyle F(z) = e^{-z^2} \int_0^z e^{t^2} \mathrm{d}t = \frac{\sqrt{\pi}}{2} e^{-z^2} \mathrm{erfi}(z)\). See also Wikipedia [1446], MathWorld [1047], Ehrhardt [309] (3.3.1), NIST [457].
Dawson’s integral is defined by
\[F(x) = e^{-x^2} \int_0^x e^{-x^2} \mathrm{d}t,\]In terms of either erfi or the Faddeeva function w(z), the Dawson function can be extended to the entire complex plane:[3]
\[F(z)={{\sqrt {\pi }} \over 2}e^{-z^{2}}\mathrm {erfi} (z)={\frac {i{\sqrt {\pi }}}{2}}\left[e^{-z^{2}}-w(z)\right],\]Left figure: real part of the Dawson integral, \(F(x)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Middle figure: imaginary part of the Dawson integral, \(F(x)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Right figure: absolute value of the Dawson integral, \(F(x)\), with color-coded phase. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
An example in Python
>>> from xlcalcnet import xreal >>> xreal.Dawson(0.5) xreal('5.2359877559829887307E-1') >>> xreal.Dawson('0.51') xreal('5.3518479027559984754E-1')
An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.Dawson(0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.Dawson('0.51') Gpr('5.3518479027559984754E-1')
An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 40; x = 3.0 >>> \mathrm{d}x = dec.dawson(x); mx = mpm.dawson(x); gx = gmp.dawson(x) >>> fx = fpm.dawson(x); ax = apm.dawson(x) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax]) dec: 1.782710306105582873425994922405126302292E-1 mpm: 1.782710306105582873425994922405126302292e-1 gmp: 1.782710306105582873425994922405126302292E-01 fpm: 1.78271030610558E-01 apm: 1.782710306105582873425994922405126302293e-1 (1.409e-37%)
An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; z = '3.0 + 4.0j' >>> \mathrm{d}z = dec.dawson(z); mz = mpm.dawson(z); gz = gmp.dawson(z) >>> fz = fpm.dawson(z); az = apm.dawson(z) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: -8.8004253885450449691E+2 + 4.1216449595391869731E+2j mpm: -8.8004253885450449691e+2 + 4.1216449595391869731e+2j gmp: -8.8004253885450449691E+02 + 4.1216449595391869731E+02j fpm: -8.80042538854505E+02 + 4.12164495953919E+02j apm: -8.8004253885450449493e+2 (-4.535e-16%) + 4.1216449595391869602e+2 (4.615e-16%)j
Faddeeva function, \(w(z)\)#
- math53.faddeeva(z)#
Returns the Faddeeva function function
See also Wikipedia [1428], NIST [458].
The Faddeeva function or Kramp function is a scaled complex complementary error function,
\[w(z):=e^{-z^{2}}\operatorname {erfc} (-iz)=\operatorname {erfcx} (-iz)=e^{-z^{2}}\left(1+{\frac {2i}{\sqrt {\pi }}}\int _{0}^{z}e^{t^{2}}{\text{d}}t\right).\]It is related to the Fresnel integral, to Dawson’s integral, and to the Voigt function.
Left figure: real part of the Faddeeva function. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Middle figure: imaginary part of the Faddeeva function. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Right figure: absolute value of the Faddeeva function, with color-coded phase. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
An example in Python
>>> from xlcalcnet import XComplex >>> XComplex.Faddeeva(0.5) XComplex('5.2359877559829887307E-1') >>> XComplex.Faddeeva('0.1') XComplex('5.3518479027559984754E-1')
An example in Visual Basic
>>> from xlcalcnet import Gpc >>> Gpc.Faddeeva(0.5) Gpc('5.2359877559829887307E-1') >>> Gpc.Faddeeva('0.1') Gpc('5.3518479027559984754E-1')
An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; x = 3.0 >>> \mathrm{d}x = dec.faddeeva(x); mx = mpm.faddeeva(x); gx = gmp.faddeeva(x) >>> fx = fpm.faddeeva(x); ax = apm.faddeeva(x) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax], aligned=True) dec: 1.2340980408667954950E-4 + 2.0115731703760038666E-1j mpm: 1.2340980408667954950e-4 + 2.0115731703760038666e-1j gmp: 1.2340980408667954950E-04 + 2.0115731703760038666E-01j fpm: 1.23409804086680E-04 + 2.01157317037600E-01j apm: 1.2340980408667954950e-4 (8.378e-20%) + 2.0115731703760038666e-1 (3.158e-19%)j
An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; z = '3.0 + 4.0j' >>> \mathrm{d}z = dec.faddeeva(z); mz = mpm.faddeeva(z); gz = gmp.faddeeva(z) >>> fz = fpm.faddeeva(z); az = apm.faddeeva(z) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: 9.0933904194765342461E-2 + 6.5592330527914277737E-2j mpm: 9.0933904194765342461e-2 + 6.5592330527914277737e-2j gmp: 9.0933904194765342461E-02 + 6.5592330527914277737E-02j fpm: 9.09339041947653E-02 + 6.55923305279143E-02j apm: 9.0933904194765342460e-2 (2.911e-19%) + 6.5592330527914277737e-2 (4.035e-19%)j
Fresnel sine integral, \(S(x)\)#
- ctx.fresnel_s(z)#
where
ctxismath53,mathc53,ctxflint.Returns the Fresnel sine integral \(\displaystyle S(x) = \int_0^x \sin\left(\frac{\pi t^2}{2}\right) \, \mathrm{d}t\).
See also Wikipedia [1429], MathWorld [1055], NIST [845],, Ehrhardt [309] (3.3.14), Flint [803], Flint [793], Mpmath [686].
The complex Fresnel sine integral can be expressed using the error function as follows:
\[S(z) = \sqrt {\frac {\pi }{2}} {\frac {1+i}{4}}\left[ \operatorname{erf} \left({\frac {1+i}{\sqrt {2}}}z\right)-i \operatorname{erf} \left({\frac {1-i}{\sqrt {2}}}z\right)\right].\]Left figure: real part of the Fresnel sine integral, \(S(x)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Middle figure: imaginary part of the Fresnel sine integral, \(S(x)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Right figure: absolute value of the Fresnel sine integral, \(S(x)\), with color-coded phase. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
An example in Python
>>> from xlcalcnet import xreal >>> xreal.FresnelS(0.5) xreal('5.2359877559829887307E-1') >>> xreal.FresnelS('0.51') xreal('5.3518479027559984754E-1')
An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.FresnelS(0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.FresnelS('0.51') Gpr('5.3518479027559984754E-1')
An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 40; x = 3.0 >>> \mathrm{d}x = dec.fresnels(x); mx = mpm.fresnels(x); gx = gmp.fresnels(x) >>> fx = fpm.fresnels(x); ax = apm.fresnels(x) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax]) dec: 4.963129989673750360976122652991121038565E-1 mpm: 4.963129989673750360976122652991121038565e-1 gmp: 4.963129989673750360976122652991121038565E-01 fpm: 4.96312998967375E-01 apm: 4.963129989673750360976122652991121038565e-1 (9.252e-39%)
An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; z = '3.0 + 4.0j' >>> \mathrm{d}z = dec.fresnels(z); mz = mpm.fresnels(z); gz = gmp.fresnels(z) >>> fz = fpm.fresnels(z); az = apm.fresnels(z) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: 6.0975480744693149379E+14 + 4.5370167667746719242E+14j mpm: 6.0975480744693149379e+14 + 4.5370167667746719242e+14j gmp: 6.0975480744693149379E+14 + 4.5370167667746719242E+14j fpm: 6.09754807446932E+14 + 4.53701676677467E+14j apm: 6.0975480744693149379e+14 (7.82e-20%) + 4.5370167667746719242e+14 (5.255e-20%)j
Fresnel cosine integral, \(C(x)\)#
- ctx.fresnel_c(z)#
where
ctxismath53,mathc53,ctxflint.Returns the Fresnel cosine integral \(\displaystyle C(x) = \int_0^x \cos\left(\frac{\pi t^2}{2}\right) \, \mathrm{d}t\).
See also Wikipedia [1429], MathWorld [1054], NIST [845], Ehrhardt [309] (3.3.14), Flint [803], Flint [793], Mpmath [685].
The complex Fresnel cosine integral can be expressed using the error function as follows:
\[C(z) = \sqrt {\frac {\pi }{2}} {\frac {1-i}{4}}\left[ \operatorname{erf} \left({\frac {1+i}{\sqrt {2}}}z\right)+i \operatorname{erf} \left({\frac {1-i}{\sqrt {2}}}z\right)\right].\]Left figure: real part of the Fresnel cosine integral, \(C(x)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Middle figure: imaginary part of the Fresnel cosine integral, \(C(x)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Right figure: absolute value of the Fresnel cosine integral, \(C(x)\), with color-coded phase. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
An example in Python
>>> from xlcalcnet import xreal >>> xreal.FresnelC(0.5) xreal('5.2359877559829887307E-1') >>> xreal.FresnelC('0.51') xreal('5.3518479027559984754E-1')
An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.FresnelC(0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.FresnelC('0.51') Gpr('5.3518479027559984754E-1')
An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 40; x = 3.0 >>> \mathrm{d}x = dec.fresnelc(x); mx = mpm.fresnelc(x); gx = gmp.fresnelc(x) >>> fx = fpm.fresnelc(x); ax = apm.fresnelc(x) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax]) dec: 6.057207892976856295561610742871546971452E-1 mpm: 6.057207892976856295561610742871546971452e-1 gmp: 6.057207892976856295561610742871546971452E-01 fpm: 6.05720789297686E-01 apm: 6.057207892976856295561610742871546971452e-1 (9.476e-40%)
An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; z = '3.0 + 4.0j' >>> \mathrm{d}z = dec.fresnelc(z); mz = mpm.fresnelc(z); gz = gmp.fresnelc(z) >>> fz = fpm.fresnelc(z); az = apm.fresnelc(z) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: 4.5370167667746769242E+14 - 6.0975480744693099379E+14j mpm: 4.5370167667746769242e+14 - 6.0975480744693099379e+14j gmp: 4.5370167667746769242E+14 - 6.0975480744693099379E+14j fpm: 4.53701676677468E+14 - 6.09754807446931E+14j apm: 4.5370167667746769242e+14 (5.255e-20%) - 6.0975480744693099379e+14 (-7.82e-20%)j
Owen’s T function, \(T(h,a)\)#
- ctx.owen_t(h, a)#
where
ctxismath53orctxflint.Returns Owen’s T function \(\displaystyle T(h,a) = \frac {1}{2\pi } \int _{0}^{a} f(x) \mathrm{d}x = \frac {a}{4\pi } \int _{-1}^{1} f(ax) \mathrm{d}x, \quad f(x) = {\frac {e^{-{\frac {1}{2}}h^{2}(1+x^{2})}}{1+x^{2}}}, \quad \left(-\infty <h,a<+\infty \right)\).
See also Owen [476], and Patefield and Tand [486], Wikipedia [1460], MathWorld [1088], Ehrhardt [309] (3.3.17).
Left figure: real (“silver”) and imaginary (“gold”) part of Owen’s T function, \(T(h,a)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
An example in Python
>>> from xlcalcnet import xreal >>> xreal.OwenT(2.5, 0.5) xreal('5.2359877559829887307E-1') >>> xreal.OwenT(2.5, '0.51') xreal('5.3518479027559984754E-1')An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.OwenT(2.5, 0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.OwenT(2.5, '0.51') Gpr('5.3518479027559984754E-1')


















