Average Error: 7.8 → 4.6
Time: 3.6s
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 2.12089080810546861 \cdot 10^{-4}:\\ \;\;\;\;\frac{\log \left(e^{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}\right)}{\sqrt[3]{{\left(\frac{x0}{1 - x1}\right)}^{3}} + 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 2.12089080810546861 \cdot 10^{-4}:\\
\;\;\;\;\frac{\log \left(e^{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}\right)}{\sqrt[3]{{\left(\frac{x0}{1 - x1}\right)}^{3}} + 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 r200313 = x0;
        double r200314 = 1.0;
        double r200315 = x1;
        double r200316 = r200314 - r200315;
        double r200317 = r200313 / r200316;
        double r200318 = r200317 - r200313;
        return r200318;
}

double f(double x0, double x1) {
        double r200319 = x1;
        double r200320 = 0.00021208908081054686;
        bool r200321 = r200319 <= r200320;
        double r200322 = x0;
        double r200323 = 1.0;
        double r200324 = r200323 - r200319;
        double r200325 = r200322 / r200324;
        double r200326 = sqrt(r200322);
        double r200327 = sqrt(r200324);
        double r200328 = r200326 / r200327;
        double r200329 = r200328 * r200328;
        double r200330 = r200325 * r200329;
        double r200331 = r200322 * r200322;
        double r200332 = r200330 - r200331;
        double r200333 = exp(r200332);
        double r200334 = log(r200333);
        double r200335 = 3.0;
        double r200336 = pow(r200325, r200335);
        double r200337 = cbrt(r200336);
        double r200338 = r200337 + r200322;
        double r200339 = r200334 / r200338;
        double r200340 = r200325 * r200325;
        double r200341 = r200340 - r200331;
        double r200342 = exp(r200341);
        double r200343 = log(r200342);
        double r200344 = r200325 + r200322;
        double r200345 = r200343 / r200344;
        double r200346 = r200321 ? r200339 : r200345;
        return r200346;
}

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.8
Target0.3
Herbie4.6
\[\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-sqr-sqrt8.1

      \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \frac{\color{blue}{\sqrt{x0} \cdot \sqrt{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{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{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{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{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{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{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{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{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{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}\right)}}{\frac{x0}{1 - x1} + x0}\]
    13. Using strategy rm
    14. Applied add-cbrt-cube7.4

      \[\leadsto \frac{\log \left(e^{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}\right)}{\frac{x0}{\color{blue}{\sqrt[3]{\left(\left(1 - x1\right) \cdot \left(1 - x1\right)\right) \cdot \left(1 - x1\right)}}} + x0}\]
    15. Applied add-cbrt-cube7.4

      \[\leadsto \frac{\log \left(e^{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}\right)}{\frac{\color{blue}{\sqrt[3]{\left(x0 \cdot x0\right) \cdot x0}}}{\sqrt[3]{\left(\left(1 - x1\right) \cdot \left(1 - x1\right)\right) \cdot \left(1 - x1\right)}} + x0}\]
    16. Applied cbrt-undiv7.4

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

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

    if 0.00021208908081054686 < 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-log-exp3.2

      \[\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.2

      \[\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. Simplified2.0

      \[\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.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \le 2.12089080810546861 \cdot 10^{-4}:\\ \;\;\;\;\frac{\log \left(e^{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}\right)}{\sqrt[3]{{\left(\frac{x0}{1 - x1}\right)}^{3}} + 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 2020003 
(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))