Average Error: 0.0 → 0.0
Time: 12.4s
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 r21017515 = x;
        double r21017516 = y;
        double r21017517 = r21017515 + r21017516;
        double r21017518 = r21017515 - r21017516;
        double r21017519 = r21017517 / r21017518;
        return r21017519;
}

double f(double x, double y) {
        double r21017520 = 1.0;
        double r21017521 = x;
        double r21017522 = y;
        double r21017523 = r21017521 - r21017522;
        double r21017524 = r21017521 + r21017522;
        double r21017525 = r21017523 / r21017524;
        double r21017526 = r21017520 / r21017525;
        return r21017526;
}

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 2019169 +o rules:numerics
(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)))