Average Error: 10.2 → 0.2
Time: 7.9s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(x \cdot 3\right) \cdot \left(x \cdot y\right)
double f(double x, double y) {
        double r514546 = x;
        double r514547 = 3.0;
        double r514548 = r514546 * r514547;
        double r514549 = r514548 * r514546;
        double r514550 = y;
        double r514551 = r514549 * r514550;
        return r514551;
}

double f(double x, double y) {
        double r514552 = x;
        double r514553 = 3.0;
        double r514554 = r514552 * r514553;
        double r514555 = y;
        double r514556 = r514552 * r514555;
        double r514557 = r514554 * r514556;
        return r514557;
}

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.2
Target0.2
Herbie0.2
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]

Derivation

  1. Initial program 10.2

    \[\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. Final simplification0.2

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

Reproduce

herbie shell --seed 2019291 
(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))