Average Error: 0.0 → 0.0
Time: 10.7s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\frac{\frac{1}{x - y}}{\frac{1}{x + y}}\]
\frac{x + y}{x - y}
\frac{\frac{1}{x - y}}{\frac{1}{x + y}}
double f(double x, double y) {
        double r468723 = x;
        double r468724 = y;
        double r468725 = r468723 + r468724;
        double r468726 = r468723 - r468724;
        double r468727 = r468725 / r468726;
        return r468727;
}

double f(double x, double y) {
        double r468728 = 1.0;
        double r468729 = x;
        double r468730 = y;
        double r468731 = r468729 - r468730;
        double r468732 = r468728 / r468731;
        double r468733 = r468729 + r468730;
        double r468734 = r468728 / r468733;
        double r468735 = r468732 / r468734;
        return r468735;
}

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

    \[\leadsto \color{blue}{\frac{y + x}{x - y}}\]
  3. Using strategy rm
  4. Applied clear-num0.0

    \[\leadsto \color{blue}{\frac{1}{\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}{x + y}}\]

Reproduce

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