Average Error: 0.0 → 0.0
Time: 16.6s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\frac{1}{\frac{x}{x + y} - \frac{1}{\frac{x + y}{y}}}\]
\frac{x + y}{x - y}
\frac{1}{\frac{x}{x + y} - \frac{1}{\frac{x + y}{y}}}
double f(double x, double y) {
        double r351302 = x;
        double r351303 = y;
        double r351304 = r351302 + r351303;
        double r351305 = r351302 - r351303;
        double r351306 = r351304 / r351305;
        return r351306;
}

double f(double x, double y) {
        double r351307 = 1.0;
        double r351308 = x;
        double r351309 = y;
        double r351310 = r351308 + r351309;
        double r351311 = r351308 / r351310;
        double r351312 = r351310 / r351309;
        double r351313 = r351307 / r351312;
        double r351314 = r351311 - r351313;
        double r351315 = r351307 / r351314;
        return r351315;
}

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. Using strategy rm
  5. Applied div-sub0.0

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

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

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

Reproduce

herbie shell --seed 2019323 +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)))