Average Error: 0.0 → 0.0
Time: 15.6s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\frac{1}{\frac{x - y}{y + x}}\]
\frac{x + y}{x - y}
\frac{1}{\frac{x - y}{y + x}}
double f(double x, double y) {
        double r379346 = x;
        double r379347 = y;
        double r379348 = r379346 + r379347;
        double r379349 = r379346 - r379347;
        double r379350 = r379348 / r379349;
        return r379350;
}

double f(double x, double y) {
        double r379351 = 1.0;
        double r379352 = x;
        double r379353 = y;
        double r379354 = r379352 - r379353;
        double r379355 = r379353 + r379352;
        double r379356 = r379354 / r379355;
        double r379357 = r379351 / r379356;
        return r379357;
}

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

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

Reproduce

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