\log \left(N + 1\right) - \log N
\begin{array}{l}
\mathbf{if}\;\log \left(N + 1\right) - \log N \leq 0.0003029094019879608:\\
\;\;\;\;\left(0.3333333333333333 \cdot \frac{1}{{N}^{3}} + \frac{1}{N}\right) - \left(0.5 \cdot \frac{1}{{N}^{2}} + 0.25 \cdot \frac{1}{{N}^{4}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \log \left(\sqrt[3]{N + 1}\right) - \log \left(\sqrt{N}\right)\right) + \log \left(\frac{{\left(\sqrt[3]{\sqrt{N + 1}}\right)}^{2}}{\sqrt{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)) 0.0003029094019879608)
(-
(+ (* 0.3333333333333333 (/ 1.0 (pow N 3.0))) (/ 1.0 N))
(+ (* 0.5 (/ 1.0 (pow N 2.0))) (* 0.25 (/ 1.0 (pow N 4.0)))))
(+
(- (* 2.0 (log (cbrt (+ N 1.0)))) (log (sqrt N)))
(log (/ (pow (cbrt (sqrt (+ N 1.0))) 2.0) (sqrt 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)) <= 0.0003029094019879608) {
tmp = ((0.3333333333333333 * (1.0 / pow(N, 3.0))) + (1.0 / N)) - ((0.5 * (1.0 / pow(N, 2.0))) + (0.25 * (1.0 / pow(N, 4.0))));
} else {
tmp = ((2.0 * log(cbrt(N + 1.0))) - log(sqrt(N))) + log(pow(cbrt(sqrt(N + 1.0)), 2.0) / sqrt(N));
}
return tmp;
}



Bits error versus N
Results
if (-.f64 (log.f64 (+.f64 N 1)) (log.f64 N)) < 3.02909401988e-4Initial program 59.3
Taylor expanded around inf 0.0
if 3.02909401988e-4 < (-.f64 (log.f64 (+.f64 N 1)) (log.f64 N)) Initial program 0.1
rmApplied diff-log_binary64_1700.1
rmApplied add-sqr-sqrt_binary64_1000.1
Applied add-cube-cbrt_binary64_1130.1
Applied times-frac_binary64_840.1
Applied log-prod_binary64_1640.1
Simplified0.1
rmApplied add-sqr-sqrt_binary64_1000.1
Applied cbrt-prod_binary64_1090.1
rmApplied pow2_binary64_1590.1
Final simplification0.1
herbie shell --seed 2021044
(FPCore (N)
:name "2log (problem 3.3.6)"
:precision binary64
(- (log (+ N 1.0)) (log N)))