
19 Apr
2014
19 Apr
'14
9:42 a.m.
On 2014-04-17 15:08, Edward Kmett wrote:
On Thu, Apr 17, 2014 at 2:48 PM, Henning Thielemann
mailto: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) On the contrary, code that explicitly uses these functions is likely to need the precision. Defaults would cause subtle breakage.
-- Scott