Average Error: 7.9 → 7.9
Time: 8.5s
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\]
\[\frac{x0}{1 - x1} - x0\]
\frac{x0}{1 - x1} - x0
\frac{x0}{1 - x1} - x0
double f(double x0, double x1) {
        double r158680 = x0;
        double r158681 = 1.0;
        double r158682 = x1;
        double r158683 = r158681 - r158682;
        double r158684 = r158680 / r158683;
        double r158685 = r158684 - r158680;
        return r158685;
}

double f(double x0, double x1) {
        double r158686 = x0;
        double r158687 = 1.0;
        double r158688 = x1;
        double r158689 = r158687 - r158688;
        double r158690 = r158686 / r158689;
        double r158691 = r158690 - r158686;
        return r158691;
}

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
Herbie7.9
\[\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-sqr-sqrt8.0

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

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

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

      \[\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}\]

    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 simplification7.9

    \[\leadsto \frac{x0}{1 - x1} - x0\]

Reproduce

herbie shell --seed 2019297 
(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))