Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec optimalRoot low high count =
- let mid = (((high-low)/2.)+low)
- if count>10 then
- mid
- elif (sturmSeq sturm low mid) > 0 then
- optimalRoot low mid (count+1)
- elif (sturmSeq sturm mid high) > 0 then
- optimalRoot mid high (count+1)
- else
- infinity
- let rec NRap (t : float) rep oldFx =
- if rep > 50 then
- None
- else
- let fx = solveMap t poly
- if abs(fx)<1e-6 then
- Some(t)
- else
- NRap (t-(fx/(solveMap t diffMap))) (rep+1) fx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement