언제나휴일 2016. 5. 10. 17:31
반응형

erfc, erfcf, erfcl


헤더 파일

[언어 자료구조 알고리즘/C11 표준 라이브러리 함수] - math.h


double erfc(double x); 여오차함수 (1 - erf(x))

float erfcf(float x); 여오차함수 (1 - erf(x))

long double erfcl(long double x); 여오차함수 (1 - erf(x))

 

입력 매개 변수 리스트

x 실수

반환 값

1 - erf(x)

 

여오차함수는 1 - erf(x)입니다. 다음은 오차함수의 수식입니다.

사용 예

//C언어 표준 라이브러리 함수 가이드

//double erfc(double x); 여오차함수 (1 - erf(x))

//float erfcf(float x); 여오차함수 (1 - erf(x))

//long double erfcl(long double x); 여오차함수 (1 - erf(x))

 

#include <math.h>

#include <stdio.h>

int main(void)

{

    double value;

    for (value = 0.0; value < 1.5; value += 0.2)

    {

        printf("erfc(%f) = %f \n", value, erfc(value));

        printf("erf(%f) = %f\n", value, erf(value));

        printf("erf(%f)+erfc(%f) = %f\n", value,value, erf(value)+erfc(value));

    }

    return 0;

}

 

출력

erfc(0.000000) = 1.000000

erf(0.000000) = 0.000000

erf(0.000000)+erfc(0.000000) = 1.000000

erfc(0.200000) = 0.777297

erf(0.200000) = 0.222703

erf(0.200000)+erfc(0.200000) = 1.000000

erfc(0.400000) = 0.571608

erf(0.400000) = 0.428392

erf(0.400000)+erfc(0.400000) = 1.000000

erfc(0.600000) = 0.396144

erf(0.600000) = 0.603856

erf(0.600000)+erfc(0.600000) = 1.000000

erfc(0.800000) = 0.257899

erf(0.800000) = 0.742101

erf(0.800000)+erfc(0.800000) = 1.000000

erfc(1.000000) = 0.157299

erf(1.000000) = 0.842701

erf(1.000000)+erfc(1.000000) = 1.000000

erfc(1.200000) = 0.089686

erf(1.200000) = 0.910314

erf(1.200000)+erfc(1.200000) = 1.000000

erfc(1.400000) = 0.047715

erf(1.400000) = 0.952285

erf(1.400000)+erfc(1.400000) = 1.000000



사용한 함수

[언어 자료구조 알고리즘/C11 표준 라이브러리 함수] - erf, erff, erfl

[언어 자료구조 알고리즘/C11 표준 라이브러리 함수] - printf

반응형