From: Michael Orlitzky Date: Thu, 6 Feb 2014 06:36:28 +0000 (-0500) Subject: Fix some docs in Roots.Simple. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=b4dd59b1c20deab4381959d8cc8394ada113d286;p=numerical-analysis.git Fix some docs in Roots.Simple. --- 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