Average Error: 0.0 → 0.0
Time: 10.9s
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 r206534 = x;
        double r206535 = y;
        double r206536 = r206534 + r206535;
        double r206537 = r206534 - r206535;
        double r206538 = r206536 / r206537;
        return r206538;
}

double f(double x, double y) {
        double r206539 = 1.0;
        double r206540 = x;
        double r206541 = y;
        double r206542 = r206540 - r206541;
        double r206543 = r206540 + r206541;
        double r206544 = r206542 / r206543;
        double r206545 = r206539 / r206544;
        return r206545;
}

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 2020042 
(FPCore (x y)
  :name "Linear.Projection:perspective from linear-1.19.1.3, A"
  :precision binary64

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

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