File indexing completed on 2025-01-18 09:38:12
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_HISTOGRAM_DETAIL_NORMAL_HPP
0008 #define BOOST_HISTOGRAM_DETAIL_NORMAL_HPP
0009
0010 #include <boost/histogram/detail/erf_inv.hpp>
0011 #include <cmath>
0012
0013 namespace boost {
0014 namespace histogram {
0015 namespace detail {
0016
0017 inline double normal_cdf(double x) noexcept {
0018 return std::fma(0.5, std::erf(x / std::sqrt(2)), 0.5);
0019 }
0020
0021 inline double normal_ppf(double p) noexcept {
0022 return std::sqrt(2) * erf_inv(2 * (p - 0.5));
0023 }
0024
0025 }
0026 }
0027 }
0028
0029 #endif