Average Error: 0.3 → 0.3
Time: 9.5s
Precision: 64
\[\frac{x}{y \cdot 3}\]
\[\frac{1}{y} \cdot \frac{x}{3}\]
\frac{x}{y \cdot 3}
\frac{1}{y} \cdot \frac{x}{3}
double f(double x, double y) {
        double r714662 = x;
        double r714663 = y;
        double r714664 = 3.0;
        double r714665 = r714663 * r714664;
        double r714666 = r714662 / r714665;
        return r714666;
}

double f(double x, double y) {
        double r714667 = 1.0;
        double r714668 = y;
        double r714669 = r714667 / r714668;
        double r714670 = x;
        double r714671 = 3.0;
        double r714672 = r714670 / r714671;
        double r714673 = r714669 * r714672;
        return r714673;
}

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. Final simplification0.3

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

Reproduce

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