Average Error: 15.6 → 0.0
Time: 7.6s
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 r583441 = x;
        double r583442 = y;
        double r583443 = r583441 - r583442;
        double r583444 = 2.0;
        double r583445 = r583441 * r583444;
        double r583446 = r583445 * r583442;
        double r583447 = r583443 / r583446;
        return r583447;
}

double f(double x, double y) {
        double r583448 = 1.0;
        double r583449 = 2.0;
        double r583450 = r583448 / r583449;
        double r583451 = y;
        double r583452 = r583450 / r583451;
        double r583453 = x;
        double r583454 = r583453 * r583449;
        double r583455 = r583448 / r583454;
        double r583456 = r583452 - r583455;
        return r583456;
}

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.6
Target0.0
Herbie0.0
\[\frac{0.5}{y} - \frac{0.5}{x}\]

Derivation

  1. Initial program 15.6

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

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

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