Average Error: 0.0 → 0.0
Time: 12.3s
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 r585314 = x;
        double r585315 = y;
        double r585316 = r585314 + r585315;
        double r585317 = r585314 - r585315;
        double r585318 = r585316 / r585317;
        return r585318;
}

double f(double x, double y) {
        double r585319 = x;
        double r585320 = y;
        double r585321 = r585319 + r585320;
        double r585322 = r585319 - r585320;
        double r585323 = r585321 / r585322;
        return r585323;
}

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 *-un-lft-identity0.0

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

    \[\leadsto \frac{\color{blue}{1 \cdot \left(x + y\right)}}{1 \cdot \left(x - y\right)}\]
  5. Applied times-frac0.0

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

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

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

Reproduce

herbie shell --seed 2020043 +o rules:numerics
(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)))