\log \left(N + 1\right) - \log N
\begin{array}{l}
\mathbf{if}\;\log \left(N + 1\right) - \log N \leq 7.898638761361099 \cdot 10^{-05}:\\
\;\;\;\;\left(\frac{0.3333333333333333}{{N}^{3}} + \frac{1}{N}\right) - \frac{0.5}{N \cdot N}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\log \left(N + 1\right)} \cdot \sqrt{\log \left(N + 1\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)) 7.898638761361099e-05) (- (+ (/ 0.3333333333333333 (pow N 3.0)) (/ 1.0 N)) (/ 0.5 (* N N))) (- (* (sqrt (log (+ N 1.0))) (sqrt (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)) <= 7.898638761361099e-05) {
tmp = ((0.3333333333333333 / pow(N, 3.0)) + (1.0 / N)) - (0.5 / (N * N));
} else {
tmp = (sqrt(log(N + 1.0)) * sqrt(log(N + 1.0))) - log(N);
}
return tmp;
}



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