Average Error: 15.4 → 1.3
Time: 5.1s
Precision: 64
\[\frac{x - y}{\left(x \cdot 2\right) \cdot y}\]
\[\left(\sqrt[3]{\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}} \cdot \sqrt[3]{\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}}\right) \cdot \sqrt[3]{\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}}\]
\frac{x - y}{\left(x \cdot 2\right) \cdot y}
\left(\sqrt[3]{\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}} \cdot \sqrt[3]{\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}}\right) \cdot \sqrt[3]{\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}}
double f(double x, double y) {
        double r565782 = x;
        double r565783 = y;
        double r565784 = r565782 - r565783;
        double r565785 = 2.0;
        double r565786 = r565782 * r565785;
        double r565787 = r565786 * r565783;
        double r565788 = r565784 / r565787;
        return r565788;
}

double f(double x, double y) {
        double r565789 = 1.0;
        double r565790 = 2.0;
        double r565791 = y;
        double r565792 = r565790 * r565791;
        double r565793 = r565789 / r565792;
        double r565794 = x;
        double r565795 = r565794 * r565790;
        double r565796 = r565789 / r565795;
        double r565797 = r565793 - r565796;
        double r565798 = cbrt(r565797);
        double r565799 = r565798 * r565798;
        double r565800 = r565799 * r565798;
        return r565800;
}

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.4
Target0.0
Herbie1.3
\[\frac{0.5}{y} - \frac{0.5}{x}\]

Derivation

  1. Initial program 15.4

    \[\frac{x - y}{\left(x \cdot 2\right) \cdot y}\]
  2. Using strategy rm
  3. Applied div-sub15.4

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

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

    \[\leadsto \frac{1}{2 \cdot y} - \color{blue}{\frac{1}{x \cdot 2}}\]
  6. Using strategy rm
  7. Applied add-cube-cbrt1.3

    \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}} \cdot \sqrt[3]{\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}}\right) \cdot \sqrt[3]{\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}}}\]
  8. Final simplification1.3

    \[\leadsto \left(\sqrt[3]{\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}} \cdot \sqrt[3]{\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}}\right) \cdot \sqrt[3]{\frac{1}{2 \cdot y} - \frac{1}{x \cdot 2}}\]

Reproduce

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

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

  (/ (- x y) (* (* x 2) y)))