Average Error: 0.0 → 0.0
Time: 14.9s
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 r426073 = x;
        double r426074 = y;
        double r426075 = r426073 + r426074;
        double r426076 = r426073 - r426074;
        double r426077 = r426075 / r426076;
        return r426077;
}

double f(double x, double y) {
        double r426078 = x;
        double r426079 = y;
        double r426080 = r426078 + r426079;
        double r426081 = r426078 - r426079;
        double r426082 = r426080 / r426081;
        return r426082;
}

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. Final simplification0.0

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

Reproduce

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