X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FRoots%2FSimple.hs;h=815a64ca0d3407dc051c16875593cdf2cdeb3532;hb=b4dd59b1c20deab4381959d8cc8394ada113d286;hp=a5924f4658d5c6ca8d15fbba6b10c24ed446566b;hpb=ae914d13235a4582077a5cb2b1edd630d9c6ad62;p=numerical-analysis.git diff --git a/src/Roots/Simple.hs b/src/Roots/Simple.hs index a5924f4..815a64c 100644 --- a/src/Roots/Simple.hs +++ b/src/Roots/Simple.hs @@ -197,6 +197,7 @@ fixed_point_error_ratios f x0 x_star p = -- Examples: -- -- Atkinson, p. 60. +-- -- >>> let f x = x^6 - x - 1 -- >>> let f' x = 6*x^5 - 1 -- >>> tail $ take 4 $ newton_iterations f f' 2 @@ -283,6 +284,7 @@ iterate2 f x0 x1 = -- Examples: -- -- Atkinson, p. 67. +-- -- >>> let f x = x^6 - x - 1 -- >>> take 4 $ secant_iterations f 2 1 -- [2.0,1.0,1.0161290322580645,1.190577768676638] @@ -308,6 +310,7 @@ secant_iterations f = -- Examples: -- -- Atkinson, p. 67. +-- -- >>> let f x = x^6 - x - 1 -- >>> let Just root = secant_method f (1/10^9) 2 1 -- >>> root