Skip to content

add more mathematical functions to the standard library #17007

Closed
@vks

Description

@vks

The following special functions are essential for basic statistics. See [1] for an argumentation why they should be included in any standard library. They are implemented in the Cephes library [2]:

/* Regularized incomplete beta function */
double incbet(double a, double b, double x);

/* Inverse of incomplete beta integral */
double incbi(double a, double b, double y);

/* Regularized incomplete gamma integral */
double igam(double a, double x);

/* Complemented incomplete gamma integral */
double igamc(double a, double x);

/* Inverse of complemented incomplete gamma integral */
double igami(double a, double p);

/* Normal distribution function */
double ndtr(double x);

/* Inverse of Normal distribution function */
double ndtri(double y);

/* Bessel function of non-integer order */
double jv(double v, double x);

We could just link against Cephes, the library is very stable and changes only every few years. The license is not specified in the distribution or on the website, however the author of the library has agreed to distribute Cephes using the BSD license in the past. [3]

(For more special functions that could be implemented see [4], however that might be to extensive.)

[1] http://www.evanmiller.org/statistical-shortcomings-in-standard-math-libraries.html
[2] http://www.moshier.net/#Cephes
[3] https://lists.debian.org/debian-legal/2004/12/msg00295.html
[4] http://open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1422.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions