Skip to content

Commit

Permalink
updated Herbie's database for new format
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeizbicki committed Oct 6, 2015
1 parent 0af9839 commit 0d495e4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ install:

# manually download the expression database
- wget https://github.com/mikeizbicki/HerbiePlugin/raw/master/data/Herbie.db
- mkdir -p $HOME/.cabal/share/x86_64-linux-ghc-$GHCVER/HerbiePlugin-0.1.0.0/
- cp Herbie.db $HOME/.cabal/share/x86_64-linux-ghc-$GHCVER/HerbiePlugin-0.1.0.0/
- mkdir -p $HOME/.cabal/share/x86_64-linux-ghc-$GHCVER/HerbiePlugin-0.2.0.0/
- cp Herbie.db $HOME/.cabal/share/x86_64-linux-ghc-$GHCVER/HerbiePlugin-0.2.0.0/

# display versions
- cabal --version
Expand Down
Binary file modified data/Herbie.db
Binary file not shown.
10 changes: 5 additions & 5 deletions src/Herbie/ForeignInterface.hs
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ execHerbie (HerbieOptions opts) lisp = do

case ret of
Left (SomeException e) -> do
putStrLn $ "WARNING in execHerbie: "++show e
putStrLn $ "WARNING in execHerbie: stdin="++stdin
putStrLn $ "WARNING in execHerbie: stdout="++stdout
putStrLn $ " WARNING: error when calling `herbie-exec`"
putStrLn $ " stdin="++stdin
putStrLn $ " stdout="++stdout
return HerbieResult
{ errin = 0/0
, errout = 0/0
Expand Down Expand Up @@ -229,7 +229,7 @@ lookupDatabase opts cmdin = do
[] -> Nothing
case ret of
Left (SomeException e) -> do
putStrLn $ "WARNING in lookupDatabase: "++show e
putStrLn $ " WARNING in lookupDatabase: "++show e
return Nothing
Right x -> return x

Expand All @@ -252,7 +252,7 @@ insertDatabase res = do
execute conn "INSERT INTO HerbieResults (cmdin,cmdout,opts,errin,errout) VALUES (?,?,?,?,?)" res
close conn
case ret of
Left (SomeException e) -> putStrLn $ "WARNING in insertDatabase: "++show e
Left (SomeException e) -> putStrLn $ " WARNING in insertDatabase: "++show e
Right _ -> return ()
return ()

Expand Down
4 changes: 4 additions & 0 deletions test/ValidRewrite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ test1c far near = if far < -1.7210442634149447e81
then -2 * far * (near / (far - near))
else ((-2 * far) / (far - near)) * near

{-
--------------------
test2a :: Double -> Double -> Double
Expand Down Expand Up @@ -90,6 +91,7 @@ atanh_ :: Double -> Double
atanh_ x = 0.5 * log ((1.0+x) / (1.0-x))
--------------------------------------------------------------------------------
-}

#define mkTest(f1,f2,a,b) \
putStrLn $ "mkTest: " ++ show (f1 (a) (b)); \
Expand All @@ -110,13 +112,15 @@ main = do
mkTest(test1a,test1c,3,4)
mkTest(test1a,test1c,2e90,6)

{-
mkTest(test2a,test2b,1,2)
-- mkTest(test3a,test3b,(Quaternion 1 (V3 1 2 3)),(Quaternion 2 (V3 2 3 4)))
-- mkTestB(asinh,asinh_,5e-17::Complex Double)
-- mkTestB(acosh,acosh_,5e-17::Complex Double)
mkTestB(atanh,atanh_,5e-17::Double)
-}

putStrLn "done"

Expand Down

0 comments on commit 0d495e4

Please sign in to comment.