Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module A = Archimedes;;
- module R = Root_finding;;
- module G = Q2a;;
- let f x = x *. x -. 2.;;
- let df x = 2. *. x;;
- let g x = x *. x *. x;;
- let dg x = 3. *. x *. x;;
- let h x = x *. x *. x *. x *. x;;
- let dh x = 5. *. x *. x *. x *. x;;
- let i x = cos x;;
- let di x = -. sin x;;
- let graph_fonction root_fonction f df a b =
- let tab = Array.make 20 0. in
- for i=0 to 20 do
- let a,b = root_fonction
- ~good_enough:R.stop_iter ~max_iter:i f df a b in
- Array.set tab i a
- done;
- tab;;
- let graph_bissection f df a b =
- graph_fonction (R.bissection) f df a b;;
- let graph_fausse_position f df a b =
- graph_fonction (R.fausse_position) f df a b;;
- let graph_secante f df a b =
- graph_fonction (R.secante) f df a b;;
- let graph_newton f df a b =
- graph_fonction (R.newton) f df a b;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement