Average Error: 0.0 → 0.0
Time: 9.6s
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 r538142 = x;
        double r538143 = y;
        double r538144 = r538142 - r538143;
        double r538145 = r538142 + r538143;
        double r538146 = r538144 / r538145;
        return r538146;
}

double f(double x, double y) {
        double r538147 = x;
        double r538148 = y;
        double r538149 = r538147 + r538148;
        double r538150 = r538147 / r538149;
        double r538151 = exp(r538150);
        double r538152 = log(r538151);
        double r538153 = r538148 / r538149;
        double r538154 = r538152 - r538153;
        return r538154;
}

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 +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)))