Average Error: 0.0 → 0.0
Time: 11.0s
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 r438339 = x;
        double r438340 = y;
        double r438341 = r438339 + r438340;
        double r438342 = r438339 - r438340;
        double r438343 = r438341 / r438342;
        return r438343;
}

double f(double x, double y) {
        double r438344 = x;
        double r438345 = y;
        double r438346 = r438344 + r438345;
        double r438347 = r438344 - r438345;
        double r438348 = r438346 / r438347;
        double r438349 = exp(r438348);
        double r438350 = log(r438349);
        return r438350;
}

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. Simplified0.0

    \[\leadsto \color{blue}{\frac{y + x}{x - y}}\]
  3. Using strategy rm
  4. Applied add-log-exp0.0

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

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

Reproduce

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

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

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