Average Error: 0.0 → 0.0
Time: 7.4s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{1}{\frac{y}{x} + 1} - \frac{y}{x + y}\]
\frac{x - y}{x + y}
\frac{1}{\frac{y}{x} + 1} - \frac{y}{x + y}
double f(double x, double y) {
        double r809911 = x;
        double r809912 = y;
        double r809913 = r809911 - r809912;
        double r809914 = r809911 + r809912;
        double r809915 = r809913 / r809914;
        return r809915;
}

double f(double x, double y) {
        double r809916 = 1.0;
        double r809917 = y;
        double r809918 = x;
        double r809919 = r809917 / r809918;
        double r809920 = r809919 + r809916;
        double r809921 = r809916 / r809920;
        double r809922 = r809918 + r809917;
        double r809923 = r809917 / r809922;
        double r809924 = r809921 - r809923;
        return r809924;
}

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{x}{x + y} - \frac{y}{x + y}\]

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{x + y}\]
  2. Using strategy rm
  3. Applied div-sub0.0

    \[\leadsto \color{blue}{\frac{x}{x + y} - \frac{y}{x + y}}\]
  4. Using strategy rm
  5. Applied clear-num0.0

    \[\leadsto \color{blue}{\frac{1}{\frac{x + y}{x}}} - \frac{y}{x + y}\]
  6. Taylor expanded around 0 0.0

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

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

Reproduce

herbie shell --seed 2020045 
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, D"
  :precision binary64

  :herbie-target
  (- (/ x (+ x y)) (/ y (+ x y)))

  (/ (- x y) (+ x y)))