Average Error: 0.3 → 0.3
Time: 14.1s
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 r24772032 = x;
        double r24772033 = y;
        double r24772034 = 3.0;
        double r24772035 = r24772033 * r24772034;
        double r24772036 = r24772032 / r24772035;
        return r24772036;
}

double f(double x, double y) {
        double r24772037 = 0.3333333333333333;
        double r24772038 = x;
        double r24772039 = r24772037 * r24772038;
        double r24772040 = y;
        double r24772041 = r24772039 / r24772040;
        return r24772041;
}

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)))