Average Error: 15.2 → 0.0
Time: 4.2s
Precision: 64
\[\frac{x + y}{\left(x \cdot 2\right) \cdot y}\]
\[\frac{0.5}{y} + \frac{0.5}{x}\]
\frac{x + y}{\left(x \cdot 2\right) \cdot y}
\frac{0.5}{y} + \frac{0.5}{x}
double f(double x, double y) {
        double r480370 = x;
        double r480371 = y;
        double r480372 = r480370 + r480371;
        double r480373 = 2.0;
        double r480374 = r480370 * r480373;
        double r480375 = r480374 * r480371;
        double r480376 = r480372 / r480375;
        return r480376;
}

double f(double x, double y) {
        double r480377 = 0.5;
        double r480378 = y;
        double r480379 = r480377 / r480378;
        double r480380 = x;
        double r480381 = r480377 / r480380;
        double r480382 = r480379 + r480381;
        return r480382;
}

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.2
Target0.0
Herbie0.0
\[\frac{0.5}{x} + \frac{0.5}{y}\]

Derivation

  1. Initial program 15.2

    \[\frac{x + y}{\left(x \cdot 2\right) \cdot y}\]
  2. Simplified15.2

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

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

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

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

Reproduce

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

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

  (/ (+ x y) (* (* x 2.0) y)))