Average Error: 0.0 → 0.0
Time: 15.1s
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 r1079968 = x;
        double r1079969 = y;
        double r1079970 = r1079968 + r1079969;
        double r1079971 = r1079968 - r1079969;
        double r1079972 = r1079970 / r1079971;
        return r1079972;
}

double f(double x, double y) {
        double r1079973 = 1.0;
        double r1079974 = x;
        double r1079975 = y;
        double r1079976 = r1079974 - r1079975;
        double r1079977 = r1079975 + r1079974;
        double r1079978 = r1079976 / r1079977;
        double r1079979 = r1079973 / r1079978;
        return r1079979;
}

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)))