Average Error: 8.4 → 4.4
Time: 3.0s
Precision: binary64
\[x0 = 1.855 \land x1 = 0.000209 \lor x0 = 2.985 \land x1 = 0.0186\]
\[\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}}}
(FPCore (x0 x1) :precision binary64 (- (/ x0 (- 1.0 x1)) x0))
(FPCore (x0 x1)
 :precision binary64
 (/
  (* x0 (log (exp (- (/ x0 (+ 1.0 (* x1 (+ x1 -2.0)))) x0))))
  (+ x0 (/ 1.0 (/ (- 1.0 x1) x0)))))
double code(double x0, double x1) {
	return (x0 / (1.0 - x1)) - x0;
}
double code(double x0, double x1) {
	return (x0 * log(exp((x0 / (1.0 + (x1 * (x1 + -2.0)))) - x0))) / (x0 + (1.0 / ((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--_binary647.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(1 + {x1}^{2}\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-exp_binary645.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-exp_binary645.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-log_binary646.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-num_binary644.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 2020274 
(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))