From 6a74c591b2154fea14744922c90b96960743028f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 3 Aug 2009 16:16:19 -0400 Subject: [PATCH] inverse_wlc now handles F=HUGE_VAL. --- src/sawsim.nw | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sawsim.nw b/src/sawsim.nw index cc50697..f1e7f2c 100644 --- a/src/sawsim.nw +++ b/src/sawsim.nw @@ -3945,6 +3945,8 @@ static double inverse_wlc(double F, double T, double p, double L) int num_roots; assert(F >= 0); assert(T > 0); assert(p > 0); assert(L > 0); + if (F == HUGE_VAL) + return L; num_roots = gsl_poly_solve_cubic(-(FT+2.25),2*FT+1.5,-FT, &xL0, &xL1, &xL2); assert(num_roots > 0); assert(xL0 >= -DOUBLE_PRECISION); assert(xL0 < 1); if (xL0 < 0) xL0 = 0.0; -- 2.26.2