On 2014-04-17 15:08, Edward Kmett wrote:
On the contrary, code that explicitly uses these functions is likely to need the precision. Defaults would cause subtle breakage.On Thu, Apr 17, 2014 at 2:48 PM, Henning Thielemann <schlepptop@henning-thielemann.de> wrote:
I think one should add default implementations. They don't have an numerical advantage but they save programmers from code breakage.I included the default definitions in code snippet in the proposal, so user code that remains unaware of them would be unaffected, while packages like compensated, or a wrapper around libqd could implement them as needed.
expm1 :: Floating a => a -> a
expm1 x = exp x - 1
log1p :: Floating a => a -> a
log1p x = log (1 + x)
-- Scott