Repository: scipy/scipy
File: scipy/special/xsf_wrappers.cpp (C++)

Code before:

double xsf_bdtri(double k, int n, double y) { return xsf::bdtri(k, n, y); }

double xsf_bdtrc(double k, int n, double p) { return xsf::bdtrc(k, n, p); }

double xsf_chdtr(double df, double x) { return xsf::chdtr(df, x); }

double xsf_chdtrc(double df, double x) { return xsf::chdtrc(df, x); }

double xsf_chdtri(double df, double y) { return xsf::chdtri(df, y); }

double xsf_gdtr(double a, double b, double x) { return xsf::gdtr(a, b, x); }

double xsf_gdtrc(double a, double b, double x) { return xsf::gdtrc(a, b, x); }

double special_gdtria(double p, double b, double x) { 
    if (x == 0) {
        return std::numeric_limits<double>::quiet_NaN();
    }
    if ((b == 0) & (p == 0)) {
        if (std::isinf(x) && (x > 0)) {
            return std::numeric_limits<double>::quiet_NaN();
        }
        return 0.0;
    }
    return xsf::gammaincinv(b, p) / x; }

double special_gdtrix(double a, double b, double p) { 
    if ((a == 0) && (b == 0)) {
            return std::numeric_limits<double>::quiet_NaN();
    }
    // if a or b is positive infinite, return NaN
    if ((std::isinf(a) || std::isinf(b)) && (a >= 0 && b >= 0)) {
        return std::numeric_limits<double>::quiet_NaN();
    }
    return xsf::gammaincinv(b, p) / a; }

double xsf_gdtrib(double a, double p, double x) { return xsf::gdtrib(a, p, x); }

double xsf_kolmogorov(double x) { return xsf::kolmogorov(x); }

double xsf_kolmogc(double x) { return xsf::kolmogc(x); }

double xsf_kolmogi(double x) { return xsf::kolmogi(x); }

double xsf_kolmogci(double x) { return xsf::kolmogci(x); }

double xsf_kolmogp(double x) { return xsf::kolmogp(x); }

double xsf_nbdtr(int k, int n, double p) { return xsf::nbdtr(k, n, p); }


Review comment (suggestion):
Style nit, since this is a multi-line function body:
```suggestion
    return xsf::gammaincinv(b, p) / x;
}
```

Code after:

double xsf_bdtri(double k, int n, double y) { return xsf::bdtri(k, n, y); }

double xsf_bdtrc(double k, int n, double p) { return xsf::bdtrc(k, n, p); }

double xsf_chdtr(double df, double x) { return xsf::chdtr(df, x); }

double xsf_chdtrc(double df, double x) { return xsf::chdtrc(df, x); }

double xsf_chdtri(double df, double y) { return xsf::chdtri(df, y); }

double xsf_gdtr(double a, double b, double x) { return xsf::gdtr(a, b, x); }

double xsf_gdtrc(double a, double b, double x) { return xsf::gdtrc(a, b, x); }

double special_gdtria(double p, double b, double x) { 
    if (x == 0) {
        return std::numeric_limits<double>::quiet_NaN();
    }
    if ((b == 0) & (p == 0)) {
        if (std::isinf(x) && (x > 0)) {
            return std::numeric_limits<double>::quiet_NaN();
        }
        return 0.0;
    }
    return xsf::gammaincinv(b, p) / x;
}

double special_gdtrix(double a, double b, double p) { 
    if ((a == 0) && (b == 0)) {
        return std::numeric_limits<double>::quiet_NaN();
    }
    // if a or b is positive infinite, return NaN
    if ((std::isinf(a) || std::isinf(b)) && (a >= 0 && b >= 0)) {
        return std::numeric_limits<double>::quiet_NaN();
    }
    return xsf::gammaincinv(b, p) / a;
}

double xsf_gdtrib(double a, double p, double x) { return xsf::gdtrib(a, p, x); }

double xsf_kolmogorov(double x) { return xsf::kolmogorov(x); }

double xsf_kolmogc(double x) { return xsf::kolmogc(x); }

double xsf_kolmogi(double x) { return xsf::kolmogi(x); }

double xsf_kolmogci(double x) { return xsf::kolmogci(x); }

double xsf_kolmogp(double x) { return xsf::kolmogp(x); }