Files
math/test/git_issue_1294.cpp
Matt Borland 5ee0d7734c Export the statistical distributions for the boost.math module
* BOOST_MATH_EXPORT on the 38 distribution class templates (fwd.hpp and
  definition sites), every non-member accessor overload, the convenience
  typedefs, the complement machinery and find_location/find_scale
* distributions/fwd.hpp now includes tools/config.hpp so the export
  macro is always defined
* Adds distributions.hpp to the module interface unit
* Module test harness gains git_issue_1294, git_issue_800,
  git_issue_1120 and scipy_issue_17146
2026-07-15 11:36:18 -04:00

39 lines
1003 B
C++

// Copyright 2025 Matt Borland
// Use, modification and distribution are subject to 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)
//
// See: https://github.com/boostorg/math/issues/1294
#ifndef BOOST_MATH_BUILD_MODULE
#include <boost/math/distributions/logistic.hpp>
#else
import boost.math;
#endif
#include "math_unit_test.hpp"
int main()
{
using namespace boost::math::policies;
using boost::math::logistic_distribution;
typedef policy<
promote_float<true>,
promote_double<true>
> with_promotion;
constexpr double p = 2049.0/4096;
constexpr double ref = 9.76562577610225755e-04;
logistic_distribution<double, with_promotion> dist_promote;
const double x = quantile(dist_promote, p);
// Previously we had: 9.76562577610170027e-04
// Which is an ULP distance of 256
CHECK_ULP_CLOSE(x, ref, 1);
return boost::math::test::report_errors();
}