\log \left(N + 1\right) - \log N
\begin{array}{l}
\mathbf{if}\;N \le 4842.291926013775:\\
\;\;\;\;\log \left(\frac{\sqrt{1 + N}}{N}\right) + \log \left(\sqrt{1 + N}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{3}, \frac{\frac{\frac{1}{N}}{N}}{N}, \mathsf{fma}\left(\frac{-1}{2}, \frac{\frac{1}{N}}{N}, \frac{1}{N}\right)\right)\\
\end{array}double f(double N) {
double r2167963 = N;
double r2167964 = 1.0;
double r2167965 = r2167963 + r2167964;
double r2167966 = log(r2167965);
double r2167967 = log(r2167963);
double r2167968 = r2167966 - r2167967;
return r2167968;
}
double f(double N) {
double r2167969 = N;
double r2167970 = 4842.291926013775;
bool r2167971 = r2167969 <= r2167970;
double r2167972 = 1.0;
double r2167973 = r2167972 + r2167969;
double r2167974 = sqrt(r2167973);
double r2167975 = r2167974 / r2167969;
double r2167976 = log(r2167975);
double r2167977 = log(r2167974);
double r2167978 = r2167976 + r2167977;
double r2167979 = 0.3333333333333333;
double r2167980 = r2167972 / r2167969;
double r2167981 = r2167980 / r2167969;
double r2167982 = r2167981 / r2167969;
double r2167983 = -0.5;
double r2167984 = fma(r2167983, r2167981, r2167980);
double r2167985 = fma(r2167979, r2167982, r2167984);
double r2167986 = r2167971 ? r2167978 : r2167985;
return r2167986;
}



Bits error versus N
if N < 4842.291926013775Initial program 0.1
Simplified0.1
rmApplied log1p-udef0.1
Applied diff-log0.1
rmApplied *-un-lft-identity0.1
Applied add-sqr-sqrt0.1
Applied times-frac0.1
Applied log-prod0.1
Simplified0.1
if 4842.291926013775 < N Initial program 59.4
Simplified59.4
Taylor expanded around inf 0.0
Simplified0.0
Final simplification0.1
herbie shell --seed 2019163 +o rules:numerics
(FPCore (N)
:name "2log (problem 3.3.6)"
(- (log (+ N 1)) (log N)))