x \cdot \log x
-x \cdot \log \left(\frac{1}{x}\right)(FPCore (x) :precision binary64 (* x (log x)))
(FPCore (x) :precision binary64 (- (* x (log (/ 1.0 x)))))
double code(double x) {
return x * log(x);
}
double code(double x) {
return -(x * log(1.0 / x));
}



Bits error versus x
Results
Initial program 0.3
Taylor expanded around inf 0.3
Final simplification0.3
herbie shell --seed 2021118
(FPCore (x)
:name "Statistics.Distribution.Binomial:directEntropy from math-functions-0.1.5.2"
:precision binary64
(* x (log x)))