Skip to content

Commit

Permalink
add more qualification and license headers
Browse files Browse the repository at this point in the history
  • Loading branch information
julialongtin committed Dec 22, 2023
1 parent f9a113b commit 2aed344
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
20 changes: 16 additions & 4 deletions test/Bench.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
-----------------------------------------------------------------------------
-- |
-- Copyright : (C) 2015 Anselm Jonas Scholl, (C) 2023 Julia Longtin
-- License : BSD3
-- Maintainer : Julia Longtin <Julia.Longtin@gmail.com>
-- Stability : experimental
-- Portability : GHC-specific
--

module Main where

import TestUtils
import Prelude (Double, Float, IO, ($), (++), concatMap, map, shows, unzip)

import TestUtils (refDoubleDown, refDoubleToWord, refDoubleUp, refDoubleUlp, refFloatDown, refFloatToWord, refFloatUp, refFloatUlp, refWordToDouble, refWordToFloat, showW, testD, testF)

import Data.Word (Word32, Word64)

import Data.Word
import Data.Bits.Floating
import Data.Bits.Floating (coerceToFloat, coerceToWord, nextDown, nextUp, ulp)

import Criterion.Main
import Criterion.Main (Benchmark, bench, bgroup, defaultMain, nf)

mkSingleBenchmarks :: ((Float, Word32) -> [Benchmark]) -> ((Double, Word64) -> [Benchmark]) -> [Benchmark]
mkSingleBenchmarks mkFTest mkDTest = concatMap mkFTest testF ++ concatMap mkDTest testD
Expand Down
16 changes: 14 additions & 2 deletions test/TestUtils.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
-----------------------------------------------------------------------------
-- |
-- Copyright : (C) 2015 Anselm Jonas Scholl, (C) 2023 Julia Longtin
-- License : BSD3
-- Maintainer : Julia Longtin <Julia.Longtin@gmail.com>
-- Stability : experimental
-- Portability : GHC-specific
--

{-# LANGUAGE ForeignFunctionInterface #-}

module TestUtils where

import Data.Word
import Prelude (Double, Float, Integral, Show, String, (/), pi, sqrt)

import Data.Word (Word32, Word64)

import Numeric
import Numeric (showHex)

-- we do not test NaNs here because their binary representation can be changed
-- without changing their value and some processors have been observed to do that.
Expand Down

0 comments on commit 2aed344

Please sign in to comment.