Average Error: 0.0 → 0.0
Time: 3.7s
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 r967990 = x;
        double r967991 = y;
        double r967992 = r967990 - r967991;
        double r967993 = r967990 + r967991;
        double r967994 = r967992 / r967993;
        return r967994;
}

double f(double x, double y) {
        double r967995 = x;
        double r967996 = y;
        double r967997 = r967995 + r967996;
        double r967998 = r967995 / r967997;
        double r967999 = exp(r967998);
        double r968000 = log(r967999);
        double r968001 = r967996 / r967997;
        double r968002 = r968000 - r968001;
        return r968002;
}

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 2020083 +o rules:numerics
(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)))