誤差関数
出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2023/12/29 14:02 UTC 版)
実装
C言語の場合、C99でヘッダファイルの<math.h>
にdouble erf(double x)
およびdouble erfc(double x)
という関数が宣言されている。
{erff()
, erfcf()
}という関数ペアはfloat
型の値を扱い、{erfl()
, erfcl()
}という関数ペアはlong double
型の値を扱う。
C++でも、C++11で<cmath>
のヘッダファイルにerf
およびerfc
が宣言されている。double
、float
およびlong double
型がオーバーロードされている。
複素数を扱える誤差関数の実装は少ない。例えば、図2のようなグラフの描画は、Mathematicaを一般的な性能のコンピュータで実行した場合に数分かかる。
FORTRANでは、例えば、GFortran がERF(X)
と倍精度のDERF(X)
を提供している。
数表
x | erf(x) | erfc(x) | x | erf(x) | erfc(x) |
---|---|---|---|---|---|
0.00 | 0.00000000000000000 | 1.0000000000000000 | 1.30 | 0.93400794494065244 | 0.065992055059347563 |
0.05 | 0.056371977797016624 | 0.94362802220298338 | 1.40 | 0.95228511976264881 | 0.047714880237351189 |
0.10 | 0.11246291601828489 | 0.88753708398171511 | 1.50 | 0.96610514647531073 | 0.033894853524689273 |
0.15 | 0.16799597142736349 | 0.83200402857263651 | 1.60 | 0.97634838334464401 | 0.023651616655355992 |
0.20 | 0.22270258921047845 | 0.77729741078952155 | 1.70 | 0.98379045859077456 | 0.016209541409225436 |
0.25 | 0.27632639016823693 | 0.72367360983176307 | 1.80 | 0.98909050163573071 | 0.010909498364269286 |
0.30 | 0.32862675945912743 | 0.67137324054087257 | 1.90 | 0.99279042923525747 | 0.0072095707647425301 |
0.35 | 0.37938205356231032 | 0.62061794643768968 | 2.00 | 0.99532226501895273 | 0.0046777349810472658 |
0.40 | 0.42839235504666845 | 0.57160764495333154 | 2.10 | 0.99702053334366701 | 0.0029794666563329855 |
0.45 | 0.47548171978692368 | 0.52451828021307632 | 2.20 | 0.99813715370201811 | 0.0018628462979818914 |
0.50 | 0.52049987781304654 | 0.47950012218695346 | 2.30 | 0.99885682340264335 | 0.0011431765973566515 |
0.55 | 0.56332336632510896 | 0.43667663367489104 | 2.40 | 0.99931148610335492 | 0.00068851389664507857 |
0.60 | 0.60385609084792592 | 0.39614390915207408 | 2.50 | 0.99959304798255504 | 0.00040695201744495894 |
0.65 | 0.64202932735567184 | 0.35797067264432816 | 2.60 | 0.99976396558347065 | 0.00023603441652934920 |
0.70 | 0.67780119383741847 | 0.32219880616258153 | 2.70 | 0.99986566726005948 | 0.00013433273994052433 |
0.75 | 0.71115563365351513 | 0.28884436634648487 | 2.80 | 0.99992498680533454 | 0.000075013194665459024 |
0.80 | 0.74210096470766049 | 0.25789903529233951 | 2.90 | 0.99995890212190054 | 0.000041097878099458836 |
0.85 | 0.77066805760835253 | 0.22933194239164747 | 3.0 | 0.99997790950300141 | 0.000022090496998585441 |
0.90 | 0.79690821242283213 | 0.20309178757716787 | 3.10 | 0.99998835134263280 | 0.000011648657367199596 |
0.95 | 0.82089080727327794 | 0.17910919272672206 | 3.20 | 0.99999397423884824 | 6.0257611517620950×10−6 |
1.00 | 0.84270079294971487 | 0.15729920705028513 | 3.30 | 0.99999694229020356 | 3.0577097964381615×10−6 |
1.10 | 0.88020506957408170 | 0.11979493042591830 | 3.40 | 0.99999847800663714 | 1.5219933628622854×10−6 |
1.20 | 0.91031397822963538 | 0.089686021770364620 | 3.50 | 0.99999925690162766 | 7.4309837234141275×10−7 |
関連項目
- ^ a b W. J. Cody, "Algorithm 715: SPECFUN—A portable FORTRAN package of special function routines and test drivers," ACM Trans. Math. Soft. 19, pp. 22–32 (1993).
- '^ M. R. Zaghloul, "On the calculation of the Voigt line profile: a single proper integral with a damped sine integrand," Monthly Notices of the Royal Astronomical Society 375, pp. 1043–1048 (2007).
- ^ 項の分母はOEISにある A007680の数列である。
- ^ InverseErf functions.wolfram.com
- ^ 約分後の分子/分母の係数はOEISの A092676/A132467 と同じで、約分していない分子は A002067 となる。
- ^ [1]
- 誤差関数のページへのリンク