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



Bits error versus N
Results
if (-.f64 (log.f64 (+.f64 N 1)) (log.f64 N)) < 2.52123363129e-5Initial program 59.5
Taylor expanded around inf 0.0
Simplified0.0
if 2.52123363129e-5 < (-.f64 (log.f64 (+.f64 N 1)) (log.f64 N)) Initial program 0.1
rmApplied add-cbrt-cube_binary64_1140.1
Final simplification0.1
herbie shell --seed 2021077
(FPCore (N)
:name "2log (problem 3.3.6)"
:precision binary64
(- (log (+ N 1.0)) (log N)))