Average Error: 0.0 → 0.0
Time: 13.6s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\frac{1}{\frac{x}{x + y} - \frac{y}{x + y}}\]
\frac{x + y}{x - y}
\frac{1}{\frac{x}{x + y} - \frac{y}{x + y}}
double f(double x, double y) {
        double r446905 = x;
        double r446906 = y;
        double r446907 = r446905 + r446906;
        double r446908 = r446905 - r446906;
        double r446909 = r446907 / r446908;
        return r446909;
}

double f(double x, double y) {
        double r446910 = 1.0;
        double r446911 = x;
        double r446912 = y;
        double r446913 = r446911 + r446912;
        double r446914 = r446911 / r446913;
        double r446915 = r446912 / r446913;
        double r446916 = r446914 - r446915;
        double r446917 = r446910 / r446916;
        return r446917;
}

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

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

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

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

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

Reproduce

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