Average Error: 0.0 → 0.0
Time: 9.6s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{x - y}{y + x}\]
\frac{x - y}{x + y}
\frac{x - y}{y + x}
double f(double x, double y) {
        double r41065262 = x;
        double r41065263 = y;
        double r41065264 = r41065262 - r41065263;
        double r41065265 = r41065262 + r41065263;
        double r41065266 = r41065264 / r41065265;
        return r41065266;
}

double f(double x, double y) {
        double r41065267 = x;
        double r41065268 = y;
        double r41065269 = r41065267 - r41065268;
        double r41065270 = r41065268 + r41065267;
        double r41065271 = r41065269 / r41065270;
        return r41065271;
}

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

Reproduce

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