Commit 60cf85e7 authored by Benoit Barbot's avatar Benoit Barbot
Browse files

In progress

parent c6f19218
Pipeline #2146 failed with stages
in 29 seconds
......@@ -66,7 +66,7 @@ let rec bisect_increasing ?(factor = 1e-10) ?(relax = 0.0) ?low
in
(*Format.printf "bisect [%g; %g] low:%g, %g @?" bmin bmax xfmin yfmin;*)
if up_bound then
if up_bound then (
if bmax -. bmin < factor then (bmin, yfmin, a_val)
else
let m = 0.5 *. (bmin +. bmax) in
......@@ -80,20 +80,25 @@ let rec bisect_increasing ?(factor = 1e-10) ?(relax = 0.0) ?low
if m < xfmin then false
else
let cf = classify_float (fx *. yfmin) in
(cf = FP_nan || cf = FP_infinite) || fx < yfmin
cf = FP_nan || cf = FP_infinite
(*|| fx < yfmin*)
in
if detect_asymptote then
Format.printf "detect asymptot fx:%f yfmin:%f m:%f" fx yfmin m;
let width = bmax -. bmin in
if abs_float fx < factor || width < factor /. 10. then (*stop *) (m, fx, a)
else if detect_asymptote || fx > 0.0 then
else if detect_asymptote || fx > 0.0 then (
(* go left *)
Format.printf "left\n";
bisect_increasing ~relax ~factor ?low
(bmin -. (relax *. width), m +. (relax *. width))
f_to_evaluate
else
f_to_evaluate )
else (
(* go right *)
Format.printf "right\n";
bisect_increasing ~relax ~factor ~low:(m, fx, a)
(m -. (relax *. width), bmax +. (relax *. width))
f_to_evaluate
f_to_evaluate ) )
else
let fx, _, _ = f_to_evaluate bmax in
if classify_float fx = FP_nan || fx > 0.0 || fx < yfmin then
......
......@@ -432,7 +432,7 @@ struct
if
( (cilow < target && ciup < target +. 0.1)
|| (cilow > target && ciup > target -. 0.1) )
&& n >= 10
&& n >= 100
then raise Exit
let end_sampling (target, mon_state) =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment