Average Error: 10.4 → 0.3
Time: 18.0s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(x \cdot 3\right) \cdot \left(y \cdot x\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(x \cdot 3\right) \cdot \left(y \cdot x\right)
double f(double x, double y) {
        double r500493 = x;
        double r500494 = 3.0;
        double r500495 = r500493 * r500494;
        double r500496 = r500495 * r500493;
        double r500497 = y;
        double r500498 = r500496 * r500497;
        return r500498;
}

double f(double x, double y) {
        double r500499 = x;
        double r500500 = 3.0;
        double r500501 = r500499 * r500500;
        double r500502 = y;
        double r500503 = r500502 * r500499;
        double r500504 = r500501 * r500503;
        return r500504;
}

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.3
Herbie0.3
\[\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.3

    \[\leadsto \color{blue}{\left(x \cdot 3\right) \cdot \left(x \cdot y\right)}\]
  4. Simplified0.3

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

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

Reproduce

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