Average Error: 0.0 → 0.0
Time: 11.4s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\frac{\frac{1}{x - y}}{\frac{1}{y + x}}\]
\frac{x + y}{x - y}
\frac{\frac{1}{x - y}}{\frac{1}{y + x}}
double f(double x, double y) {
        double r337392 = x;
        double r337393 = y;
        double r337394 = r337392 + r337393;
        double r337395 = r337392 - r337393;
        double r337396 = r337394 / r337395;
        return r337396;
}

double f(double x, double y) {
        double r337397 = 1.0;
        double r337398 = x;
        double r337399 = y;
        double r337400 = r337398 - r337399;
        double r337401 = r337397 / r337400;
        double r337402 = r337399 + r337398;
        double r337403 = r337397 / r337402;
        double r337404 = r337401 / r337403;
        return r337404;
}

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. Simplified0.0

    \[\leadsto \frac{1}{\color{blue}{\frac{x - y}{y + x}}}\]
  5. Using strategy rm
  6. Applied div-inv0.2

    \[\leadsto \frac{1}{\color{blue}{\left(x - y\right) \cdot \frac{1}{y + x}}}\]
  7. Applied associate-/r*0.0

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

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

Reproduce

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