ronantakizawa/codereview-bench huggingface dataset:
Repository: scipy/scipy
File: scipy/special/boost_special_functions.h (C/C++)

Code before:
nct_pdf_float(float x, float v, float l)
{
    return nct_pdf_wrap(x, v, l);
}

double
nct_pdf_double(double x, double v, double l)
{
    return nct_pdf_wrap(x, v, l);
}

template<typename Real>
Real
nct_ppf_wrap(const Real v, const Real l, const Real x)
{
    if (std::isnan(x) || std::isnan(v) || std::isnan(l)) {
        return NAN;
    }
    if (v <= 0 || x < 0 || x > 1) {
        sf_error("nctdtrit", SF_ERROR_DOMAIN, NULL);
        return NAN;
    }
    Real y;
    try {
    y = boost::math::quantile(
        boost::math::non_central_t_distribution<Real, SpecialPolicy>(v, l), x);
    }
    catch (const std::domain_error& e) {
        sf_error("nctdtrit", SF_ERROR_DOMAIN, NULL);
        y = NAN;
    } catch (const std::overflow_error& e) {
        sf_error("nctdtrit", SF_ERROR_OVERFLOW, NULL);
        y = INFINITY;
    } catch (const std::underflow_error& e) {
        sf_error("nctdtrit", SF_ERROR_UNDERFLOW, NULL);
        y = 0; 
    } catch (...) {
	/* Boost was unable to produce a result. */
        sf_error("nctdtrit", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
nct_ppf_float(float v, float l, float x)
{
    return nct_ppf_wrap(v, l, x);
}

double

Review comment (suggestion):
```suggestion
        y = boost::math::quantile(
            boost::math::non_central_t_distribution<Real, SpecialPolicy>(v, l), x);
```

Code after:
nct_pdf_float(float x, float v, float l)
{
    return nct_pdf_wrap(x, v, l);
}

double
nct_pdf_double(double x, double v, double l)
{
    return nct_pdf_wrap(x, v, l);
}

template<typename Real>
Real
nct_ppf_wrap(const Real v, const Real l, const Real x)
{
    if (std::isnan(x) || std::isnan(v) || std::isnan(l)) {
        return NAN;
    }
    if (v <= 0 || x < 0 || x > 1) {
        sf_error("nctdtrit", SF_ERROR_DOMAIN, NULL);
        return NAN;
    }
    Real y;
    try {
        y = boost::math::quantile(
            boost::math::non_central_t_distribution<Real, SpecialPolicy>(v, l), x);
    }
    catch (const std::domain_error& e) {
        sf_error("nctdtrit", SF_ERROR_DOMAIN, NULL);
        y = NAN;
    } catch (const std::overflow_error& e) {
        sf_error("nctdtrit", SF_ERROR_OVERFLOW, NULL);
        y = INFINITY;
    } catch (const std::underflow_error& e) {
        sf_error("nctdtrit", SF_ERROR_UNDERFLOW, NULL);
        y = 0; 
    } catch (...) {
	/* Boost was unable to produce a result. */
        sf_error("nctdtrit", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
nct_ppf_float(float v, float l, float x)
{
    return nct_ppf_wrap(v, l, x);
}

double
Repository: scipy/scipy
File: scipy/special/boost_special_functions.h (C/C++)

Code before:
}

float
nct_kurtosis_excess_float(float v, float l)
{
    RETURN_NAN(v, 4.0);
    return boost::math::kurtosis_excess(boost::math::non_central_t_distribution<float, StatsPolicy>(v, l));
}

double
nct_kurtosis_excess_double(double v, double l)
{
    RETURN_NAN(v, 4.0);
    return boost::math::kurtosis_excess(boost::math::non_central_t_distribution<double, StatsPolicy>(v, l));
}

template<typename Real>
Real
t_cdf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
    return NAN;
    }
    if (v <= 0) {
    sf_error("stdtr", SF_ERROR_DOMAIN, NULL);
    return NAN;
    }
    if (std::isinf(x)) {
    return  (x > 0) ? 1.0 : 0.0;
    }
    Real y;
    try {
    y = boost::math::cdf(
                boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    } catch (...) {
    /* Boost was unable to produce a result. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    if ((y < 0) || (y > 1)) {
    /* Result must be between 0 and 1 to be a valid CDF value.
       Return NAN if the result is out of bounds because the answer cannot be trusted. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_cdf_float(float v, float x)
{

Review comment (suggestion):
```suggestion
        sf_error("stdtr", SF_ERROR_DOMAIN, NULL);
        return NAN;
```

Code after:
}

float
nct_kurtosis_excess_float(float v, float l)
{
    RETURN_NAN(v, 4.0);
    return boost::math::kurtosis_excess(boost::math::non_central_t_distribution<float, StatsPolicy>(v, l));
}

double
nct_kurtosis_excess_double(double v, double l)
{
    RETURN_NAN(v, 4.0);
    return boost::math::kurtosis_excess(boost::math::non_central_t_distribution<double, StatsPolicy>(v, l));
}

template<typename Real>
Real
t_cdf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
        return NAN;
    }
    if (v <= 0) {
        sf_error("stdtr", SF_ERROR_DOMAIN, NULL);
        return NAN;
    }
    if (std::isinf(x)) {
        return  (x > 0) ? 1.0 : 0.0;
    }
    Real y;
    try {
        y = boost::math::cdf(
                boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    } catch (...) {
        /* Boost was unable to produce a result. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    if ((y < 0) || (y > 1)) {
        /* Result must be between 0 and 1 to be a valid CDF value.
           Return NAN if the result is out of bounds because the answer cannot be trusted. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_cdf_float(float v, float x)
{
Repository: scipy/scipy
File: scipy/special/boost_special_functions.h (C/C++)

Code before:
nct_kurtosis_excess_float(float v, float l)
{
    RETURN_NAN(v, 4.0);
    return boost::math::kurtosis_excess(boost::math::non_central_t_distribution<float, StatsPolicy>(v, l));
}

double
nct_kurtosis_excess_double(double v, double l)
{
    RETURN_NAN(v, 4.0);
    return boost::math::kurtosis_excess(boost::math::non_central_t_distribution<double, StatsPolicy>(v, l));
}

template<typename Real>
Real
t_cdf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
    return NAN;
    }
    if (v <= 0) {
    sf_error("stdtr", SF_ERROR_DOMAIN, NULL);
    return NAN;
    }
    if (std::isinf(x)) {
    return  (x > 0) ? 1.0 : 0.0;
    }
    Real y;
    try {
    y = boost::math::cdf(
                boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    } catch (...) {
    /* Boost was unable to produce a result. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    if ((y < 0) || (y > 1)) {
    /* Result must be between 0 and 1 to be a valid CDF value.
       Return NAN if the result is out of bounds because the answer cannot be trusted. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_cdf_float(float v, float x)
{
    return t_cdf_wrap(v, x);
}


Review comment (suggestion):
```suggestion
        return  (x > 0) ? 1.0 : 0.0;
```

Code after:
nct_kurtosis_excess_float(float v, float l)
{
    RETURN_NAN(v, 4.0);
    return boost::math::kurtosis_excess(boost::math::non_central_t_distribution<float, StatsPolicy>(v, l));
}

double
nct_kurtosis_excess_double(double v, double l)
{
    RETURN_NAN(v, 4.0);
    return boost::math::kurtosis_excess(boost::math::non_central_t_distribution<double, StatsPolicy>(v, l));
}

template<typename Real>
Real
t_cdf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
        return NAN;
    }
    if (v <= 0) {
        sf_error("stdtr", SF_ERROR_DOMAIN, NULL);
        return NAN;
    }
    if (std::isinf(x)) {
        return  (x > 0) ? 1.0 : 0.0;
    }
    Real y;
    try {
        y = boost::math::cdf(
                boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    } catch (...) {
        /* Boost was unable to produce a result. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    if ((y < 0) || (y > 1)) {
        /* Result must be between 0 and 1 to be a valid CDF value.
           Return NAN if the result is out of bounds because the answer cannot be trusted. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_cdf_float(float v, float x)
{
    return t_cdf_wrap(v, x);
}
Repository: scipy/scipy
File: scipy/special/boost_special_functions.h (C/C++)

Code before:

double
nct_kurtosis_excess_double(double v, double l)
{
    RETURN_NAN(v, 4.0);
    return boost::math::kurtosis_excess(boost::math::non_central_t_distribution<double, StatsPolicy>(v, l));
}

template<typename Real>
Real
t_cdf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
    return NAN;
    }
    if (v <= 0) {
    sf_error("stdtr", SF_ERROR_DOMAIN, NULL);
    return NAN;
    }
    if (std::isinf(x)) {
    return  (x > 0) ? 1.0 : 0.0;
    }
    Real y;
    try {
    y = boost::math::cdf(
                boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    } catch (...) {
    /* Boost was unable to produce a result. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    if ((y < 0) || (y > 1)) {
    /* Result must be between 0 and 1 to be a valid CDF value.
       Return NAN if the result is out of bounds because the answer cannot be trusted. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_cdf_float(float v, float x)
{
    return t_cdf_wrap(v, x);
}

double
t_cdf_double(double v, double x)
{
    return t_cdf_wrap(v, x);
}

Review comment (suggestion):
```suggestion
        y = boost::math::cdf(
                boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
```

Code after:

double
nct_kurtosis_excess_double(double v, double l)
{
    RETURN_NAN(v, 4.0);
    return boost::math::kurtosis_excess(boost::math::non_central_t_distribution<double, StatsPolicy>(v, l));
}

template<typename Real>
Real
t_cdf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
        return NAN;
    }
    if (v <= 0) {
        sf_error("stdtr", SF_ERROR_DOMAIN, NULL);
        return NAN;
    }
    if (std::isinf(x)) {
        return  (x > 0) ? 1.0 : 0.0;
    }
    Real y;
    try {
        y = boost::math::cdf(
                boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    } catch (...) {
        /* Boost was unable to produce a result. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    if ((y < 0) || (y > 1)) {
        /* Result must be between 0 and 1 to be a valid CDF value.
           Return NAN if the result is out of bounds because the answer cannot be trusted. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_cdf_float(float v, float x)
{
    return t_cdf_wrap(v, x);
}

double
t_cdf_double(double v, double x)
{
    return t_cdf_wrap(v, x);
}
Repository: scipy/scipy
File: scipy/special/boost_special_functions.h (C/C++)

Code before:
nct_kurtosis_excess_double(double v, double l)
{
    RETURN_NAN(v, 4.0);
    return boost::math::kurtosis_excess(boost::math::non_central_t_distribution<double, StatsPolicy>(v, l));
}

template<typename Real>
Real
t_cdf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
    return NAN;
    }
    if (v <= 0) {
    sf_error("stdtr", SF_ERROR_DOMAIN, NULL);
    return NAN;
    }
    if (std::isinf(x)) {
    return  (x > 0) ? 1.0 : 0.0;
    }
    Real y;
    try {
    y = boost::math::cdf(
                boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    } catch (...) {
    /* Boost was unable to produce a result. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    if ((y < 0) || (y > 1)) {
    /* Result must be between 0 and 1 to be a valid CDF value.
       Return NAN if the result is out of bounds because the answer cannot be trusted. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_cdf_float(float v, float x)
{
    return t_cdf_wrap(v, x);
}

double
t_cdf_double(double v, double x)
{
    return t_cdf_wrap(v, x);
}

template<typename Real>

Review comment (suggestion):
```suggestion
        /* Boost was unable to produce a result. */
```

Code after:
nct_kurtosis_excess_double(double v, double l)
{
    RETURN_NAN(v, 4.0);
    return boost::math::kurtosis_excess(boost::math::non_central_t_distribution<double, StatsPolicy>(v, l));
}

template<typename Real>
Real
t_cdf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
        return NAN;
    }
    if (v <= 0) {
        sf_error("stdtr", SF_ERROR_DOMAIN, NULL);
        return NAN;
    }
    if (std::isinf(x)) {
        return  (x > 0) ? 1.0 : 0.0;
    }
    Real y;
    try {
        y = boost::math::cdf(
                boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    } catch (...) {
        /* Boost was unable to produce a result. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    if ((y < 0) || (y > 1)) {
        /* Result must be between 0 and 1 to be a valid CDF value.
           Return NAN if the result is out of bounds because the answer cannot be trusted. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_cdf_float(float v, float x)
{
    return t_cdf_wrap(v, x);
}

double
t_cdf_double(double v, double x)
{
    return t_cdf_wrap(v, x);
}

template<typename Real>
Repository: scipy/scipy
File: scipy/special/boost_special_functions.h (C/C++)

Code before:
template<typename Real>
Real
t_cdf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
    return NAN;
    }
    if (v <= 0) {
    sf_error("stdtr", SF_ERROR_DOMAIN, NULL);
    return NAN;
    }
    if (std::isinf(x)) {
    return  (x > 0) ? 1.0 : 0.0;
    }
    Real y;
    try {
    y = boost::math::cdf(
                boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    } catch (...) {
    /* Boost was unable to produce a result. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    if ((y < 0) || (y > 1)) {
    /* Result must be between 0 and 1 to be a valid CDF value.
       Return NAN if the result is out of bounds because the answer cannot be trusted. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_cdf_float(float v, float x)
{
    return t_cdf_wrap(v, x);
}

double
t_cdf_double(double v, double x)
{
    return t_cdf_wrap(v, x);
}

template<typename Real>
Real
t_ppf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
        return NAN;
    }

Review comment (suggestion):
```suggestion
        /* Result must be between 0 and 1 to be a valid CDF value.
           Return NAN if the result is out of bounds because the answer cannot be trusted. */
```

Code after:
template<typename Real>
Real
t_cdf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
        return NAN;
    }
    if (v <= 0) {
        sf_error("stdtr", SF_ERROR_DOMAIN, NULL);
        return NAN;
    }
    if (std::isinf(x)) {
        return  (x > 0) ? 1.0 : 0.0;
    }
    Real y;
    try {
        y = boost::math::cdf(
                boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    } catch (...) {
        /* Boost was unable to produce a result. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    if ((y < 0) || (y > 1)) {
        /* Result must be between 0 and 1 to be a valid CDF value.
           Return NAN if the result is out of bounds because the answer cannot be trusted. */
        sf_error("stdtr", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_cdf_float(float v, float x)
{
    return t_cdf_wrap(v, x);
}

double
t_cdf_double(double v, double x)
{
    return t_cdf_wrap(v, x);
}

template<typename Real>
Real
t_ppf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
        return NAN;
    }
Repository: scipy/scipy
File: scipy/special/boost_special_functions.h (C/C++)

Code before:
t_cdf_float(float v, float x)
{
    return t_cdf_wrap(v, x);
}

double
t_cdf_double(double v, double x)
{
    return t_cdf_wrap(v, x);
}

template<typename Real>
Real
t_ppf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
        return NAN;
    }
    if (v <= 0 || x < 0 || x > 1) {
        sf_error("stdtrit", SF_ERROR_DOMAIN, NULL);
        return NAN;
    }
    Real y;
    try {
    y = boost::math::quantile(
        boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    }
    catch (const std::domain_error& e) {
        sf_error("stdtrit", SF_ERROR_DOMAIN, NULL);
        y = NAN;
    } catch (const std::overflow_error& e) {
        sf_error("stdtrit", SF_ERROR_OVERFLOW, NULL);
        y = INFINITY;
    } catch (const std::underflow_error& e) {
        sf_error("stdtrit", SF_ERROR_UNDERFLOW, NULL);
        y = 0; 
    } catch (...) {
    /* Boost was unable to produce a result. */
        sf_error("stdtrit", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_ppf_float(float v, float x)
{
    return t_ppf_wrap(v, x);
}

double

Review comment (suggestion):
```suggestion
        y = boost::math::quantile(
            boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
```

Code after:
t_cdf_float(float v, float x)
{
    return t_cdf_wrap(v, x);
}

double
t_cdf_double(double v, double x)
{
    return t_cdf_wrap(v, x);
}

template<typename Real>
Real
t_ppf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
        return NAN;
    }
    if (v <= 0 || x < 0 || x > 1) {
        sf_error("stdtrit", SF_ERROR_DOMAIN, NULL);
        return NAN;
    }
    Real y;
    try {
        y = boost::math::quantile(
            boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    }
    catch (const std::domain_error& e) {
        sf_error("stdtrit", SF_ERROR_DOMAIN, NULL);
        y = NAN;
    } catch (const std::overflow_error& e) {
        sf_error("stdtrit", SF_ERROR_OVERFLOW, NULL);
        y = INFINITY;
    } catch (const std::underflow_error& e) {
        sf_error("stdtrit", SF_ERROR_UNDERFLOW, NULL);
        y = 0; 
    } catch (...) {
        /* Boost was unable to produce a result. */
        sf_error("stdtrit", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_ppf_float(float v, float x)
{
    return t_ppf_wrap(v, x);
}

double
Repository: scipy/scipy
File: scipy/special/boost_special_functions.h (C/C++)

Code before:
Real
t_ppf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
        return NAN;
    }
    if (v <= 0 || x < 0 || x > 1) {
        sf_error("stdtrit", SF_ERROR_DOMAIN, NULL);
        return NAN;
    }
    Real y;
    try {
    y = boost::math::quantile(
        boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    }
    catch (const std::domain_error& e) {
        sf_error("stdtrit", SF_ERROR_DOMAIN, NULL);
        y = NAN;
    } catch (const std::overflow_error& e) {
        sf_error("stdtrit", SF_ERROR_OVERFLOW, NULL);
        y = INFINITY;
    } catch (const std::underflow_error& e) {
        sf_error("stdtrit", SF_ERROR_UNDERFLOW, NULL);
        y = 0; 
    } catch (...) {
    /* Boost was unable to produce a result. */
        sf_error("stdtrit", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_ppf_float(float v, float x)
{
    return t_ppf_wrap(v, x);
}

double
t_ppf_double(double v, double x)
{
    return t_ppf_wrap(v, x);
}

template<typename Real>
Real
skewnorm_cdf_wrap(const Real x, const Real l, const Real sc, const Real sh)
{
    if (std::isfinite(x)) {
        return boost::math::cdf(
            boost::math::skew_normal_distribution<Real, StatsPolicy>(l, sc, sh), x);

Review comment (suggestion):
```suggestion
        /* Boost was unable to produce a result. */
```

Code after:
Real
t_ppf_wrap(const Real v, const Real x)
{
    if (std::isnan(x) || std::isnan(v)) {
        return NAN;
    }
    if (v <= 0 || x < 0 || x > 1) {
        sf_error("stdtrit", SF_ERROR_DOMAIN, NULL);
        return NAN;
    }
    Real y;
    try {
        y = boost::math::quantile(
            boost::math::students_t_distribution<Real, SpecialPolicy>(v), x);
    }
    catch (const std::domain_error& e) {
        sf_error("stdtrit", SF_ERROR_DOMAIN, NULL);
        y = NAN;
    } catch (const std::overflow_error& e) {
        sf_error("stdtrit", SF_ERROR_OVERFLOW, NULL);
        y = INFINITY;
    } catch (const std::underflow_error& e) {
        sf_error("stdtrit", SF_ERROR_UNDERFLOW, NULL);
        y = 0; 
    } catch (...) {
        /* Boost was unable to produce a result. */
        sf_error("stdtrit", SF_ERROR_NO_RESULT, NULL);
        y = NAN;
    }
    return y;
}

float
t_ppf_float(float v, float x)
{
    return t_ppf_wrap(v, x);
}

double
t_ppf_double(double v, double x)
{
    return t_ppf_wrap(v, x);
}

template<typename Real>
Real
skewnorm_cdf_wrap(const Real x, const Real l, const Real sc, const Real sh)
{
    if (std::isfinite(x)) {
        return boost::math::cdf(
            boost::math::skew_normal_distribution<Real, StatsPolicy>(l, sc, sh), x);
Repository: scipy/scipy
File: scipy/special/tests/test_boost_ufuncs.py (Python)

Code before:
        # Harmless overflow warnings are a "feature" of some wrappers on some
        # platforms. This test is about dtype and accuracy, so let's avoid false
        # test failures cause by these warnings. See gh-17432.
        with np.errstate(over='ignore'):
            value = func(*args)
        assert isinstance(value, typ)
        assert_allclose(value, expected, rtol=rtol)


def test_landau():
    # Test that Landau distribution ufuncs are wrapped as expected;
    # accuracy is tested by Boost.
    x = np.linspace(-3, 10, 10)
    args = (0, 1)
    res = tanhsinh(lambda x: scu._landau_pdf(x, *args), -np.inf, x)
    cdf = scu._landau_cdf(x, *args)
    assert_allclose(res.integral, cdf)
    sf = scu._landau_sf(x, *args)
    assert_allclose(sf, 1-cdf)
    ppf = scu._landau_ppf(cdf, *args)
    assert_allclose(ppf, x)
    isf = scu._landau_isf(sf, *args)
    assert_allclose(isf, x, rtol=1e-6)

def test_gh22956():
    _ = scu._ncx2_pdf(30, 1e307, 16)

Review comment (suggestion):
```suggestion
    _ = scu._ncx2_pdf(30, 1e307, 16)

```

Code after:
        # Harmless overflow warnings are a "feature" of some wrappers on some
        # platforms. This test is about dtype and accuracy, so let's avoid false
        # test failures cause by these warnings. See gh-17432.
        with np.errstate(over='ignore'):
            value = func(*args)
        assert isinstance(value, typ)
        assert_allclose(value, expected, rtol=rtol)


def test_landau():
    # Test that Landau distribution ufuncs are wrapped as expected;
    # accuracy is tested by Boost.
    x = np.linspace(-3, 10, 10)
    args = (0, 1)
    res = tanhsinh(lambda x: scu._landau_pdf(x, *args), -np.inf, x)
    cdf = scu._landau_cdf(x, *args)
    assert_allclose(res.integral, cdf)
    sf = scu._landau_sf(x, *args)
    assert_allclose(sf, 1-cdf)
    ppf = scu._landau_ppf(cdf, *args)
    assert_allclose(ppf, x)
    isf = scu._landau_isf(sf, *args)
    assert_allclose(isf, x, rtol=1e-6)

def test_gh22956():
    _ = scu._ncx2_pdf(30, 1e307, 16)