Average Error: 0.3 → 0.3
Time: 9.8s
Precision: 64
\[\frac{x}{y \cdot 3}\]
\[\frac{x}{3 \cdot y}\]
\frac{x}{y \cdot 3}
\frac{x}{3 \cdot y}
double f(double x, double y) {
        double r39276448 = x;
        double r39276449 = y;
        double r39276450 = 3.0;
        double r39276451 = r39276449 * r39276450;
        double r39276452 = r39276448 / r39276451;
        return r39276452;
}

double f(double x, double y) {
        double r39276453 = x;
        double r39276454 = 3.0;
        double r39276455 = y;
        double r39276456 = r39276454 * r39276455;
        double r39276457 = r39276453 / r39276456;
        return r39276457;
}

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

Derivation

  1. Initial program 0.3

    \[\frac{x}{y \cdot 3}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.3

    \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot 3}\]
  4. Applied times-frac0.3

    \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{3}}\]
  5. Using strategy rm
  6. Applied frac-times0.3

    \[\leadsto \color{blue}{\frac{1 \cdot x}{y \cdot 3}}\]
  7. Simplified0.3

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

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

Reproduce

herbie shell --seed 2019171 
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, C"

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

  (/ x (* y 3.0)))