# LabVIEW

cancel
Showing results for
Did you mean:

## Anyone have an inverse erf function VI?

I am looking to convert from the area under the normal (Gaussian) curve from -Z to +Z to obtain the value of Z. This is the inverse of the erf function, which is available in LabVIEW (except base package).

The only thoughts I have to solve this is either:
(1) interpolating a set of data obtained from use of the erf function, or
(2) doing a binary search / goal seek using the erf function until satisfied with the precision.
Message 1 of 9
(3,798 Views)

## Re: Anyone have an inverse erf function VI?

I scratched my head and searched the internet for a few hours. I cannot think of a better solution that the two you posted. It looks like you are forced into the classic tradeoff of time or space.

The problem is that the error function (erf) is a "Special Function" which means that its derivative cannot be expressed with more elementary functions. Thus, there is no way to find the inverse by solving for the variable. This leaves us with numerical approximation methods.
Message 2 of 9
(3,798 Views)

Message 3 of 9
(3,798 Views)

## Re: Anyone have an inverse erf function VI?

See attached for a spin-off from altenbach's contribution here:

Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
Message 4 of 9
(3,453 Views)

## Re : Re: Anyone have an inverse erf function VI?

I've found the link to the erfinv function done in Fortran (from a Matlab file) and converted it in Labview.

My own vi follows:

Message 5 of 9
(3,358 Views)

## Re : Anyone have an inverse erf function VI?

Ok, here's the optimization of my last vi.  I also added the precision increase (from Newton's correction and Halley's step).  To do the erfcinv, you just need to call the erfinv since erfcinv(x)=erfinv(1-x).
Message 6 of 9
(3,340 Views)

Hi,

Thanks

Message 7 of 9
(2,350 Views)

## Re: Re : Anyone have an inverse erf function VI?

emnajaoua wrote:

You keep posting in the wrong forum. Almost nobody here will be able to open *.gvi files.

If you also have LabVIEW, you can look inside the inverse error function (it is plain LabVIEW code!) and duplicate it to your code. Long ago I also made a version that uses Newton-Raphson to invert the error function, have a look there too. It's just math! 😄

Message 8 of 9
(2,330 Views)

## Re: Re : Anyone have an inverse erf function VI?

Hi,

I have been trying to copy the math modules from the VI that you have posted there to another VI in labview communications design but as I said before there is a problem in implementing the "erf" function in the C node.I didn't resolve it so far.

Here you can find the VI and the GVI that I want to make.

I really need help!

Message 9 of 9
(2,304 Views)