mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-13 18:58:09 +00:00
Added thirdparty: boost library
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
// 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
|
||||
Reference in New Issue
Block a user