Average Error: 7.9 → 4.7
Time: 3.3s
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[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 2.12089080810546861 \cdot 10^{-4}:\\
\;\;\;\;\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 r277796 = x0;
        double r277797 = 1.0;
        double r277798 = x1;
        double r277799 = r277797 - r277798;
        double r277800 = r277796 / r277799;
        double r277801 = r277800 - r277796;
        return r277801;
}

double f(double x0, double x1) {
        double r277802 = x1;
        double r277803 = 0.00021208908081054686;
        bool r277804 = r277802 <= r277803;
        double r277805 = x0;
        double r277806 = 1.0;
        double r277807 = r277806 - r277802;
        double r277808 = r277805 / r277807;
        double r277809 = cbrt(r277805);
        double r277810 = r277809 * r277809;
        double r277811 = sqrt(r277807);
        double r277812 = r277810 / r277811;
        double r277813 = r277809 / r277811;
        double r277814 = r277812 * r277813;
        double r277815 = r277808 * r277814;
        double r277816 = r277805 * r277805;
        double r277817 = r277815 - r277816;
        double r277818 = exp(r277817);
        double r277819 = log(r277818);
        double r277820 = r277808 + r277805;
        double r277821 = r277819 / r277820;
        double r277822 = r277808 * r277808;
        double r277823 = r277822 - r277816;
        double r277824 = exp(r277823);
        double r277825 = log(r277824);
        double r277826 = r277825 / r277820;
        double r277827 = r277804 ? r277821 : r277826;
        return r277827;
}

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.0

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

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

      \[\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.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) - \color{blue}{\log \left(e^{x0 \cdot x0}\right)}}{\frac{x0}{1 - x1} + x0}\]
    10. Applied add-log-exp8.0

      \[\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 2.12089080810546861 \cdot 10^{-4}:\\ \;\;\;\;\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 2020060 
(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))