Average Error: 0.3 → 0.3
Time: 14.6s
Precision: 64
\[\frac{x}{y \cdot 3.0}\]
\[\frac{0.3333333333333333 \cdot x}{y}\]
\frac{x}{y \cdot 3.0}
\frac{0.3333333333333333 \cdot x}{y}
double f(double x, double y) {
        double r21767365 = x;
        double r21767366 = y;
        double r21767367 = 3.0;
        double r21767368 = r21767366 * r21767367;
        double r21767369 = r21767365 / r21767368;
        return r21767369;
}

double f(double x, double y) {
        double r21767370 = 0.3333333333333333;
        double r21767371 = x;
        double r21767372 = r21767370 * r21767371;
        double r21767373 = y;
        double r21767374 = r21767372 / r21767373;
        return r21767374;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.3
Target0.2
Herbie0.3
\[\frac{\frac{x}{y}}{3.0}\]

Derivation

  1. Initial program 0.3

    \[\frac{x}{y \cdot 3.0}\]
  2. Taylor expanded around 0 0.3

    \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{x}{y}}\]
  3. Using strategy rm
  4. Applied associate-*r/0.3

    \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot x}{y}}\]
  5. Final simplification0.3

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

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, C"

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

  (/ x (* y 3.0)))