fact: Fixpoint iter_until {T} n (step : T -> T) (cache_step : T -> T) (done : T -> bool) v := match n with | xH => step v | xO n => let v := iter_until n step cache_step done v in if done v then v else let v := cache_step v in iter_until n step (fun x => x) done v | xI n => let v := step v in if done v then v else let v := iter_until n step cache_step done v in if done v then v else let v := cache_step v in iter_until n step (fun x => x) done v end.
imports: Coq(BinPos Reals List) Coquelicot(Coquelicot) Coquelicot Xreal Interval Priority