Average Error: 7.9 → 4.7
Time: 4.7s
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 2.12089080810546861321705391922876060562 \cdot 10^{-4}:\\ \;\;\;\;\frac{\log \left(e^{\left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) \cdot \frac{x0}{1 - x1} - x0 \cdot x0}\right)}{\frac{\frac{x0}{\sqrt{1} + \sqrt{x1}}}{\sqrt{1} - \sqrt{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.12089080810546861321705391922876060562 \cdot 10^{-4}:\\
\;\;\;\;\frac{\log \left(e^{\left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) \cdot \frac{x0}{1 - x1} - x0 \cdot x0}\right)}{\frac{\frac{x0}{\sqrt{1} + \sqrt{x1}}}{\sqrt{1} - \sqrt{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 r200252 = x0;
        double r200253 = 1.0;
        double r200254 = x1;
        double r200255 = r200253 - r200254;
        double r200256 = r200252 / r200255;
        double r200257 = r200256 - r200252;
        return r200257;
}

double f(double x0, double x1) {
        double r200258 = x1;
        double r200259 = 0.00021208908081054686;
        bool r200260 = r200258 <= r200259;
        double r200261 = x0;
        double r200262 = sqrt(r200261);
        double r200263 = 1.0;
        double r200264 = r200263 - r200258;
        double r200265 = sqrt(r200264);
        double r200266 = r200262 / r200265;
        double r200267 = r200266 * r200266;
        double r200268 = r200261 / r200264;
        double r200269 = r200267 * r200268;
        double r200270 = r200261 * r200261;
        double r200271 = r200269 - r200270;
        double r200272 = exp(r200271);
        double r200273 = log(r200272);
        double r200274 = sqrt(r200263);
        double r200275 = sqrt(r200258);
        double r200276 = r200274 + r200275;
        double r200277 = r200261 / r200276;
        double r200278 = r200274 - r200275;
        double r200279 = r200277 / r200278;
        double r200280 = r200279 + r200261;
        double r200281 = r200273 / r200280;
        double r200282 = r200268 * r200268;
        double r200283 = r200282 - r200270;
        double r200284 = exp(r200283);
        double r200285 = log(r200284);
        double r200286 = r200268 + r200261;
        double r200287 = r200285 / r200286;
        double r200288 = r200260 ? r200281 : r200287;
        return r200288;
}

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
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}{\color{blue}{\sqrt{1 - x1} \cdot \sqrt{1 - x1}}} \cdot \frac{x0}{1 - x1} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}\]
    6. Applied add-sqr-sqrt8.1

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

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

      \[\leadsto \frac{\left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) \cdot \frac{x0}{1 - x1} - \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^{\left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) \cdot \frac{x0}{1 - x1}}\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^{\left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) \cdot \frac{x0}{1 - x1}}}{e^{x0 \cdot x0}}\right)}}{\frac{x0}{1 - x1} + x0}\]
    12. Simplified7.4

      \[\leadsto \frac{\log \color{blue}{\left(e^{\left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) \cdot \frac{x0}{1 - x1} - x0 \cdot x0}\right)}}{\frac{x0}{1 - x1} + x0}\]
    13. Using strategy rm
    14. Applied add-sqr-sqrt7.4

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

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

      \[\leadsto \frac{\log \left(e^{\left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) \cdot \frac{x0}{1 - x1} - x0 \cdot x0}\right)}{\frac{x0}{\color{blue}{\left(\sqrt{1} + \sqrt{x1}\right) \cdot \left(\sqrt{1} - \sqrt{x1}\right)}} + x0}\]
    17. Applied associate-/r*7.4

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

    if 0.00021208908081054686 < x1

    1. Initial program 4.6

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

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