\log \left(N + 1\right) - \log N
\begin{array}{l}
\mathbf{if}\;\log \left(N + 1\right) - \log N \leq 1.9136352946702573 \cdot 10^{-07}:\\
\;\;\;\;\frac{1}{N} \cdot \left(1 + \frac{-0.5 + \frac{0.3333333333333333}{N}}{N}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\sqrt[3]{N + 1} \cdot \sqrt[3]{N + 1}\right) + \left(\log \left(\sqrt[3]{N + 1}\right) - \log N\right)\\
\end{array}(FPCore (N) :precision binary64 (- (log (+ N 1.0)) (log N)))
(FPCore (N)
:precision binary64
(if (<= (- (log (+ N 1.0)) (log N)) 1.9136352946702573e-07)
(* (/ 1.0 N) (+ 1.0 (/ (+ -0.5 (/ 0.3333333333333333 N)) N)))
(+
(log (* (cbrt (+ N 1.0)) (cbrt (+ N 1.0))))
(- (log (cbrt (+ N 1.0))) (log N)))))double code(double N) {
return log(N + 1.0) - log(N);
}
double code(double N) {
double tmp;
if ((log(N + 1.0) - log(N)) <= 1.9136352946702573e-07) {
tmp = (1.0 / N) * (1.0 + ((-0.5 + (0.3333333333333333 / N)) / N));
} else {
tmp = log(cbrt(N + 1.0) * cbrt(N + 1.0)) + (log(cbrt(N + 1.0)) - log(N));
}
return tmp;
}



Bits error versus N
Results
if (-.f64 (log.f64 (+.f64 N 1)) (log.f64 N)) < 1.913635295e-7Initial program 59.9
rmApplied diff-log_binary6459.8
Simplified59.8
Taylor expanded around inf 0.0
Simplified0.0
if 1.913635295e-7 < (-.f64 (log.f64 (+.f64 N 1)) (log.f64 N)) Initial program 0.3
rmApplied add-cube-cbrt_binary640.3
Applied log-prod_binary640.3
Applied associate--l+_binary640.3
Final simplification0.1
herbie shell --seed 2021174
(FPCore (N)
:name "2log (problem 3.3.6)"
:precision binary64
(- (log (+ N 1.0)) (log N)))