Average Error: 0.0 → 0.0
Time: 10.5s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\log \left(e^{\frac{x}{y + x}}\right) - \log \left(e^{\frac{y}{y + x}}\right)\]
\frac{x - y}{x + y}
\log \left(e^{\frac{x}{y + x}}\right) - \log \left(e^{\frac{y}{y + x}}\right)
double f(double x, double y) {
        double r40233428 = x;
        double r40233429 = y;
        double r40233430 = r40233428 - r40233429;
        double r40233431 = r40233428 + r40233429;
        double r40233432 = r40233430 / r40233431;
        return r40233432;
}

double f(double x, double y) {
        double r40233433 = x;
        double r40233434 = y;
        double r40233435 = r40233434 + r40233433;
        double r40233436 = r40233433 / r40233435;
        double r40233437 = exp(r40233436);
        double r40233438 = log(r40233437);
        double r40233439 = r40233434 / r40233435;
        double r40233440 = exp(r40233439);
        double r40233441 = log(r40233440);
        double r40233442 = r40233438 - r40233441;
        return r40233442;
}

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. Using strategy rm
  7. Applied add-log-exp0.0

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

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

Reproduce

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