Average Error: 0.0 → 0.0
Time: 8.9s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\log \left(e^{\frac{x}{x + y}}\right) - \frac{y}{x + y}\]
\frac{x - y}{x + y}
\log \left(e^{\frac{x}{x + y}}\right) - \frac{y}{x + y}
double f(double x, double y) {
        double r550793 = x;
        double r550794 = y;
        double r550795 = r550793 - r550794;
        double r550796 = r550793 + r550794;
        double r550797 = r550795 / r550796;
        return r550797;
}

double f(double x, double y) {
        double r550798 = x;
        double r550799 = y;
        double r550800 = r550798 + r550799;
        double r550801 = r550798 / r550800;
        double r550802 = exp(r550801);
        double r550803 = log(r550802);
        double r550804 = r550799 / r550800;
        double r550805 = r550803 - r550804;
        return r550805;
}

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

Reproduce

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