From 2cb99e97acc82267b6eab380fec77f824360b098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Viana?= <57032457+vollous@users.noreply.github.com> Date: Thu, 25 Apr 2024 13:29:39 +0100 Subject: [PATCH] Added test for J_1 and increases accuracy required. --- tests/unittests/Test-gw.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/unittests/Test-gw.cpp b/tests/unittests/Test-gw.cpp index f38331fb..5248e69a 100644 --- a/tests/unittests/Test-gw.cpp +++ b/tests/unittests/Test-gw.cpp @@ -26,9 +26,21 @@ TEST_CASE("Test I_\alpha", "[gw]") BounceActionInt BACalc; - REQUIRE(BACalc.BesselI(3, 1) == Approx(0.0221684249).epsilon(5e-2)); - REQUIRE(BACalc.BesselI(1, 3) == Approx(3.953370217).epsilon(5e-2)); - REQUIRE(BACalc.BesselI(1, 1.5) == Approx(0.9816664).epsilon(5e-2)); + REQUIRE(BACalc.BesselI(3, 1) == Approx(0.0221684249).epsilon(1e-8)); + REQUIRE(BACalc.BesselI(1, 3) == Approx(3.953370217).epsilon(1e-8)); + REQUIRE(BACalc.BesselI(1, 1.5) == Approx(0.9816664285779).epsilon(1e-8)); +} + +TEST_CASE("Test J_1", "[gw]") +{ + // Tests bounce solver with analytical derivative + using namespace BSMPT; + + BounceActionInt BACalc; + + REQUIRE(BACalc.BesselJ(1) == Approx(0.440050585744).epsilon(1e-8)); + REQUIRE(BACalc.BesselJ(3) == Approx(0.3390589585259).epsilon(1e-8)); + REQUIRE(BACalc.BesselJ(1.5) == Approx(0.5579365079).epsilon(1e-8)); } TEST_CASE("Solve bounce equation with analytical derivative", "[gw]")