English 中文(简体)
动力:数学:
原标题:Algorithm of boost::math::erf

是否有用于推进机能背后的算法的细节? 该模块的文件并不准确。 我发现,几种方法好坏参半。 对我来说,它看起来像Abramowitz和Stegun的变异。

  • Which methods are mixed?
  • How are the methods mixed?
  • What is the complexity of the erf-function (constant time)?

圣地亚哥

最佳回答

http://www.boost.org/doc/libs/1_49_0/libs/math/doc/sf_and_dist/html/“rel=“nofollow”>Boost Math Toolkit有很长的模板参数,可用于控制数字准确性(因此其操作时间复杂)。

#include <boost/math/special_functions/erf.hpp>
namespace boost{ namespace math{

template <class T>
calculated-result-type erf(T z);

template <class T, class Policy>
calculated-result-type erf(T z, const Policy&);

template <class T>
calculated-result-type erfc(T z);

template <class T, class Policy>
calculated-result-type erfc(T z, const Policy&);

}} // namespaces

www.un.org/Depts/DGACM/index_spanish.htm

上面“执行”一节的逐字逐句提到机能:

<>执行>

这些职能的所有版本都首先采用通常的反思公式,使其论点具有积极性:

erf(-z) = 1 - erf(z);

erfc(-z) = 2 - erfc(z);  // preferred when -z < -0.5

erfc(-z) = 1 + erf(z);   // preferred when -0.5 <= -z < 0

这些职能的通用版本按伽马功能不完整执行。

如果承认标识面积(目前为53、64和113平方尺,加上通过晋升为两倍的单方分辨率24倍),则使用由JM设计的一系列合理近似值。

z <=0.5 ,根据er为奇功能的观察,使用合理近似法,因此,脂肪是用下列方法计算:

erf(z) = z * (C + R(z*z));

如果R(z*z)的理性近似值被选择为绝对错误:只要其绝对错误与C的固定错误相比很小,那么计算R(z*z)时发生的任何四舍五入错误就会从结果中切实消失。 因此,该区域耳夫和耳夫的错误非常低:最后一点在极少数情况下是不正确的。

z;0.5 我们注意到,在小间隔[a、b]之后:

erfc(z) * exp(z*z) * z ~ c

某些不变。

因此,对于z >0.5我们用以下方法计算出erfc:

erfc(z) = exp(-z*z) * (C + R(z - B)) / z;

R(z-B)再次被选择为绝对错误,C级不变,是平均值(z) *在幅度的末尾点计算。 只要R(z-B)的绝对错误与c相比很小,C+R(z-B)就会被正确地四舍五入,结果的错误将只取决于所花职能的准确性。 在实践中,除了极少数情况外,这一错误仅局限于最后结果范围。 选择B不变,使理性近似的左侧端为0。

以上近距离[a, +∞]的大型z改为:

erfc(z) = exp(-z*z) * (C + R(1 / z)) / z;

http://www.boost.org/doc/libs/1_49_0/libs/math/doc/sf_and_dist/html/math_toolkit/backgrounders/remez.html” rel=“nofollow”excruciating details。 如果你需要更多的细节,你可以总是看

问题回答

暂无回答




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签