Average Error: 15.3 → 0.0
Time: 4.7s
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 r334383 = x;
        double r334384 = y;
        double r334385 = r334383 - r334384;
        double r334386 = 2.0;
        double r334387 = r334383 * r334386;
        double r334388 = r334387 * r334384;
        double r334389 = r334385 / r334388;
        return r334389;
}

double f(double x, double y) {
        double r334390 = 1.0;
        double r334391 = 2.0;
        double r334392 = r334390 / r334391;
        double r334393 = y;
        double r334394 = r334392 / r334393;
        double r334395 = x;
        double r334396 = r334395 * r334391;
        double r334397 = r334390 / r334396;
        double r334398 = r334394 - r334397;
        return r334398;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original15.3
Target0.0
Herbie0.0
\[\frac{0.5}{y} - \frac{0.5}{x}\]

Derivation

  1. Initial program 15.3

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

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

    \[\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 2019326 
(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)))