Average Error: 0.0 → 0.0
Time: 2.1s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\frac{x + y}{x - y}\]
\frac{x + y}{x - y}
\frac{x + y}{x - y}
double f(double x, double y) {
        double r528088 = x;
        double r528089 = y;
        double r528090 = r528088 + r528089;
        double r528091 = r528088 - r528089;
        double r528092 = r528090 / r528091;
        return r528092;
}

double f(double x, double y) {
        double r528093 = x;
        double r528094 = y;
        double r528095 = r528093 + r528094;
        double r528096 = r528093 - r528094;
        double r528097 = r528095 / r528096;
        return r528097;
}

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 div-inv0.2

    \[\leadsto \color{blue}{\left(x + y\right) \cdot \frac{1}{x - y}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity0.2

    \[\leadsto \color{blue}{\left(1 \cdot \left(x + y\right)\right)} \cdot \frac{1}{x - y}\]
  6. Applied associate-*l*0.2

    \[\leadsto \color{blue}{1 \cdot \left(\left(x + y\right) \cdot \frac{1}{x - y}\right)}\]
  7. Simplified0.0

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

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

Reproduce

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