-- |Made for Float32/64 expressions
findAbsoluteErrorUsingFPTaylor :: E -> VarMap -> IO Rational
findAbsoluteErrorUsingFPTaylor e varMap =
  do
    writeFile fptaylorFile fptaylorInput
    (exitCode, output, errDetails) <- readProcessWithExitCode fpTaylorPath [fptaylorFile] []
    -- removeFile fptaylorFile
    case exitCode of
      ExitSuccess -> 
        case parseFPTaylorRational output of
          Just result -> return result
          Nothing     -> error "Could not parse FPTaylor output"
      ExitFailure _   -> error $ "Error when running FPTaylor on generated fptaylor.txt. Error message: " ++ show errDetails
  where
    fptaylorInput = expressionWithVarMapToFPTaylor e varMap
    fptaylorFile = "fptaylor.txt"
findAbsoluteErrorUsingFPTaylor :: E -> VarMap -> IO Rational
findAbsoluteErrorUsingFPTaylor e varMap =
  do
    writeFile fptaylorFile fptaylorInput
    (exitCode, output, errDetails) <- readProcessWithExitCode fpTaylorPath [fptaylorFile] []
    -- removeFile fptaylorFile
    case exitCode of
      ExitSuccess -> 
        case parseFPTaylorRational output of
          Just result -> return result
          Nothing     -> error "Could not parse FPTaylor output"
      ExitFailure _   -> error $ "Error when running FPTaylor on generated fptaylor.txt. Error message: " ++ show errDetails
  where
    fptaylorInput = expressionWithVarMapToFPTaylor e varMap
    fptaylorFile = "fptaylor.txt"
findAbsoluteErrorUsingFPTaylor e varMap =
  do
    writeFile fptaylorFile fptaylorInput
    (exitCode, output, errDetails) <- readProcessWithExitCode fpTaylorPath [fptaylorFile] []
    -- removeFile fptaylorFile
    case exitCode of
      ExitSuccess -> 
        case parseFPTaylorRational output of
          Just result -> return result
          Nothing     -> error "Could not parse FPTaylor output"
      ExitFailure _   -> error $ "Error when running FPTaylor on generated fptaylor.txt. Error message: " ++ show errDetails
  where
    fptaylorInput = expressionWithVarMapToFPTaylor e varMap
    fptaylorFile = "fptaylor.txt"