4

are you aware of a trusted (i.e. efficient and accurate) implementation of special math functions (like gamma, beta, error and inverse error functions) for the C language available with a non-gpl license? BSD or MIT licenses are fine.

So something like: http://www.gnu.org/software/gsl/manual/html_node/Special-Functions.html

but with a more permissive license. I am aware boost have something similar but it's a bit overkill to add dependency on boost just for this... Moreover C would be preferable in this context...

Thanks!

StephQ
  • 2,032
  • 3
  • 19
  • 27

3 Answers3

2

The answers to the questions below contain links to some excellent libraries, including fdlibm and cephes:

Community
  • 1
  • 1
lhf
  • 70,581
  • 9
  • 108
  • 149
  • I don't see evidence of special functions in those links. – David Heffernan May 25 '11 at 23:11
  • 1
    @David, Cephes has all those mentioned, except the inverse error function. See for instance http://www.netlib.org/cephes/doubldoc.html. fdlibm has gamma and erf. See http://www.netlib.org/fdlibm/ – lhf May 25 '11 at 23:52
  • Can the Cephes library be included in a BSD project? – StephQ May 26 '11 at 16:19
  • http://www.netlib.no/netlib/research/boilerplate has the default terms for netlib; it dates from the university research free sharing days before fussy licensing like GPL. – Pete Kirkham Jun 04 '11 at 10:10
  • The license of cephes is not clear. The readme states *"Some software in this archive may be from the book _Methods and Programs for Mathematical Functions_ (Prentice-Hall, 1989) or from the Cephes Mathematical Library, a commercial product. In either event, it is copyrighted by the author. What you see here may be used freely but it comes with no support or guarantee."*. But see also https://lists.debian.org/debian-legal/2004/12/msg00295.html –  Aug 09 '19 at 09:09
0

C99 stdlib has the functions you mentioned, there's no need to go with an external library: http://en.cppreference.com/w/c/numeric/math

Just look for a cstdlib implementation that suits your licensing needs. glibc is released under LGPL btw (not the same as GPL)!

eadmaster
  • 1,347
  • 13
  • 23
0

ATLAS has C bindings. http://math-atlas.sourceforge.net/ ATLAS has a BSD style license. http://math-atlas.sourceforge.net/faq.html#license

totowtwo
  • 2,101
  • 1
  • 14
  • 21
  • 1
    Yes, but atlas is for vector/matrix computations, while I am looking specifically for gamma, beta, error and inverse error (plus eventually log of them), bessel ecc. ecc. functions (from double to to double). – StephQ May 25 '11 at 22:31
  • atlas is a blas which, whilst useful, is not the subject of this question – David Heffernan May 25 '11 at 22:32