Closed dmcclean closed 5 years ago
Looks OK to me. Do you know what the tradeoff is? Perhaps we should consider making these the “least effort” options? E.g.:
log = fmap Numeric.log1p
log_ = fmap Prelude.log
I think it's basically along these lines:
Pro: If you go looking for something from the Floating
typeclass, there is a dimensional wrapper for it, so you have guidance as to what the proper dimensions are.
Con: Additional name consumption, and of some strange names.
I'm confused by the alternative you propose. log1p = log . (+1)
but with a possibly more precise result when the argument is very small.
μ> Numeric.log1p 2
1.0986122886681098
μ> Prelude.log 3
1.0986122886681098
Ah, sorry, I misread the docs and purpose of log1p
(et al). I think this change is good. 👍
Since base-4.9 the
Floating
class has hadlog1p
,expm1
,log1pexp
, andlog1mexp
.We should likely add
Dimensionless
wrappers for these.