Average Error: 0.0 → 0.0
Time: 3.7s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\log \left(e^{\frac{1}{\frac{x + y}{x - y}}}\right)\]
\frac{x - y}{x + y}
\log \left(e^{\frac{1}{\frac{x + y}{x - y}}}\right)
double f(double x, double y) {
        double r767366 = x;
        double r767367 = y;
        double r767368 = r767366 - r767367;
        double r767369 = r767366 + r767367;
        double r767370 = r767368 / r767369;
        return r767370;
}

double f(double x, double y) {
        double r767371 = 1.0;
        double r767372 = x;
        double r767373 = y;
        double r767374 = r767372 + r767373;
        double r767375 = r767372 - r767373;
        double r767376 = r767374 / r767375;
        double r767377 = r767371 / r767376;
        double r767378 = exp(r767377);
        double r767379 = log(r767378);
        return r767379;
}

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

    \[\leadsto \color{blue}{\log \left(e^{\frac{x - y}{x + y}}\right)}\]
  4. Using strategy rm
  5. Applied clear-num0.0

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

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

Reproduce

herbie shell --seed 2020062 +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)))