Open eschnett opened 2 years ago
Are there any downsides to making this switch?
IMO, this is a very reasonable switch to make. The main reason it is the way it is is likely that for a couple years, our log
was better than our log2
since no one had updated the log2
version.
I notice that ^
uses exp2
and log2
in its implementation.
well for Float32
it does. For Float64
it uses log
and exp
since the in extended precision, it is a benefit to have exact coefficients in the polynomial.
The function
log2
is generally (very slightly) more accurate (and also slightly faster) thanlog
, since IEEE floating-point numbers are stored in a base-2 representation.Julia define the generic (two-argument)
log
aslog(x, y) = log(y) / log(x)
. This could be improved (to be slightly faster and slightly more accurate) by changing this tolog(x, y) = log2(y) / log2(x)
.For example: