Average Error: 0.0 → 0.0
Time: 3.4s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{x - y}{x + y}\]
\frac{x - y}{x + y}
\frac{x - y}{x + y}
double f(double x, double y) {
        double r825778 = x;
        double r825779 = y;
        double r825780 = r825778 - r825779;
        double r825781 = r825778 + r825779;
        double r825782 = r825780 / r825781;
        return r825782;
}

double f(double x, double y) {
        double r825783 = x;
        double r825784 = y;
        double r825785 = r825783 - r825784;
        double r825786 = r825783 + r825784;
        double r825787 = r825785 / r825786;
        return r825787;
}

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. Final simplification0.0

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

Reproduce

herbie shell --seed 2020036 
(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)))