- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Fortran Math library has ERF for the error function, but I have not been able to find the Inverse.
Its a statistical function based upon the Gaussian Normal distribution.
Strangely enough, it does exist for VECTOR ELEMENTS, but I don't see why they would not
include it for regular usage. Every other math library on other processors has this function.
If it is in the library, searching for it produces no results.
How do we use vector elements - what are they referring to?
(in case I get desperate)
'
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The IMSL package add-on has ERFI, but I don't think it is a part of standard Intel Fortran. Can you expand on 'it does exist for VECTOR ELEMENTS'?
Patrick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As explained by John Reid in his 2014 report, "The New Features of Fortran 2008", the following 3 new intrinsic functions have been added to the Fortran 2008 standard and I think these are available in the latest Intel Fortran compiler version:
What exactly is the inverse error function? Is it the same as the complementary error function (erfc(x)) explained above?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FortranFan: if y = erf(x), x = inverf(y); if y = erfc(x), x = inverfc(y), as is usual in mathematics
William S.: there is nothing that keeps you from calling the VML/VSL functions with a vector argument containing a single component. For example:
program xinverf implicit none include 'mkl_vml.f90' integer,parameter :: n=1 integer*8 mode real a(1),v(1) a(1) = 0.4 call vserfcinv(n, a, v) write(*,*)v(1) end program xinverf
With this program we get
S:\MKL> ifort /Qmkl xerfinv.f90 S:\MKL> xerfinv 0.5951161
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
mecej4 wrote:
.. if y = erf(x), x = inverf(y); if y = erfc(x), x = inverfc(y), as is usual in mathematics
..
Thanks mecej4.
Then another question - perhaps for Steve or other folks more familiar with the Fortran standards development and/or those who are more mathematically inclined:
If the Fortran standard now includes the error function (erf(x)), any idea why the inverse isn't?
Is it mathematically too complicated (it's been a while, too lazy to run now to our library to consult the math handbooks), or the methods approximate or involve more intricate details, or constrained by some technical artifact (e.g., valid only in certain domains), or some proprietary issues with the solvers that the standard body would decide to punt on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Its pretty awkward to have to make the Inputs vectors.
I don't see any useful purpose in that, unless it has to do with
optimization of the results. After all, one can get the same answers by using a DO LOOP.
And why they did that for the Error function and its complement, and not for their inverses,
which are used just as often, is a mystery. As any statistician will tell you - just ask ! ! !
for example you would use the inverse when you know the probability of an outcome,
and you want to know its Z value (no of standard deviations away from the mean) corresponding
to that. It's used all the time.
That would be like having a SINE function but no ARCSINE, or a TAN function, but no ARC Tangent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That thing that mecej4 sent me doesn't work either.
says its can't find the function. None of them in fact.
I did put in the INCLUDE statement they recommended.
so those statitistical functions, if they are in the MKL libary,
are unusable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I suppose those who say calling MKL is too difficult aren't likely to use it, but C source code (with poor documentation) for erfinv (apparently just a bit more than single precision) is presented at
http://libit.sourceforge.net/math_8c-source.html
which could be trivially translated to Fortran or called via bind(c).
I'm struggling to understand whether the VS2012/2013 implementation is for Nvidia accelerator only.
An article on how it was implemented for Nvidia:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did "kluge" up an inverse error function, for those that are interested.
Any statistical application would have to have it...........
It uses the existing ERF in the Fortran library and a set of linear approximations
to iterate on the answer. Just like you could use the Newton_Raphson technique to
get an ARC Tangent if you didn't already have one.
The C++ library routine it appears uses a set of polynomials, so that might be faster.
But you may not get the full REAL*8 accuracy. It does have D.P variables though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to select the "Use Intel Math Kernel Library" option under Fortran > Libraries.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page