From 4bfeda9349f5671f77995b99f051f040e3baeca6 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Sun, 22 May 2022 16:16:09 +0200 Subject: [PATCH] Fix tolerances --- test/DualTest.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/DualTest.jl b/test/DualTest.jl index 58a97bf0..eca0da2f 100644 --- a/test/DualTest.jl +++ b/test/DualTest.jl @@ -556,7 +556,8 @@ for N in (0,3), M in (0,4), V in (Int, Float32) @test pq isa Tuple{Dual{TestTag()},Dual{TestTag()}} # We have to adjust tolerances if lower accuracy is requested # Therefore we don't use `dual_isapprox` - tol = (V === Float32 ? 1f-4 : 1e-6)^(1 / 2^(isempty(ind) ? 0 : first(ind))) + tol = V === Float32 ? 5f-4 : 1e-6 + tol = tol^(one(tol) / 2^(isempty(ind) ? 0 : first(ind))) for i in 1:2 @test value(pq[i]) ≈ gamma_inc(a, 1 + PRIMAL, ind...)[i] rtol=tol @test partials(pq[i]) ≈ PARTIALS * Calculus.derivative(x -> gamma_inc(a, x, ind...)[i], 1 + PRIMAL) rtol=tol