Average Error: 0.0 → 0.0
Time: 11.6s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\frac{1}{\frac{x}{x + y} - \frac{y}{x + y}}\]
\frac{x + y}{x - y}
\frac{1}{\frac{x}{x + y} - \frac{y}{x + y}}
double f(double x, double y) {
        double r442244 = x;
        double r442245 = y;
        double r442246 = r442244 + r442245;
        double r442247 = r442244 - r442245;
        double r442248 = r442246 / r442247;
        return r442248;
}

double f(double x, double y) {
        double r442249 = 1.0;
        double r442250 = x;
        double r442251 = y;
        double r442252 = r442250 + r442251;
        double r442253 = r442250 / r442252;
        double r442254 = r442251 / r442252;
        double r442255 = r442253 - r442254;
        double r442256 = r442249 / r442255;
        return r442256;
}

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. Using strategy rm
  5. Applied div-sub0.0

    \[\leadsto \frac{1}{\color{blue}{\frac{x}{x + y} - \frac{y}{x + y}}}\]
  6. Simplified0.0

    \[\leadsto \frac{1}{\color{blue}{\frac{x}{y + x}} - \frac{y}{x + y}}\]
  7. Simplified0.0

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

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

Reproduce

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