<commit_before>{-# LANGUAGE ImplicitParams #-}
{-# LANGUAGE ExistentialQuantification #-}

module Main where

import Numeric.AERN.Basics.Effort

import qualified Numeric.AERN.Basics.NumericOrder as NumOrd
import Numeric.AERN.Basics.NumericOrder.OpsDefaultEffort

import qualified Numeric.AERN.Basics.RefinementOrder as RefOrd
import Numeric.AERN.Basics.RefinementOrder.OpsDefaultEffort

import Numeric.AERN.RealArithmetic.ExactOps

import qualified Numeric.AERN.RealArithmetic.NumericOrderRounding as ArithUpDn
import Numeric.AERN.RealArithmetic.NumericOrderRounding.OpsDefaultEffort

import qualified Numeric.AERN.RealArithmetic.RefinementOrderRounding as ArithInOut
import Numeric.AERN.RealArithmetic.RefinementOrderRounding.OpsDefaultEffort

import Numeric.AERN.RealArithmetic.Basis.MPFR
import Numeric.AERN.RealArithmetic.Interval.MPFR
import Numeric.AERN.RealArithmetic.Interval.ElementaryDirect

import Numeric.AERN.Basics.CInterval
import Numeric.AERN.Basics.ShowInternals

import Control.Concurrent

main =
    do
--    setMachineRoundingModeUp 
    -- not sure why the above is sometimes needed...
    -- the unsafePerformIO embedded in rounded ops sometimes 
    -- does not work when run standalone, 
    -- but they seem to work when run from ghci 
    putStrLn $ "oo - oo = " ++ showInternals shouldShowInternals inftyMinusInftyOut
    putStrLn $ "0</>0 = " ++ showInternals shouldShowInternals zeroOverZeroOut
    putStrLn $ "0>/<0 = " ++ showInternals shouldShowInternals zeroOverZeroIn
--    putStrLn $ "exp 1 = \n" ++ (unlines $ map (showInternals shouldShowInternals) exp1efforts)
--    putStrLn $ "exp 3 = \n" ++ (unlines $ map (showInternals shouldShowInternals) exp3efforts)
--    putStrLn $ "exp 10 = \n" ++ (unlines $ map (showInternals shouldShowInternals) exp10efforts)
--    putStrLn $ "exp 100 = \n" ++ (unlines $ map (showInternals shouldShowInternals) exp100efforts)
--    putStrLn $ "exp 1000 = \n" ++ (unlines $ map (showInternals shouldShowInternals) exp1000efforts)
    return ()

shouldShowInternals = (30,False)

inftyMinusInftyOut :: MI
inftyMinusInftyOut =
    let ?addDefaultEffort = 100 in
    plusInfinity <-> plusInfinity

zeroOverZeroOut :: MI
zeroOverZeroOut =
    let ?divDefaultEffort = 100 in
    zero </> zero

zeroOverZeroIn :: MI
zeroOverZeroIn =
    let ?divDefaultEffort = 100 in
    zero >/< zero

oneOverZeroOut :: MI
oneOverZeroOut =
    let ?divDefaultEffort = 100 in
    one </> zero

oneOverZeroIn :: MI
oneOverZeroIn =<commit_msg>Updated minimal demo of MPFR backend to compile and print more values.<commit_after>{-# LANGUAGE ImplicitParams #-}
{-# LANGUAGE ExistentialQuantification #-}

module Main where

import Numeric.AERN.Basics.Effort

import qualified Numeric.AERN.Basics.NumericOrder as NumOrd
import Numeric.AERN.Basics.NumericOrder.OpsDefaultEffort

import qualified Numeric.AERN.Basics.RefinementOrder as RefOrd
import Numeric.AERN.Basics.RefinementOrder.OpsDefaultEffort

import Numeric.AERN.RealArithmetic.ExactOps

import qualified Numeric.AERN.RealArithmetic.NumericOrderRounding as ArithUpDn
import Numeric.AERN.RealArithmetic.NumericOrderRounding.OpsDefaultEffort

import qualified Numeric.AERN.RealArithmetic.RefinementOrderRounding as ArithInOut
import Numeric.AERN.RealArithmetic.RefinementOrderRounding.OpsDefaultEffort

import Numeric.AERN.RealArithmetic.Basis.MPFR
import Numeric.AERN.RealArithmetic.Interval.MPFR
import Numeric.AERN.RealArithmetic.Interval.ElementaryDirect

import Numeric.AERN.Basics.Interval
import Numeric.AERN.Basics.ShowInternals

import Control.Concurrent

main =
    do
    putStrLn $ "oo - oo = " ++ showInternals shouldShowInternals inftyMinusInftyOut
    putStrLn $ "0</>0 = " ++ showInternals shouldShowInternals zeroOverZeroOut
    putStrLn $ "0>/<0 = " ++ showInternals shouldShowInternals zeroOverZeroIn
    putStrLn $ "exp 1 = \n" ++ (unlines $ map (showInternals shouldShowInternals) exp1efforts)
    putStrLn $ "exp 3 = \n" ++ (unlines $ map (showInternals shouldShowInternals) exp3efforts)
    putStrLn $ "exp 10 = \n" ++ (unlines $ map (showInternals shouldShowInternals) exp10efforts)
    putStrLn $ "exp 100 = \n" ++ (unlines $ map (showInternals shouldShowInternals) exp100efforts)
    putStrLn $ "exp 1000 = \n" ++ (unlines $ map (showInternals shouldShowInternals) exp1000efforts)
    return ()

shouldShowInternals = (30,False)

inftyMinusInftyOut :: MI
inftyMinusInftyOut =
    let ?addDefaultEffort = 100 in
    plusInfinity <-> plusInfinity

zeroOverZeroOut :: MI
zeroOverZeroOut =
    let ?divDefaultEffort = 100 in
    zero </> zero

zeroOverZeroIn :: MI
zeroOverZeroIn =
    let ?divDefaultEffort = 100 in
    zero >/< zero

oneOverZeroOut :: MI
oneOverZeroOut =
    let ?divDefaultEffort = 100 in
    one </> zero

oneOverZeroIn :: MI
oneOverZeroIn =
{'fraction_non_alphanumeric': 0.08676562826677817, 'fraction_numerical': 0.016725904244198203, 'mean_word_length': 4.715651135005974, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '497078', 'n_tokens_mistral': 1665, 'n_tokens_neox': 1583, 'n_words': 356}