Average Error: 0.0 → 0.0
Time: 11.1s
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 r419298 = x;
        double r419299 = y;
        double r419300 = r419298 + r419299;
        double r419301 = r419298 - r419299;
        double r419302 = r419300 / r419301;
        return r419302;
}

double f(double x, double y) {
        double r419303 = 1.0;
        double r419304 = x;
        double r419305 = y;
        double r419306 = r419304 + r419305;
        double r419307 = r419304 / r419306;
        double r419308 = r419305 / r419306;
        double r419309 = r419307 - r419308;
        double r419310 = r419303 / r419309;
        return r419310;
}

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. Using strategy rm
  4. Applied clear-num0.0

    \[\leadsto \color{blue}{\frac{1}{\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. Final simplification0.0

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

Reproduce

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