Average Error: 9.8 → 0.2
Time: 12.9s
Precision: 64
\[\frac{x}{y \cdot y}\]
\[\frac{1}{y} \cdot \frac{x}{y}\]
\frac{x}{y \cdot y}
\frac{1}{y} \cdot \frac{x}{y}
double f(double x, double y) {
        double r15840898 = x;
        double r15840899 = y;
        double r15840900 = r15840899 * r15840899;
        double r15840901 = r15840898 / r15840900;
        return r15840901;
}

double f(double x, double y) {
        double r15840902 = 1.0;
        double r15840903 = y;
        double r15840904 = r15840902 / r15840903;
        double r15840905 = x;
        double r15840906 = r15840905 / r15840903;
        double r15840907 = r15840904 * r15840906;
        return r15840907;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original9.8
Target0.2
Herbie0.2
\[\frac{\frac{x}{y}}{y}\]

Derivation

  1. Initial program 9.8

    \[\frac{x}{y \cdot y}\]
  2. Using strategy rm
  3. Applied associate-/r*0.2

    \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y}}\]
  4. Using strategy rm
  5. Applied div-inv0.2

    \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{y}}\]
  6. Final simplification0.2

    \[\leadsto \frac{1}{y} \cdot \frac{x}{y}\]

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y)
  :name "Physics.ForceLayout:coulombForce from force-layout-0.4.0.2"

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

  (/ x (* y y)))