Average Error: 0.3 → 0.2
Time: 9.7s
Precision: 64
\[\frac{x}{y \cdot 3}\]
\[\frac{\frac{x}{3}}{y}\]
\frac{x}{y \cdot 3}
\frac{\frac{x}{3}}{y}
double f(double x, double y) {
        double r30821607 = x;
        double r30821608 = y;
        double r30821609 = 3.0;
        double r30821610 = r30821608 * r30821609;
        double r30821611 = r30821607 / r30821610;
        return r30821611;
}

double f(double x, double y) {
        double r30821612 = x;
        double r30821613 = 3.0;
        double r30821614 = r30821612 / r30821613;
        double r30821615 = y;
        double r30821616 = r30821614 / r30821615;
        return r30821616;
}

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.3
Herbie0.2
\[\frac{\frac{x}{y}}{3}\]

Derivation

  1. Initial program 0.3

    \[\frac{x}{y \cdot 3}\]
  2. Using strategy rm
  3. Applied div-inv0.3

    \[\leadsto \color{blue}{x \cdot \frac{1}{y \cdot 3}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity0.3

    \[\leadsto \color{blue}{\left(1 \cdot x\right)} \cdot \frac{1}{y \cdot 3}\]
  6. Applied associate-*l*0.3

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

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

    \[\leadsto \frac{\frac{x}{3}}{y}\]

Reproduce

herbie shell --seed 2019171 +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)))