Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Instance Definitions for log1p, expm1, log1pexp, and log1mexp #111

Merged
merged 5 commits into from
Mar 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
exclude test case for old versions of base with faulty log1mexp
julmb committed Mar 12, 2024
commit eb9409d01e08d721706f8f9f2816f52b320cd366
5 changes: 5 additions & 0 deletions tests/Regression.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE RankNTypes #-}

@@ -125,7 +126,11 @@ issue108 diff = testGroup "issue-108" [tlog1p, texpm1, tlog1pexp, tlog1mexp] whe
equal (1000, 1) $ diff log1pexp 1000
tlog1mexp = testCase "log1mexp" $ do
equal (-0, -0) $ diff log1mexp (-1000)
-- old versions of base have a faulty implementation of log1mexp, causing this case to fail
-- see also https://gitlab.haskell.org/ghc/ghc/-/issues/17125
#if MIN_VERSION_base(4, 13, 0)
equal (-3.720075976020836e-44, -3.7200759760208356e-44) $ diff log1mexp (-100)
#endif
equal (-0.45867514538708193, -0.5819767068693265) $ diff log1mexp (-1)
equal (-0.9327521295671886, -1.5414940825367982) $ diff log1mexp (-0.5)
equal (-2.3521684610440907, -9.50833194477505) $ diff log1mexp (-0.1)