Average Error: 15.2 → 0.0
Time: 795.0ms
Precision: 64
\[\frac{x - y}{\left(x \cdot 2\right) \cdot y}\]
\[\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}\]
\frac{x - y}{\left(x \cdot 2\right) \cdot y}
\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}
double f(double x, double y) {
        double r2019589 = x;
        double r2019590 = y;
        double r2019591 = r2019589 - r2019590;
        double r2019592 = 2.0;
        double r2019593 = r2019589 * r2019592;
        double r2019594 = r2019593 * r2019590;
        double r2019595 = r2019591 / r2019594;
        return r2019595;
}

double f(double x, double y) {
        double r2019596 = 1.0;
        double r2019597 = 2.0;
        double r2019598 = y;
        double r2019599 = r2019597 * r2019598;
        double r2019600 = r2019596 / r2019599;
        double r2019601 = x;
        double r2019602 = r2019601 * r2019597;
        double r2019603 = r2019596 / r2019602;
        double r2019604 = r2019600 - r2019603;
        return r2019604;
}

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

Derivation

  1. Initial program 15.2

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

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

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

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

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

Reproduce

herbie shell --seed 2020018 +o rules:numerics
(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)))