Average Error: 0.0 → 0.0
Time: 14.3s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\frac{1}{\frac{x - y}{x + y}}\]
\frac{x + y}{x - y}
\frac{1}{\frac{x - y}{x + y}}
double f(double x, double y) {
        double r430389 = x;
        double r430390 = y;
        double r430391 = r430389 + r430390;
        double r430392 = r430389 - r430390;
        double r430393 = r430391 / r430392;
        return r430393;
}

double f(double x, double y) {
        double r430394 = 1.0;
        double r430395 = x;
        double r430396 = y;
        double r430397 = r430395 - r430396;
        double r430398 = r430395 + r430396;
        double r430399 = r430397 / r430398;
        double r430400 = r430394 / r430399;
        return r430400;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[\frac{1}{\frac{x}{x + y} - \frac{y}{x + y}}\]

Derivation

  1. Initial program 0.0

    \[\frac{x + y}{x - y}\]
  2. Using strategy rm
  3. Applied clear-num0.0

    \[\leadsto \color{blue}{\frac{1}{\frac{x - y}{x + y}}}\]
  4. Final simplification0.0

    \[\leadsto \frac{1}{\frac{x - y}{x + y}}\]

Reproduce

herbie shell --seed 2019195 
(FPCore (x y)
  :name "Linear.Projection:perspective from linear-1.19.1.3, A"

  :herbie-target
  (/ 1.0 (- (/ x (+ x y)) (/ y (+ x y))))

  (/ (+ x y) (- x y)))