Average Error: 15.0 → 0.0
Time: 3.7s
Precision: 64
\[\frac{x - y}{\left(x \cdot 2\right) \cdot y}\]
\[\frac{1}{y \cdot 2} - \frac{1}{x \cdot 2}\]
\frac{x - y}{\left(x \cdot 2\right) \cdot y}
\frac{1}{y \cdot 2} - \frac{1}{x \cdot 2}
double f(double x, double y) {
        double r448077 = x;
        double r448078 = y;
        double r448079 = r448077 - r448078;
        double r448080 = 2.0;
        double r448081 = r448077 * r448080;
        double r448082 = r448081 * r448078;
        double r448083 = r448079 / r448082;
        return r448083;
}

double f(double x, double y) {
        double r448084 = 1.0;
        double r448085 = y;
        double r448086 = 2.0;
        double r448087 = r448085 * r448086;
        double r448088 = r448084 / r448087;
        double r448089 = x;
        double r448090 = r448089 * r448086;
        double r448091 = r448084 / r448090;
        double r448092 = r448088 - r448091;
        return r448092;
}

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

Derivation

  1. Initial program 15.0

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

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

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

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

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

Reproduce

herbie shell --seed 2019291 
(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)))