Average Error: 9.8 → 0.2
Time: 17.4s
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 r578515 = x;
        double r578516 = 3.0;
        double r578517 = r578515 * r578516;
        double r578518 = r578517 * r578515;
        double r578519 = y;
        double r578520 = r578518 * r578519;
        return r578520;
}

double f(double x, double y) {
        double r578521 = x;
        double r578522 = 3.0;
        double r578523 = r578521 * r578522;
        double r578524 = y;
        double r578525 = r578524 * r578521;
        double r578526 = r578523 * r578525;
        return r578526;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original9.8
Target0.2
Herbie0.2
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]

Derivation

  1. Initial program 9.8

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

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

Reproduce

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