Average Error: 0.0 → 0.0
Time: 13.7s
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 r798821 = x;
        double r798822 = y;
        double r798823 = r798821 - r798822;
        double r798824 = r798821 + r798822;
        double r798825 = r798823 / r798824;
        return r798825;
}

double f(double x, double y) {
        double r798826 = 1.0;
        double r798827 = y;
        double r798828 = x;
        double r798829 = r798827 / r798828;
        double r798830 = r798829 + r798826;
        double r798831 = r798826 / r798830;
        double r798832 = r798828 + r798827;
        double r798833 = r798827 / r798832;
        double r798834 = r798831 - r798833;
        return r798834;
}

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