Average Error: 0.0 → 0.0
Time: 18.2s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\frac{1}{\frac{x - y}{x + y}}\]
\frac{x + y}{x - y}
\frac{1}{\frac{x - y}{x + y}}
double f(double x, double y) {
        double r421115 = x;
        double r421116 = y;
        double r421117 = r421115 + r421116;
        double r421118 = r421115 - r421116;
        double r421119 = r421117 / r421118;
        return r421119;
}

double f(double x, double y) {
        double r421120 = 1.0;
        double r421121 = x;
        double r421122 = y;
        double r421123 = r421121 - r421122;
        double r421124 = r421121 + r421122;
        double r421125 = r421123 / r421124;
        double r421126 = r421120 / r421125;
        return r421126;
}

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

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

Reproduce

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