1 {-# OPTIONS -optc-DNON_POSIX_SOURCE #-}
3 -- The above option is required because 'erf' isn't a POSIX function, and we
4 -- need a prototype for it in order to compile the following code correctly.
5 -- Defining NON_POSIX_SOURCE tells the RTS not to define _POSIX_SOURCE.
7 module Main (main) where
9 import IOExts ( unsafePerformIO )
11 po :: Double -> Double
12 po rd = 0.5 + 0.5 * erf ((rd / 1.04) / sqrt 2)
14 erf :: Double -> Double
15 erf x = unsafePerformIO (_ccall_ erf x)
17 main = putStr (shows (po 2.0) "\n")