Average Error: 10.2 → 0.2
Time: 6.4s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[x \cdot \left(3 \cdot \left(y \cdot x\right)\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
x \cdot \left(3 \cdot \left(y \cdot x\right)\right)
double f(double x, double y) {
        double r1757488 = x;
        double r1757489 = 3.0;
        double r1757490 = r1757488 * r1757489;
        double r1757491 = r1757490 * r1757488;
        double r1757492 = y;
        double r1757493 = r1757491 * r1757492;
        return r1757493;
}

double f(double x, double y) {
        double r1757494 = x;
        double r1757495 = 3.0;
        double r1757496 = y;
        double r1757497 = r1757496 * r1757494;
        double r1757498 = r1757495 * r1757497;
        double r1757499 = r1757494 * r1757498;
        return r1757499;
}

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. Simplified0.2

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

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

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

Reproduce

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