Average Error: 0.0 → 0.0
Time: 27.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 r27208840 = x;
        double r27208841 = y;
        double r27208842 = r27208840 + r27208841;
        double r27208843 = r27208840 - r27208841;
        double r27208844 = r27208842 / r27208843;
        return r27208844;
}

double f(double x, double y) {
        double r27208845 = 1.0;
        double r27208846 = x;
        double r27208847 = y;
        double r27208848 = r27208846 - r27208847;
        double r27208849 = r27208846 + r27208847;
        double r27208850 = r27208848 / r27208849;
        double r27208851 = r27208845 / r27208850;
        return r27208851;
}

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