Average Error: 0.0 → 0.0
Time: 13.4s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\log \left(e^{\frac{y}{x - y} + \frac{x}{x - y}}\right)\]
\frac{x + y}{x - y}
\log \left(e^{\frac{y}{x - y} + \frac{x}{x - y}}\right)
double f(double x, double y) {
        double r25032810 = x;
        double r25032811 = y;
        double r25032812 = r25032810 + r25032811;
        double r25032813 = r25032810 - r25032811;
        double r25032814 = r25032812 / r25032813;
        return r25032814;
}

double f(double x, double y) {
        double r25032815 = y;
        double r25032816 = x;
        double r25032817 = r25032816 - r25032815;
        double r25032818 = r25032815 / r25032817;
        double r25032819 = r25032816 / r25032817;
        double r25032820 = r25032818 + r25032819;
        double r25032821 = exp(r25032820);
        double r25032822 = log(r25032821);
        return r25032822;
}

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 flip--31.0

    \[\leadsto \frac{x + y}{\color{blue}{\frac{x \cdot x - y \cdot y}{x + y}}}\]
  4. Applied associate-/r/31.1

    \[\leadsto \color{blue}{\frac{x + y}{x \cdot x - y \cdot y} \cdot \left(x + y\right)}\]
  5. Simplified0.2

    \[\leadsto \color{blue}{\frac{1}{x - y}} \cdot \left(x + y\right)\]
  6. Using strategy rm
  7. Applied distribute-lft-in0.2

    \[\leadsto \color{blue}{\frac{1}{x - y} \cdot x + \frac{1}{x - y} \cdot y}\]
  8. Using strategy rm
  9. Applied add-log-exp0.2

    \[\leadsto \frac{1}{x - y} \cdot x + \color{blue}{\log \left(e^{\frac{1}{x - y} \cdot y}\right)}\]
  10. Applied add-log-exp0.1

    \[\leadsto \color{blue}{\log \left(e^{\frac{1}{x - y} \cdot x}\right)} + \log \left(e^{\frac{1}{x - y} \cdot y}\right)\]
  11. Applied sum-log0.1

    \[\leadsto \color{blue}{\log \left(e^{\frac{1}{x - y} \cdot x} \cdot e^{\frac{1}{x - y} \cdot y}\right)}\]
  12. Simplified0.0

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

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

Reproduce

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