HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Library/include/boost/histogram/detail/normal.hpp
// Copyright 2022 Hans Dembinski, Jay Gohil
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef BOOST_HISTOGRAM_DETAIL_NORMAL_HPP
#define BOOST_HISTOGRAM_DETAIL_NORMAL_HPP

#include <boost/histogram/detail/erf_inv.hpp>
#include <cmath>

namespace boost {
namespace histogram {
namespace detail {

inline double normal_cdf(double x) noexcept {
  return std::fma(0.5, std::erf(x / std::sqrt(2)), 0.5);
}

inline double normal_ppf(double p) noexcept {
  return std::sqrt(2) * erf_inv(2 * (p - 0.5));
}

} // namespace detail
} // namespace histogram
} // namespace boost

#endif