erf, erff, erfl, erfc, erfcf, erfcl

値の誤差関数または相補誤差関数を計算します。

構文

double erf(
   double x
);
float erf(
   float x
); // C++ only
long double erf(
   long double x
); // C++ only
float erff(
   float x
);
long double erfl(
   long double x
);
double erfc(
   double x
);
float erfc(
   float x
); // C++ only
long double erfc(
   long double x
); // C++ only
float erfcf(
   float x
);
long double erfcl(
   long double x
);
#define erf(X) // Requires C11 or higher
#define erfc(X) // Requires C11 or higher

パラメーター

x
浮動小数点値。

戻り値

erf 関数は、x のガウスの誤差関数を返します。 erfc 関数は、x のガウスの相補誤差関数を返します。

解説

関数は erf 、次のように定義されているガウス誤差関数 xを計算します。

The error function of x equals two over the square root of pi times the integral from zero to x of e to the minus t squared d t.

ガウスの相補誤差関数は、1 – erf(x) と定義されています。 erf 関数は、-1.0 ~ 1.0 の範囲の値を返します。 エラーの戻り値はありません。 erfc 関数は、0 ~ 2 の範囲の値を返します。 xerfc に対して大きすぎる場合、errno 変数は ERANGE に設定されます。

C++ ではオーバーロードが可能であるため、受け取って返floatすオーバーロードとlong doubleerfc型を呼び出erfすことができます。 C プログラムでは、tgmath.h マクロを<使用してこの関数を呼び出し、erfcerf常に double.>

<tgmath.h>erf() マクロを使用する場合は、引数の型によって、この関数のどのバージョンが選択されるかが決定されます。 詳細については、「ジェネリック型数値演算」を参照してください。

既定では、この関数のグローバル状態の適用対象は、アプリケーションになります。 この動作を変更するには、「CRT のグローバル状態」を参照してください

必要条件

機能 必須ヘッダー
erf, erff, erfl, erfc, erfcf, erfcl <math.h>
erf マクロ <tgmath.h>

互換性の詳細については、「 Compatibility」を参照してください。

関連項目

数学と浮動小数点のサポート