Average Error: 0.0 → 0.0
Time: 13.9s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{x}{x + y} - \log \left(e^{\frac{y}{x + y}}\right)\]
\frac{x - y}{x + y}
\frac{x}{x + y} - \log \left(e^{\frac{y}{x + y}}\right)
double f(double x, double y) {
        double r557004 = x;
        double r557005 = y;
        double r557006 = r557004 - r557005;
        double r557007 = r557004 + r557005;
        double r557008 = r557006 / r557007;
        return r557008;
}

double f(double x, double y) {
        double r557009 = x;
        double r557010 = y;
        double r557011 = r557009 + r557010;
        double r557012 = r557009 / r557011;
        double r557013 = r557010 / r557011;
        double r557014 = exp(r557013);
        double r557015 = log(r557014);
        double r557016 = r557012 - r557015;
        return r557016;
}

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

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

Reproduce

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