Average Error: 10.6 → 0.2
Time: 2.1s
Precision: 64
\[\frac{x}{y \cdot y}\]
\[\frac{x}{y} \cdot \frac{1}{y}\]
\frac{x}{y \cdot y}
\frac{x}{y} \cdot \frac{1}{y}
double f(double x, double y) {
        double r316638 = x;
        double r316639 = y;
        double r316640 = r316639 * r316639;
        double r316641 = r316638 / r316640;
        return r316641;
}

double f(double x, double y) {
        double r316642 = x;
        double r316643 = y;
        double r316644 = r316642 / r316643;
        double r316645 = 1.0;
        double r316646 = r316645 / r316643;
        double r316647 = r316644 * r316646;
        return r316647;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.6
Target0.2
Herbie0.2
\[\frac{\frac{x}{y}}{y}\]

Derivation

  1. Initial program 10.6

    \[\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{x}{y} \cdot \frac{1}{y}\]

Reproduce

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

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

  (/ x (* y y)))