Average Error: 14.9 → 0.0
Time: 17.8s
Precision: 64
\[\frac{x - y}{\left(x \cdot 2\right) \cdot y}\]
\[\frac{\frac{1}{2}}{y} - \frac{1}{x \cdot 2}\]
\frac{x - y}{\left(x \cdot 2\right) \cdot y}
\frac{\frac{1}{2}}{y} - \frac{1}{x \cdot 2}
double f(double x, double y) {
        double r333759 = x;
        double r333760 = y;
        double r333761 = r333759 - r333760;
        double r333762 = 2.0;
        double r333763 = r333759 * r333762;
        double r333764 = r333763 * r333760;
        double r333765 = r333761 / r333764;
        return r333765;
}

double f(double x, double y) {
        double r333766 = 1.0;
        double r333767 = 2.0;
        double r333768 = r333766 / r333767;
        double r333769 = y;
        double r333770 = r333768 / r333769;
        double r333771 = x;
        double r333772 = r333771 * r333767;
        double r333773 = r333766 / r333772;
        double r333774 = r333770 - r333773;
        return r333774;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original14.9
Target0.0
Herbie0.0
\[\frac{0.5}{y} - \frac{0.5}{x}\]

Derivation

  1. Initial program 14.9

    \[\frac{x - y}{\left(x \cdot 2\right) \cdot y}\]
  2. Using strategy rm
  3. Applied div-sub14.9

    \[\leadsto \color{blue}{\frac{x}{\left(x \cdot 2\right) \cdot y} - \frac{y}{\left(x \cdot 2\right) \cdot y}}\]
  4. Simplified11.1

    \[\leadsto \color{blue}{\frac{\frac{1}{2}}{y}} - \frac{y}{\left(x \cdot 2\right) \cdot y}\]
  5. Simplified0.0

    \[\leadsto \frac{\frac{1}{2}}{y} - \color{blue}{\frac{1}{x \cdot 2}}\]
  6. Final simplification0.0

    \[\leadsto \frac{\frac{1}{2}}{y} - \frac{1}{x \cdot 2}\]

Reproduce

herbie shell --seed 2019322 
(FPCore (x y)
  :name "Linear.Projection:inversePerspective from linear-1.19.1.3, B"
  :precision binary64

  :herbie-target
  (- (/ 0.5 y) (/ 0.5 x))

  (/ (- x y) (* (* x 2) y)))