Average Error: 7.9 → 5.0
Time: 8.1s
Precision: 64
\[x0 = 1.855 \land x1 = 2.09000000000000012 \cdot 10^{-4} \lor x0 = 2.98499999999999988 \land x1 = 0.018599999999999998\]
\[\frac{x0}{1 - x1} - x0\]
\[\begin{array}{l} \mathbf{if}\;x1 \le 0.0182045976562499982:\\ \;\;\;\;\frac{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}{\frac{x0}{1 \cdot 1 - x1 \cdot x1} \cdot \left(1 + x1\right) + x0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\log \left(e^{\frac{x0 \cdot \frac{{\left(\sqrt[3]{x0}\right)}^{3}}{1 - x1}}{1 - x1} - x0 \cdot x0}\right)}{\frac{x0}{1 \cdot 1 - x1 \cdot x1} \cdot \left(1 + x1\right) + x0}\\ \end{array}\]
\frac{x0}{1 - x1} - x0
\begin{array}{l}
\mathbf{if}\;x1 \le 0.0182045976562499982:\\
\;\;\;\;\frac{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}{\frac{x0}{1 \cdot 1 - x1 \cdot x1} \cdot \left(1 + x1\right) + x0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\log \left(e^{\frac{x0 \cdot \frac{{\left(\sqrt[3]{x0}\right)}^{3}}{1 - x1}}{1 - x1} - x0 \cdot x0}\right)}{\frac{x0}{1 \cdot 1 - x1 \cdot x1} \cdot \left(1 + x1\right) + x0}\\

\end{array}
double f(double x0, double x1) {
        double r223388 = x0;
        double r223389 = 1.0;
        double r223390 = x1;
        double r223391 = r223389 - r223390;
        double r223392 = r223388 / r223391;
        double r223393 = r223392 - r223388;
        return r223393;
}

double f(double x0, double x1) {
        double r223394 = x1;
        double r223395 = 0.018204597656249998;
        bool r223396 = r223394 <= r223395;
        double r223397 = x0;
        double r223398 = 1.0;
        double r223399 = r223398 - r223394;
        double r223400 = r223397 / r223399;
        double r223401 = cbrt(r223397);
        double r223402 = r223401 * r223401;
        double r223403 = sqrt(r223399);
        double r223404 = r223402 / r223403;
        double r223405 = r223401 / r223403;
        double r223406 = r223404 * r223405;
        double r223407 = r223400 * r223406;
        double r223408 = r223397 * r223397;
        double r223409 = r223407 - r223408;
        double r223410 = r223398 * r223398;
        double r223411 = r223394 * r223394;
        double r223412 = r223410 - r223411;
        double r223413 = r223397 / r223412;
        double r223414 = r223398 + r223394;
        double r223415 = r223413 * r223414;
        double r223416 = r223415 + r223397;
        double r223417 = r223409 / r223416;
        double r223418 = 3.0;
        double r223419 = pow(r223401, r223418);
        double r223420 = r223419 / r223399;
        double r223421 = r223397 * r223420;
        double r223422 = r223421 / r223399;
        double r223423 = r223422 - r223408;
        double r223424 = exp(r223423);
        double r223425 = log(r223424);
        double r223426 = r223425 / r223416;
        double r223427 = r223396 ? r223417 : r223426;
        return r223427;
}

Error

Bits error versus x0

Bits error versus x1

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.9
Target0.3
Herbie5.0
\[\frac{x0 \cdot x1}{1 - x1}\]

Derivation

  1. Split input into 2 regimes
  2. if x1 < 0.018204597656249998

    1. Initial program 11.2

      \[\frac{x0}{1 - x1} - x0\]
    2. Using strategy rm
    3. Applied flip--11.4

      \[\leadsto \color{blue}{\frac{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}}\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt8.1

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \frac{x0}{\color{blue}{\sqrt{1 - x1} \cdot \sqrt{1 - x1}}} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}\]
    6. Applied add-cube-cbrt8.1

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \frac{\color{blue}{\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \sqrt[3]{x0}}}{\sqrt{1 - x1} \cdot \sqrt{1 - x1}} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}\]
    7. Applied times-frac8.1

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \color{blue}{\left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right)} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}\]
    8. Using strategy rm
    9. Applied flip--8.0

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}{\frac{x0}{\color{blue}{\frac{1 \cdot 1 - x1 \cdot x1}{1 + x1}}} + x0}\]
    10. Applied associate-/r/8.0

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}{\color{blue}{\frac{x0}{1 \cdot 1 - x1 \cdot x1} \cdot \left(1 + x1\right)} + x0}\]

    if 0.018204597656249998 < x1

    1. Initial program 4.5

      \[\frac{x0}{1 - x1} - x0\]
    2. Using strategy rm
    3. Applied flip--3.2

      \[\leadsto \color{blue}{\frac{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}}\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt3.2

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \frac{x0}{\color{blue}{\sqrt{1 - x1} \cdot \sqrt{1 - x1}}} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}\]
    6. Applied add-cube-cbrt3.2

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \frac{\color{blue}{\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \sqrt[3]{x0}}}{\sqrt{1 - x1} \cdot \sqrt{1 - x1}} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}\]
    7. Applied times-frac5.2

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \color{blue}{\left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right)} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}\]
    8. Using strategy rm
    9. Applied flip--5.2

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}{\frac{x0}{\color{blue}{\frac{1 \cdot 1 - x1 \cdot x1}{1 + x1}}} + x0}\]
    10. Applied associate-/r/5.2

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}{\color{blue}{\frac{x0}{1 \cdot 1 - x1 \cdot x1} \cdot \left(1 + x1\right)} + x0}\]
    11. Using strategy rm
    12. Applied add-log-exp5.2

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right) - \color{blue}{\log \left(e^{x0 \cdot x0}\right)}}{\frac{x0}{1 \cdot 1 - x1 \cdot x1} \cdot \left(1 + x1\right) + x0}\]
    13. Applied add-log-exp5.2

      \[\leadsto \frac{\color{blue}{\log \left(e^{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right)}\right)} - \log \left(e^{x0 \cdot x0}\right)}{\frac{x0}{1 \cdot 1 - x1 \cdot x1} \cdot \left(1 + x1\right) + x0}\]
    14. Applied diff-log5.2

      \[\leadsto \frac{\color{blue}{\log \left(\frac{e^{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right)}}{e^{x0 \cdot x0}}\right)}}{\frac{x0}{1 \cdot 1 - x1 \cdot x1} \cdot \left(1 + x1\right) + x0}\]
    15. Simplified2.0

      \[\leadsto \frac{\log \color{blue}{\left(e^{\frac{x0 \cdot \frac{{\left(\sqrt[3]{x0}\right)}^{3}}{1 - x1}}{1 - x1} - x0 \cdot x0}\right)}}{\frac{x0}{1 \cdot 1 - x1 \cdot x1} \cdot \left(1 + x1\right) + x0}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification5.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \le 0.0182045976562499982:\\ \;\;\;\;\frac{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}{\frac{x0}{1 \cdot 1 - x1 \cdot x1} \cdot \left(1 + x1\right) + x0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\log \left(e^{\frac{x0 \cdot \frac{{\left(\sqrt[3]{x0}\right)}^{3}}{1 - x1}}{1 - x1} - x0 \cdot x0}\right)}{\frac{x0}{1 \cdot 1 - x1 \cdot x1} \cdot \left(1 + x1\right) + x0}\\ \end{array}\]

Reproduce

herbie shell --seed 2020047 
(FPCore (x0 x1)
  :name "(- (/ x0 (- 1 x1)) x0)"
  :precision binary64
  :pre (or (and (== x0 1.855) (== x1 0.000209)) (and (== x0 2.985) (== x1 0.0186)))

  :herbie-target
  (/ (* x0 x1) (- 1 x1))

  (- (/ x0 (- 1 x1)) x0))