newtonReal :: Equation -> Flow [Double]
  newtonReal (Equation lhs rhs) =
    let lhs' = simplify lhs
        rhs' = simplify rhs
        vars = map head . group . sort $ extractVariables lhs' ++ extractVariables rhs'
    in  solve 0 (map (\v -> (v, -1000)) vars) lhs' rhs'
    where
      solve 1000 _    _   _   = throwError "No more iterations available."
      solve step vars lhs rhs =
        let lvalue = evaluate vars lhs
            rvalue = evaluate vars rhs
        in  if abs (rvalue - lvalue) > theta then 
              solve (step + 1) (map (\(x, v) -> (x, v + 0.1)) vars) lhs rhs
            else
              return $ map (\(x, v) -> v) vars
        where
          theta = 0
newtonReal :: Equation -> Flow [Double]
newtonReal (Equation lhs rhs) =
    let lhs' = simplify lhs
        rhs' = simplify rhs
        vars = map head . group . sort $ extractVariables lhs' ++ extractVariables rhs'
    in  solve 0 (map (\v -> (v, -1000)) vars) lhs' rhs'
    where
      solve 1000 _    _   _   = throwError "No more iterations available."
      solve step vars lhs rhs =
        let lvalue = evaluate vars lhs
            rvalue = evaluate vars rhs
        in  if abs (rvalue - lvalue) > theta then 
              solve (step + 1) (map (\(x, v) -> (x, v + 0.1)) vars) lhs rhs
            else
              return $ map (\(x, v) -> v) vars
        where
          theta = 0
newtonReal (Equation lhs rhs) =
    let lhs' = simplify lhs
        rhs' = simplify rhs
        vars = map head . group . sort $ extractVariables lhs' ++ extractVariables rhs'
    in  solve 0 (map (\v -> (v, -1000)) vars) lhs' rhs'
    where
      solve 1000 _    _   _   = throwError "No more iterations available."
      solve step vars lhs rhs =
        let lvalue = evaluate vars lhs
            rvalue = evaluate vars rhs
        in  if abs (rvalue - lvalue) > theta then 
              solve (step + 1) (map (\(x, v) -> (x, v + 0.1)) vars) lhs rhs
            else
              return $ map (\(x, v) -> v) vars
        where
          theta = 0