Average Error: 7.9 → 4.7
Time: 8.8s
Precision: 64
\[x0 = 1.854999999999999982236431605997495353222 \land x1 = 2.090000000000000115064208161541614572343 \cdot 10^{-4} \lor x0 = 2.984999999999999875655021241982467472553 \land x1 = 0.01859999999999999847899445626353553961962\]
\[\frac{x0}{1 - x1} - x0\]
\[\begin{array}{l} \mathbf{if}\;x1 \le \frac{7824705989080923}{36893488147419103232}:\\ \;\;\;\;\frac{\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) - x0 \cdot x0}\right)}{\frac{x0}{1 - x1} + x0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\log \left(e^{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} - x0 \cdot x0}\right)}{\frac{x0}{1 - x1} + x0}\\ \end{array}\]
\frac{x0}{1 - x1} - x0
\begin{array}{l}
\mathbf{if}\;x1 \le \frac{7824705989080923}{36893488147419103232}:\\
\;\;\;\;\frac{\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) - x0 \cdot x0}\right)}{\frac{x0}{1 - x1} + x0}\\

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

\end{array}
double f(double x0, double x1) {
        double r148413 = x0;
        double r148414 = 1.0;
        double r148415 = x1;
        double r148416 = r148414 - r148415;
        double r148417 = r148413 / r148416;
        double r148418 = r148417 - r148413;
        return r148418;
}

double f(double x0, double x1) {
        double r148419 = x1;
        double r148420 = 7824705989080923.0;
        double r148421 = 3.6893488147419103e+19;
        double r148422 = r148420 / r148421;
        bool r148423 = r148419 <= r148422;
        double r148424 = x0;
        double r148425 = 1.0;
        double r148426 = r148425 - r148419;
        double r148427 = r148424 / r148426;
        double r148428 = cbrt(r148424);
        double r148429 = r148428 * r148428;
        double r148430 = sqrt(r148426);
        double r148431 = r148429 / r148430;
        double r148432 = r148428 / r148430;
        double r148433 = r148431 * r148432;
        double r148434 = r148427 * r148433;
        double r148435 = r148424 * r148424;
        double r148436 = r148434 - r148435;
        double r148437 = exp(r148436);
        double r148438 = log(r148437);
        double r148439 = r148427 + r148424;
        double r148440 = r148438 / r148439;
        double r148441 = r148427 * r148427;
        double r148442 = r148441 - r148435;
        double r148443 = exp(r148442);
        double r148444 = log(r148443);
        double r148445 = r148444 / r148439;
        double r148446 = r148423 ? r148440 : r148445;
        return r148446;
}

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.2
Herbie4.7
\[\frac{x0 \cdot x1}{1 - x1}\]

Derivation

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

    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 add-log-exp8.1

      \[\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 - x1} + x0}\]
    10. Applied add-log-exp8.1

      \[\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 - x1} + x0}\]
    11. Applied diff-log7.4

      \[\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 - x1} + x0}\]
    12. Simplified7.4

      \[\leadsto \frac{\log \color{blue}{\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) - x0 \cdot x0}\right)}}{\frac{x0}{1 - x1} + x0}\]

    if 0.00021208908081054686 < x1

    1. Initial program 4.5

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

      \[\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-log-exp3.1

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} - \color{blue}{\log \left(e^{x0 \cdot x0}\right)}}{\frac{x0}{1 - x1} + x0}\]
    6. Applied add-log-exp3.1

      \[\leadsto \frac{\color{blue}{\log \left(e^{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1}}\right)} - \log \left(e^{x0 \cdot x0}\right)}{\frac{x0}{1 - x1} + x0}\]
    7. Applied diff-log3.5

      \[\leadsto \frac{\color{blue}{\log \left(\frac{e^{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1}}}{e^{x0 \cdot x0}}\right)}}{\frac{x0}{1 - x1} + x0}\]
    8. Simplified1.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \le \frac{7824705989080923}{36893488147419103232}:\\ \;\;\;\;\frac{\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) - x0 \cdot x0}\right)}{\frac{x0}{1 - x1} + x0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\log \left(e^{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} - x0 \cdot x0}\right)}{\frac{x0}{1 - x1} + x0}\\ \end{array}\]

Reproduce

herbie shell --seed 2019303 
(FPCore (x0 x1)
  :name "(- (/ x0 (- 1 x1)) x0)"
  :precision binary64
  :pre (or (and (== x0 1.855) (== x1 2.09000000000000012e-4)) (and (== x0 2.98499999999999988) (== x1 0.018599999999999998)))

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

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