Average Error: 0.0 → 0.0
Time: 12.6s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\frac{1}{\log \left(e^{\frac{1}{\frac{x + y}{x - y}}}\right)}\]
\frac{x + y}{x - y}
\frac{1}{\log \left(e^{\frac{1}{\frac{x + y}{x - y}}}\right)}
double f(double x, double y) {
        double r20140185 = x;
        double r20140186 = y;
        double r20140187 = r20140185 + r20140186;
        double r20140188 = r20140185 - r20140186;
        double r20140189 = r20140187 / r20140188;
        return r20140189;
}

double f(double x, double y) {
        double r20140190 = 1.0;
        double r20140191 = x;
        double r20140192 = y;
        double r20140193 = r20140191 + r20140192;
        double r20140194 = r20140191 - r20140192;
        double r20140195 = r20140193 / r20140194;
        double r20140196 = r20140190 / r20140195;
        double r20140197 = exp(r20140196);
        double r20140198 = log(r20140197);
        double r20140199 = r20140190 / r20140198;
        return r20140199;
}

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 clear-num0.0

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

    \[\leadsto \frac{1}{\color{blue}{\log \left(e^{\frac{x - y}{x + y}}\right)}}\]
  6. Using strategy rm
  7. Applied clear-num0.0

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

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

Reproduce

herbie shell --seed 2019164 +o rules:numerics
(FPCore (x y)
  :name "Linear.Projection:perspective from linear-1.19.1.3, A"

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

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