Average Error: 0.0 → 0.0
Time: 8.2s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{\frac{x}{x + y} \cdot \frac{x}{x + y} - \frac{y}{x + y} \cdot \frac{y}{x + y}}{\frac{x}{x + y} + \frac{y}{x + y}}\]
\frac{x - y}{x + y}
\frac{\frac{x}{x + y} \cdot \frac{x}{x + y} - \frac{y}{x + y} \cdot \frac{y}{x + y}}{\frac{x}{x + y} + \frac{y}{x + y}}
double f(double x, double y) {
        double r54126661 = x;
        double r54126662 = y;
        double r54126663 = r54126661 - r54126662;
        double r54126664 = r54126661 + r54126662;
        double r54126665 = r54126663 / r54126664;
        return r54126665;
}

double f(double x, double y) {
        double r54126666 = x;
        double r54126667 = y;
        double r54126668 = r54126666 + r54126667;
        double r54126669 = r54126666 / r54126668;
        double r54126670 = r54126669 * r54126669;
        double r54126671 = r54126667 / r54126668;
        double r54126672 = r54126671 * r54126671;
        double r54126673 = r54126670 - r54126672;
        double r54126674 = r54126669 + r54126671;
        double r54126675 = r54126673 / r54126674;
        return r54126675;
}

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 flip--0.0

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, D"

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

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