Average Error: 0.0 → 0.0
Time: 13.4s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\log \left(e^{\frac{x + y}{x - y}}\right)\]
\frac{x + y}{x - y}
\log \left(e^{\frac{x + y}{x - y}}\right)
double f(double x, double y) {
        double r332420 = x;
        double r332421 = y;
        double r332422 = r332420 + r332421;
        double r332423 = r332420 - r332421;
        double r332424 = r332422 / r332423;
        return r332424;
}

double f(double x, double y) {
        double r332425 = x;
        double r332426 = y;
        double r332427 = r332425 + r332426;
        double r332428 = r332425 - r332426;
        double r332429 = r332427 / r332428;
        double r332430 = exp(r332429);
        double r332431 = log(r332430);
        return r332431;
}

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{1}{\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. Final simplification0.0

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

Reproduce

herbie shell --seed 2019305 
(FPCore (x y)
  :name "Linear.Projection:perspective from linear-1.19.1.3, A"
  :precision binary64

  :herbie-target
  (/ 1 (- (/ x (+ x y)) (/ y (+ x y))))

  (/ (+ x y) (- x y)))