{-# LANGUAGE RebindableSyntax #-}
+{-# LANGUAGE ScopedTypeVariables #-}
-- | The Roots.Simple module contains root-finding algorithms. That
-- is, procedures to (numerically) find solutions to the equation,
--
-- This is used to determine the rate of convergence.
--
-fixed_point_error_ratios :: (Normed a,
+fixed_point_error_ratios :: forall a b. (Normed a,
Additive.C a,
RealField.C b,
Algebraic.C b)
zipWith (/) en_plus_one en_exp
where
xn = F.fixed_point_iterations f x0
- en = map (\x -> norm (x_star - x)) xn
+ en = map (\x -> norm (x_star - x)) xn :: [b]
en_plus_one = tail en
en_exp = map (^p) en