Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
58 Views

gamma function?

I've been going in circles on this one (I'm probably orbiting a very simple answer).  Is there a gamma function (for non-integers) in version 11.0?  There are some indications from my searching that it exists in the libimf library but I thought that this was linked by default.  I tried forcing this through "-L -limf" and didn't find "gamma" or "tgamma".  I also tried MKL but I'm not finding it there either.  Thanks!

0 Kudos
4 Replies
Highlighted
Black Belt
58 Views

I believe that some the Intel RT libraries (such as libmmd.lib) contain a gamma function callable from C. I can only see lower-case names containing 'gamma' in the symbols in, for example, libmmd.lib.  I believe that that function gives ln Γ(x), rather than Γ(x).

Fortran 2008 provides the gamma function, but your 11.1 compiler probably does not.

However, the old Amos library at http://www.netlib.org/amos/ should serve you fine for now.

0 Kudos
Highlighted
New Contributor III
58 Views

Hi Adam,

You could obtain a gamma function subroutine source file that you could include in your project from the NIST Guide to Available Mathematical Software (GAMS): http://gams.nist.gov/

At that site you can use the name search for "gamma" to find several possible routines that might be useful.

Regards,
Greg T.

0 Kudos
Highlighted
Employee
58 Views

I believe the Intel Fortran Compiler version 12.0 introduced the Fortran 2008 intrinsics GAMMA() and LOG_GAMMA()   (along with various others, such as Bessel functions,  error functions and a bunch of other Fortran 2008 features.). The library containing them, libimf, is linked automatically.

The version 11 compiler is simply too old to have all these features from Fortran 2008. Are you able to upgrade? (Current compiler version is 17.0).

0 Kudos
Highlighted
Beginner
58 Views

Thanks, everyone!  The source code that Greg T. suggested is tempting since I don't have to go through the hassle of upgrading the compiler.  However, an upgrade is probably the best solution at this point since I'm many versions behind.  

0 Kudos