Average Error: 40.7 → 0.8
Time: 13.4s
Precision: 64
$\frac{1}{\log \left(1 + x\right)}$
$\begin{array}{l} \mathbf{if}\;1 + x \le 1.000000000000006439293542825907934457064:\\ \;\;\;\;\frac{1}{\left(1 \cdot x + \log 1\right) - \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{\log \left(1 + x\right)}} \cdot \sqrt{\frac{1}{\log \left(1 + x\right)}}\\ \end{array}$
\frac{1}{\log \left(1 + x\right)}
\begin{array}{l}
\mathbf{if}\;1 + x \le 1.000000000000006439293542825907934457064:\\
\;\;\;\;\frac{1}{\left(1 \cdot x + \log 1\right) - \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{1}{\log \left(1 + x\right)}} \cdot \sqrt{\frac{1}{\log \left(1 + x\right)}}\\

\end{array}
double f(double x) {
double r1134154 = 1.0;
double r1134155 = x;
double r1134156 = r1134154 + r1134155;
double r1134157 = log(r1134156);
double r1134158 = r1134154 / r1134157;
return r1134158;
}


double f(double x) {
double r1134159 = 1.0;
double r1134160 = x;
double r1134161 = r1134159 + r1134160;
double r1134162 = 1.0000000000000064;
bool r1134163 = r1134161 <= r1134162;
double r1134164 = r1134159 * r1134160;
double r1134165 = log(r1134159);
double r1134166 = r1134164 + r1134165;
double r1134167 = 0.5;
double r1134168 = 2.0;
double r1134169 = pow(r1134160, r1134168);
double r1134170 = pow(r1134159, r1134168);
double r1134171 = r1134169 / r1134170;
double r1134172 = r1134167 * r1134171;
double r1134173 = r1134166 - r1134172;
double r1134174 = r1134159 / r1134173;
double r1134175 = log(r1134161);
double r1134176 = r1134159 / r1134175;
double r1134177 = sqrt(r1134176);
double r1134178 = r1134177 * r1134177;
double r1134179 = r1134163 ? r1134174 : r1134178;
return r1134179;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

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

1. Initial program 62.8

$\frac{1}{\log \left(1 + x\right)}$
2. Taylor expanded around 0 0.4

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

## if 1.0000000000000064 < (+ 1.0 x)

1. Initial program 1.2

$\frac{1}{\log \left(1 + x\right)}$
2. Using strategy rm

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

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

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "1/log(1+x)"
:precision binary64
(/ 1 (log (+ 1 x))))