Average Error: 8.4 → 4.4
Time: 2.6s
Precision: binary64
\[x0 = 1.855 \land x1 = 2.09000000000000012 \cdot 10^{-4} \lor x0 = 2.98499999999999988 \land x1 = 0.018599999999999998\]
\[\frac{x0}{1 - x1} - x0\]
\[\frac{x0 \cdot \log \left(e^{\frac{x0}{1 + x1 \cdot \left(x1 - 2\right)} - x0}\right)}{x0 + \frac{1}{\frac{1 - x1}{x0}}}\]
\frac{x0}{1 - x1} - x0
\frac{x0 \cdot \log \left(e^{\frac{x0}{1 + x1 \cdot \left(x1 - 2\right)} - x0}\right)}{x0 + \frac{1}{\frac{1 - x1}{x0}}}
double code(double x0, double x1) {
	return ((double) (((double) (x0 / ((double) (1.0 - x1)))) - x0));
}
double code(double x0, double x1) {
	return ((double) (((double) (x0 * ((double) log(((double) exp(((double) (((double) (x0 / ((double) (1.0 + ((double) (x1 * ((double) (x1 - 2.0)))))))) - x0)))))))) / ((double) (x0 + ((double) (1.0 / ((double) (((double) (1.0 - x1)) / x0))))))));
}

Error

Bits error versus x0

Bits error versus x1

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original8.4
Target0.5
Herbie4.4
\[\frac{x0 \cdot x1}{1 - x1}\]

Derivation

  1. Initial program 8.4

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

    \[\leadsto \color{blue}{\frac{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}}\]
  4. Simplified6.9

    \[\leadsto \frac{\color{blue}{x0 \cdot \left(\frac{x0}{\left(1 - x1\right) \cdot \left(1 - x1\right)} - x0\right)}}{\frac{x0}{1 - x1} + x0}\]
  5. Simplified6.9

    \[\leadsto \frac{x0 \cdot \left(\frac{x0}{\left(1 - x1\right) \cdot \left(1 - x1\right)} - x0\right)}{\color{blue}{x0 + \frac{x0}{1 - x1}}}\]
  6. Taylor expanded around 0 7.1

    \[\leadsto \frac{x0 \cdot \left(\frac{x0}{\color{blue}{\left({x1}^{2} + 1\right) - 2 \cdot x1}} - x0\right)}{x0 + \frac{x0}{1 - x1}}\]
  7. Simplified5.9

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

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

    \[\leadsto \frac{x0 \cdot \left(\color{blue}{\log \left(e^{\frac{x0}{1 + x1 \cdot \left(x1 - 2\right)}}\right)} - \log \left(e^{x0}\right)\right)}{x0 + \frac{x0}{1 - x1}}\]
  11. Applied diff-log6.4

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

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

    \[\leadsto \frac{x0 \cdot \log \left(e^{\frac{x0}{1 + x1 \cdot \left(x1 - 2\right)} - x0}\right)}{x0 + \color{blue}{\frac{1}{\frac{1 - x1}{x0}}}}\]
  15. Final simplification4.4

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

Reproduce

herbie shell --seed 2020184 
(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.0 x1))

  (- (/ x0 (- 1.0 x1)) x0))