Average Error: 0.0 → 0.0
Time: 13.2s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\log \left(e^{\frac{x}{y + x}}\right) - \frac{y}{y + x}\]
\frac{x - y}{x + y}
\log \left(e^{\frac{x}{y + x}}\right) - \frac{y}{y + x}
double f(double x, double y) {
        double r40948706 = x;
        double r40948707 = y;
        double r40948708 = r40948706 - r40948707;
        double r40948709 = r40948706 + r40948707;
        double r40948710 = r40948708 / r40948709;
        return r40948710;
}

double f(double x, double y) {
        double r40948711 = x;
        double r40948712 = y;
        double r40948713 = r40948712 + r40948711;
        double r40948714 = r40948711 / r40948713;
        double r40948715 = exp(r40948714);
        double r40948716 = log(r40948715);
        double r40948717 = r40948712 / r40948713;
        double r40948718 = r40948716 - r40948717;
        return r40948718;
}

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 \color{blue}{\log \left(e^{\frac{x}{x + y}}\right)} - \frac{y}{x + y}\]
  6. Final simplification0.0

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

Reproduce

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