Average Error: 15.0 → 0.0
Time: 7.7s
Precision: 64
\[\frac{x + y}{\left(x \cdot 2\right) \cdot y}\]
\[\frac{0.5}{x} + \frac{0.5}{y}\]
\frac{x + y}{\left(x \cdot 2\right) \cdot y}
\frac{0.5}{x} + \frac{0.5}{y}
double f(double x, double y) {
        double r635988 = x;
        double r635989 = y;
        double r635990 = r635988 + r635989;
        double r635991 = 2.0;
        double r635992 = r635988 * r635991;
        double r635993 = r635992 * r635989;
        double r635994 = r635990 / r635993;
        return r635994;
}

double f(double x, double y) {
        double r635995 = 0.5;
        double r635996 = x;
        double r635997 = r635995 / r635996;
        double r635998 = y;
        double r635999 = r635995 / r635998;
        double r636000 = r635997 + r635999;
        return r636000;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original15.0
Target0.0
Herbie0.0
\[\frac{0.5}{x} + \frac{0.5}{y}\]

Derivation

  1. Initial program 15.0

    \[\frac{x + y}{\left(x \cdot 2\right) \cdot y}\]
  2. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{0.5 \cdot \frac{1}{y} + 0.5 \cdot \frac{1}{x}}\]
  3. Simplified0.0

    \[\leadsto \color{blue}{\frac{0.5}{x} + \frac{0.5}{y}}\]
  4. Final simplification0.0

    \[\leadsto \frac{0.5}{x} + \frac{0.5}{y}\]

Reproduce

herbie shell --seed 2020045 
(FPCore (x y)
  :name "Linear.Projection:inversePerspective from linear-1.19.1.3, C"
  :precision binary64

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

  (/ (+ x y) (* (* x 2) y)))