\left(\left(n + 1\right) \cdot \log \left(n + 1\right) - n \cdot \log n\right) - 1
\frac{0.5}{n} - \left(\left(\sqrt[3]{\frac{0.16666666666666666}{n \cdot n}} \cdot \sqrt[3]{\frac{0.16666666666666666}{n \cdot n}}\right) \cdot \sqrt[3]{\frac{\sqrt{0.16666666666666666}}{\frac{n}{\frac{\sqrt{0.16666666666666666}}{n}}}} - \log n\right)(FPCore (n) :precision binary64 (- (- (* (+ n 1.0) (log (+ n 1.0))) (* n (log n))) 1.0))
(FPCore (n)
:precision binary64
(-
(/ 0.5 n)
(-
(*
(*
(cbrt (/ 0.16666666666666666 (* n n)))
(cbrt (/ 0.16666666666666666 (* n n))))
(cbrt
(/ (sqrt 0.16666666666666666) (/ n (/ (sqrt 0.16666666666666666) n)))))
(log n))))double code(double n) {
return (((n + 1.0) * log(n + 1.0)) - (n * log(n))) - 1.0;
}
double code(double n) {
return (0.5 / n) - (((cbrt(0.16666666666666666 / (n * n)) * cbrt(0.16666666666666666 / (n * n))) * cbrt(sqrt(0.16666666666666666) / (n / (sqrt(0.16666666666666666) / n)))) - log(n));
}




Bits error versus n
Results
| Original | 63.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 63.0
Taylor expanded around inf 0.0
Simplified0.0
Taylor expanded around 0 0.0
Simplified0.0
rmApplied add-cube-cbrt_binary64_4540.0
rmApplied add-sqr-sqrt_binary64_4410.0
Applied associate-/l*_binary64_3640.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020338
(FPCore (n)
:name "logs (example 3.8)"
:precision binary64
:pre (> n 6.8e+15)
:herbie-target
(- (log (+ n 1.0)) (- (/ 1.0 (* 2.0 n)) (- (/ 1.0 (* 3.0 (* n n))) (/ 4.0 (pow n 3.0)))))
(- (- (* (+ n 1.0) (log (+ n 1.0))) (* n (log n))) 1.0))