Average Error: 33.1 → 0.7
Time: 15.2s
Precision: 64
\[x + \frac{\log \left(1 - x\right)}{\log 10}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{\log \left(1 - x\right)}{\log 10} \le -4.101769287731168843079074259883043396258 \cdot 10^{-5}:\\ \;\;\;\;\sqrt[3]{\frac{\log \left(1 - x\right)}{\log 10}} \cdot \left(\sqrt[3]{\frac{\log \left(1 - x\right)}{\log 10}} \cdot \sqrt[3]{\frac{\log \left(1 - x\right)}{\log 10}}\right) + x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\log 10}{\left(\log 1 - \left(\frac{1}{2} \cdot \frac{x}{1}\right) \cdot \frac{x}{1}\right) - 1 \cdot x}} + x\\ \end{array}\]
x + \frac{\log \left(1 - x\right)}{\log 10}
\begin{array}{l}
\mathbf{if}\;x + \frac{\log \left(1 - x\right)}{\log 10} \le -4.101769287731168843079074259883043396258 \cdot 10^{-5}:\\
\;\;\;\;\sqrt[3]{\frac{\log \left(1 - x\right)}{\log 10}} \cdot \left(\sqrt[3]{\frac{\log \left(1 - x\right)}{\log 10}} \cdot \sqrt[3]{\frac{\log \left(1 - x\right)}{\log 10}}\right) + x\\

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

\end{array}
double f(double x) {
        double r33040433 = x;
        double r33040434 = 1.0;
        double r33040435 = r33040434 - r33040433;
        double r33040436 = log(r33040435);
        double r33040437 = 10.0;
        double r33040438 = log(r33040437);
        double r33040439 = r33040436 / r33040438;
        double r33040440 = r33040433 + r33040439;
        return r33040440;
}

double f(double x) {
        double r33040441 = x;
        double r33040442 = 1.0;
        double r33040443 = r33040442 - r33040441;
        double r33040444 = log(r33040443);
        double r33040445 = 10.0;
        double r33040446 = log(r33040445);
        double r33040447 = r33040444 / r33040446;
        double r33040448 = r33040441 + r33040447;
        double r33040449 = -4.101769287731169e-05;
        bool r33040450 = r33040448 <= r33040449;
        double r33040451 = cbrt(r33040447);
        double r33040452 = r33040451 * r33040451;
        double r33040453 = r33040451 * r33040452;
        double r33040454 = r33040453 + r33040441;
        double r33040455 = 1.0;
        double r33040456 = log(r33040442);
        double r33040457 = 0.5;
        double r33040458 = r33040441 / r33040442;
        double r33040459 = r33040457 * r33040458;
        double r33040460 = r33040459 * r33040458;
        double r33040461 = r33040456 - r33040460;
        double r33040462 = r33040442 * r33040441;
        double r33040463 = r33040461 - r33040462;
        double r33040464 = r33040446 / r33040463;
        double r33040465 = r33040455 / r33040464;
        double r33040466 = r33040465 + r33040441;
        double r33040467 = r33040450 ? r33040454 : r33040466;
        return r33040467;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (+ x (/ (log (- 1.0 x)) (log 10.0))) < -4.101769287731169e-05

    1. Initial program 0.1

      \[x + \frac{\log \left(1 - x\right)}{\log 10}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt0.1

      \[\leadsto x + \color{blue}{\left(\sqrt[3]{\frac{\log \left(1 - x\right)}{\log 10}} \cdot \sqrt[3]{\frac{\log \left(1 - x\right)}{\log 10}}\right) \cdot \sqrt[3]{\frac{\log \left(1 - x\right)}{\log 10}}}\]

    if -4.101769287731169e-05 < (+ x (/ (log (- 1.0 x)) (log 10.0)))

    1. Initial program 50.4

      \[x + \frac{\log \left(1 - x\right)}{\log 10}\]
    2. Taylor expanded around 0 1.0

      \[\leadsto x + \frac{\color{blue}{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}}{\log 10}\]
    3. Simplified1.0

      \[\leadsto x + \frac{\color{blue}{\left(\log 1 - \left(\frac{1}{2} \cdot \frac{x}{1}\right) \cdot \frac{x}{1}\right) - x \cdot 1}}{\log 10}\]
    4. Using strategy rm
    5. Applied clear-num1.0

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

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

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "(x + (log(1-x) / log(10)))"
  (+ x (/ (log (- 1.0 x)) (log 10.0))))