⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vnl_erf.h

📁 DTMK软件开发包,此为开源软件,是一款很好的医学图像开发资源.
💻 H
字号:
// This is core/vnl/vnl_erf.h
#ifndef vnl_erf_h_
#define vnl_erf_h_
//:
// \file
// \brief Error Function (erf) approximations
// \author Tim Cootes, Ian Scott

#include <vnl/vnl_gamma.h>
#include <vnl/vnl_math.h>

//: The Error function.
// erf(x) = (2/sqrt(pi)) Integral from 0 to x (exp(-t^2) dt)
// \note the output ranges from -1 to 1, and vnl_erf(0) = 0.
inline double vnl_erf(double x)
{ return (x<0)?-vnl_gamma_p(0.5,x*x):vnl_gamma_p(0.5,x*x); };

//: The Complementary Error function.
// erfc(x) = 1 - erf(x) = 1 - (2/sqrt(pi)) Integral from 0 to x (exp(-t^2) dt)
// This value is useful for large x, when erf(x) ~= 1 and erfc(x) < eps.
// \note the output ranges from 0 to 2, and vnl_erfc(0) = 1.
double vnl_erfc(double x);

//: The Scaled Complementary Error function.
// erfc_scaled(x) = exp(x^2) * erfc(x)
// This value is useful for very large x, where erf and erfc returns
// respectively ~1 and ~0.
// It can be approximated by (1/sqrt(pi)) * (1/x)
inline double vnl_scaled_erfc(double x)
{ return (vnl_math::two_over_sqrtpi/2.)*(1./x); }

#endif // vnl_erf_h_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -