Average Error: 0.0 → 0.0
Time: 6.1s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{x}{x + y} + \left(-\frac{y}{x + y}\right)\]
\frac{x - y}{x + y}
\frac{x}{x + y} + \left(-\frac{y}{x + y}\right)
double f(double x, double y) {
        double r543157 = x;
        double r543158 = y;
        double r543159 = r543157 - r543158;
        double r543160 = r543157 + r543158;
        double r543161 = r543159 / r543160;
        return r543161;
}

double f(double x, double y) {
        double r543162 = x;
        double r543163 = y;
        double r543164 = r543162 + r543163;
        double r543165 = r543162 / r543164;
        double r543166 = r543163 / r543164;
        double r543167 = -r543166;
        double r543168 = r543165 + r543167;
        return r543168;
}

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 add-log-exp0.0

    \[\leadsto \frac{x}{x + y} - \color{blue}{\log \left(e^{\frac{y}{x + y}}\right)}\]
  6. Final simplification0.0

    \[\leadsto \frac{x}{x + y} + \left(-\frac{y}{x + y}\right)\]

Reproduce

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