Average Error: 9.6 → 0.3
Time: 9.4s
Precision: 64
$\log \left(x + 1\right) - logx$
$\begin{array}{l} \mathbf{if}\;x + 1 \le 1.000000000184851911555483638949226588011:\\ \;\;\;\;\left(\left(1 \cdot x + \log 1\right) - \frac{x}{1} \cdot \left(\frac{1}{2} \cdot \frac{x}{1}\right)\right) - logx\\ \mathbf{else}:\\ \;\;\;\;\left(\log \left(\sqrt{x + 1}\right) + \left(\sqrt[3]{\log \left(\sqrt{x + 1}\right)} \cdot \sqrt[3]{\log \left(\sqrt{x + 1}\right)}\right) \cdot \sqrt[3]{\log \left(\sqrt{x + 1}\right)}\right) - logx\\ \end{array}$
\log \left(x + 1\right) - logx
\begin{array}{l}
\mathbf{if}\;x + 1 \le 1.000000000184851911555483638949226588011:\\
\;\;\;\;\left(\left(1 \cdot x + \log 1\right) - \frac{x}{1} \cdot \left(\frac{1}{2} \cdot \frac{x}{1}\right)\right) - logx\\

\mathbf{else}:\\
\;\;\;\;\left(\log \left(\sqrt{x + 1}\right) + \left(\sqrt[3]{\log \left(\sqrt{x + 1}\right)} \cdot \sqrt[3]{\log \left(\sqrt{x + 1}\right)}\right) \cdot \sqrt[3]{\log \left(\sqrt{x + 1}\right)}\right) - logx\\

\end{array}
double f(double x, double logx) {
double r852544 = x;
double r852545 = 1.0;
double r852546 = r852544 + r852545;
double r852547 = log(r852546);
double r852548 = logx;
double r852549 = r852547 - r852548;
return r852549;
}


double f(double x, double logx) {
double r852550 = x;
double r852551 = 1.0;
double r852552 = r852550 + r852551;
double r852553 = 1.000000000184852;
bool r852554 = r852552 <= r852553;
double r852555 = r852551 * r852550;
double r852556 = log(r852551);
double r852557 = r852555 + r852556;
double r852558 = r852550 / r852551;
double r852559 = 0.5;
double r852560 = r852559 * r852558;
double r852561 = r852558 * r852560;
double r852562 = r852557 - r852561;
double r852563 = logx;
double r852564 = r852562 - r852563;
double r852565 = sqrt(r852552);
double r852566 = log(r852565);
double r852567 = cbrt(r852566);
double r852568 = r852567 * r852567;
double r852569 = r852568 * r852567;
double r852570 = r852566 + r852569;
double r852571 = r852570 - r852563;
double r852572 = r852554 ? r852564 : r852571;
return r852572;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 2 regimes
2. ## if (+ x 1.0) < 1.000000000184852

1. Initial program 14.7

$\log \left(x + 1\right) - logx$
2. Taylor expanded around 0 0.2

$\leadsto \color{blue}{\left(\left(1 \cdot x + \log 1\right) - \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)} - logx$
3. Simplified0.2

$\leadsto \color{blue}{\left(\left(1 \cdot x + \log 1\right) - \frac{x}{1} \cdot \left(\frac{x}{1} \cdot \frac{1}{2}\right)\right)} - logx$

## if 1.000000000184852 < (+ x 1.0)

1. Initial program 0.2

$\log \left(x + 1\right) - logx$
2. Using strategy rm

$\leadsto \log \color{blue}{\left(\sqrt{x + 1} \cdot \sqrt{x + 1}\right)} - logx$
4. Applied log-prod0.3

$\leadsto \color{blue}{\left(\log \left(\sqrt{x + 1}\right) + \log \left(\sqrt{x + 1}\right)\right)} - logx$
5. Using strategy rm

$\leadsto \left(\color{blue}{\left(\sqrt[3]{\log \left(\sqrt{x + 1}\right)} \cdot \sqrt[3]{\log \left(\sqrt{x + 1}\right)}\right) \cdot \sqrt[3]{\log \left(\sqrt{x + 1}\right)}} + \log \left(\sqrt{x + 1}\right)\right) - logx$
3. Recombined 2 regimes into one program.
4. Final simplification0.3

$\leadsto \begin{array}{l} \mathbf{if}\;x + 1 \le 1.000000000184851911555483638949226588011:\\ \;\;\;\;\left(\left(1 \cdot x + \log 1\right) - \frac{x}{1} \cdot \left(\frac{1}{2} \cdot \frac{x}{1}\right)\right) - logx\\ \mathbf{else}:\\ \;\;\;\;\left(\log \left(\sqrt{x + 1}\right) + \left(\sqrt[3]{\log \left(\sqrt{x + 1}\right)} \cdot \sqrt[3]{\log \left(\sqrt{x + 1}\right)}\right) \cdot \sqrt[3]{\log \left(\sqrt{x + 1}\right)}\right) - logx\\ \end{array}$

# Reproduce

herbie shell --seed 1
(FPCore (x logx)
:name "log(x+1)-logx"
(- (log (+ x 1.0)) logx))