xo-umbrella2/xo-distribution/utest/Normal.test.cpp
Roland Conybeare 9cd049b8e8 git subrepo clone (merge) git@github.com:Rconybea/xo-distribution.git xo-distribution
subrepo:
  subdir:   "xo-distribution"
  merged:   "cf1c1566"
upstream:
  origin:   "git@github.com:Rconybea/xo-distribution.git"
  branch:   "main"
  commit:   "cf1c1566"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2026-06-06 22:07:58 -04:00

24 lines
786 B
C++

/* @file Normal.test.cpp */
#include "xo/distribution/Normal.hpp"
#include <catch2/catch.hpp>
namespace xo {
using xo::distribution::Normal;
namespace ut {
TEST_CASE("normal", "[distribution]") {
auto n01 = Normal::unit();
CHECK(n01->cdf(-3.0) == Approx(0.001349898).margin(1e-9));
CHECK(n01->cdf(-2.0) == Approx(0.0227501319).margin(1e-9));
CHECK(n01->cdf(-1.0) == Approx(0.1586552539).margin(1e-9));
CHECK(n01->cdf(0.0) == 0.5);
CHECK(n01->cdf(1.0) == 1.0 - n01->cdf(-1.0));
CHECK(n01->cdf(2.0) == 1.0 - n01->cdf(-2.0));
CHECK(n01->cdf(3.0) == 1.0 - n01->cdf(-3.0));
} /*TEST_CASE(normal)*/
} /*namespace ut*/
} /*namespace xo*/
/* end Normal.test.cpp */