Coder Social home page Coder Social logo

errorfunctionapproximation's Introduction

ErrorFunctionApproximation

Download DLL
Download Nuget

Definition

The error function (erf) is defined by the following equation:

erf

The complementary error function (erfc) is defined by the following equation:

erfc

Convergence Equation

To obtain these numerical solutions, use the following equations:

Taylor series:

taylor series

Continued fraction expansion:

continued fraction expansion

Taylor series

First, Taylor series convergence becomes slow as the absolute value of z increases.

The absolute value of each term is as follows:

Taylor series term

The behavior for each z:

Taylor series convergence

The ratio to the next term is less than 1:

Taylor scale

Taylor scale value

The number of terms required to obtain arbitrary precision is as follows:
In addition, in order to obtain the expected value, 128-bit expansion was performed to absorb cancellation.

erf convergence zwise

erf convergence bitwise

Continued fraction expansion

Next, in Continued fraction expansion, when the absolute value of z is small, the convergence becomes slow.

Replace continued fractions:

frac f1

The recursive part can be written below:

frac e2

frac e4

The fixed points at n = 1 are:

frac x2

frac x4

These approximate the true values:

frac x

frac x valuefrac x error

Solve the continued fraction F1 (z) backward with X4 (z) as the initial value.
Let N be the recursion times (Fn+4(z) to Fn(z)), and N until convergence is as follows:

erfc convergence zwise

erfc convergence bitwise

Double Precision (IEEE 754) Approx

The calculation error is at most 2 epsilons.
C# code

erf result
erf result
erfc result
erfc result
inverse erf result
inverse erf result
inverse erfc result
inverse erfc result

The following is used to approximate the error of machine epsilon in the entire domain.

near zero:
erf approx nearzero

greater than 1/2:
erfc approx az

erfc az

erfc az diff

pade definition

pade erf precision16
pade erf precision32
pade erfc precision16
pade erfc precision32

Inverse Function

InverseErfc NearZero

inverse erfc nearzero

pade inverfc precision16
pade inverfc precision32

InverseErf NearZero

series inverf e20
series inverf e40
series inverf e80

errorfunctionapproximation's People

Contributors

tk-yoshimura avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.