Average Error: 10.4 → 0.2
Time: 21.0s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[x \cdot \left(3 \cdot \left(x \cdot y\right)\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
x \cdot \left(3 \cdot \left(x \cdot y\right)\right)
double f(double x, double y) {
        double r513902 = x;
        double r513903 = 3.0;
        double r513904 = r513902 * r513903;
        double r513905 = r513904 * r513902;
        double r513906 = y;
        double r513907 = r513905 * r513906;
        return r513907;
}

double f(double x, double y) {
        double r513908 = x;
        double r513909 = 3.0;
        double r513910 = y;
        double r513911 = r513908 * r513910;
        double r513912 = r513909 * r513911;
        double r513913 = r513908 * r513912;
        return r513913;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.4
Target0.2
Herbie0.2
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]

Derivation

  1. Initial program 10.4

    \[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
  2. Using strategy rm
  3. Applied associate-*l*0.2

    \[\leadsto \color{blue}{\left(x \cdot 3\right) \cdot \left(x \cdot y\right)}\]
  4. Using strategy rm
  5. Applied associate-*l*0.2

    \[\leadsto \color{blue}{x \cdot \left(3 \cdot \left(x \cdot y\right)\right)}\]
  6. Final simplification0.2

    \[\leadsto x \cdot \left(3 \cdot \left(x \cdot y\right)\right)\]

Reproduce

herbie shell --seed 2019325 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :herbie-target
  (* (* x 3) (* x y))

  (* (* (* x 3) x) y))