Average Error: 0.0 → 0.0
Time: 2.6s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\log \left({\left(e^{\frac{x + y}{x - y}}\right)}^{1}\right)\]
\frac{x + y}{x - y}
\log \left({\left(e^{\frac{x + y}{x - y}}\right)}^{1}\right)
double f(double x, double y) {
        double r502782 = x;
        double r502783 = y;
        double r502784 = r502782 + r502783;
        double r502785 = r502782 - r502783;
        double r502786 = r502784 / r502785;
        return r502786;
}

double f(double x, double y) {
        double r502787 = x;
        double r502788 = y;
        double r502789 = r502787 + r502788;
        double r502790 = r502787 - r502788;
        double r502791 = r502789 / r502790;
        double r502792 = exp(r502791);
        double r502793 = 1.0;
        double r502794 = pow(r502792, r502793);
        double r502795 = log(r502794);
        return r502795;
}

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. Using strategy rm
  5. Applied pow10.0

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

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

Reproduce

herbie shell --seed 2020056 +o rules:numerics
(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)))