# Math::erfinv inverse error function

**URL:** <https://www.ruby-forum.com/t/math-erfinv-inverse-error-function/140442>\
**Category:** Ruby\
**Created:** [June 14, 2008, 3:05am UTC](https://www.ruby-forum.com/t/math-erfinv-inverse-error-function/140442 "2008-06-14T03:05:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bil\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@Bil\_K](https://www.ruby-forum.com/u/Bil_K)\
**Post date:** [June 14, 2008, 3:05am UTC](https://www.ruby-forum.com/t/math-erfinv-inverse-error-function/140442/1 "2008-06-14T03:05:31Z")

</div>

Hi,

Does anyone know where to find a Ruby /inverse/ error function?^1

## Thanks,

Bil kleb

> **[FUN3D Manual](https://fun3d.larc.nasa.gov/)**
>
> FUN3D suite of CFD simulation and design tools

[1] See for example [Error function - Wikipedia](http://en.wikipedia.org/wiki/Error_function)

---

<div class="post-metadata">

**Author:** ![Bil\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@Bil\_K](https://www.ruby-forum.com/u/Bil_K)\
**Post date:** [June 14, 2008, 12:10pm UTC](https://www.ruby-forum.com/t/math-erfinv-inverse-error-function/140442/2 "2008-06-14T12:10:42Z")

</div>

-------- Original-Nachricht --------

> Datum: Sat, 14 Jun 2008 10:04:25 +0900  
> Von: Bil K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> An: removed\_email\_address@domain.invalid  
> Betreff: Math::erfinv inverse error function

> Hi,
> 
> Does anyone know where to find a Ruby /inverse/ error function?^1
> 
> ## Thanks,
> 
> Bil kleb  
> [http://fun3d.larc.nasa.gov](http://fun3d.larc.nasa.gov)
> 
> [1] See for example [Error function - Wikipedia](http://en.wikipedia.org/wiki/Error_function)

Dear Bill,

you can use Shin-ichiro Hara’s statistics2 package

[http://raa.ruby-lang.org/project/statistics2/](http://raa.ruby-lang.org/project/statistics2/) .

It has functions for calculating the integral of the Normal Function and  
its inverse, and then there  
is the following relation from the Wikipedia article you cited:

> > The inverse of \Phi, is known as the normal quantile function, or probit function and may be \>\>expressed in terms of the inverse error function as

> > \operatorname{probit}(p) = \Phi^{-1}(p) = \sqrt{2},\operatorname{erf}^{-1}(2p-1) = -\sqrt{2},\operatorname{erfc}^{-1}(2p).

Another option would be to use the rsruby interface to the R statistical  
language.

[http://rubyforge.org/projects/rsruby/](http://rubyforge.org/projects/rsruby/)  
[http://www.r-project.org/](http://www.r-project.org/)

Best regards,

Axel

---

<div class="post-metadata">

**Author:** ![Bil\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@Bil\_K](https://www.ruby-forum.com/u/Bil_K)\
**Post date:** [June 14, 2008, 11:02pm UTC](https://www.ruby-forum.com/t/math-erfinv-inverse-error-function/140442/3 "2008-06-14T23:02:06Z")

</div>

Axel E. wrote:

> you can use Shin-ichiro Hara’s statistics2 package
> 
> [http://raa.ruby-lang.org/project/statistics2/](http://raa.ruby-lang.org/project/statistics2/) .

Excellent; thanks.

> Another option would be to use the rsruby interface to the R statistical language.

Unfortunately, I’ve never managed to get R installed on  
my OS X box. I haven’t honestly tried harder than sudo  
port install.

Thanks again,
