Average Error: 14.9 → 0.0
Time: 16.4s
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 r350936 = x;
        double r350937 = y;
        double r350938 = r350936 - r350937;
        double r350939 = 2.0;
        double r350940 = r350936 * r350939;
        double r350941 = r350940 * r350937;
        double r350942 = r350938 / r350941;
        return r350942;
}

double f(double x, double y) {
        double r350943 = 1.0;
        double r350944 = 2.0;
        double r350945 = r350943 / r350944;
        double r350946 = y;
        double r350947 = r350945 / r350946;
        double r350948 = x;
        double r350949 = r350948 * r350944;
        double r350950 = r350943 / r350949;
        double r350951 = r350947 - r350950;
        return r350951;
}

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 2019212 
(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)))