From: W. Trevor King Date: Mon, 3 Aug 2009 20:16:19 +0000 (-0400) Subject: inverse_wlc now handles F=HUGE_VAL. X-Git-Tag: v0.8~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6a74c591b2154fea14744922c90b96960743028f;p=sawsim.git inverse_wlc now handles F=HUGE_VAL. --- 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;