Average Error: 9.9 → 0.3
Time: 20.7s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(\left(y \cdot 3\right) \cdot x\right) \cdot x\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(\left(y \cdot 3\right) \cdot x\right) \cdot x
double f(double x, double y) {
        double r593356 = x;
        double r593357 = 3.0;
        double r593358 = r593356 * r593357;
        double r593359 = r593358 * r593356;
        double r593360 = y;
        double r593361 = r593359 * r593360;
        return r593361;
}

double f(double x, double y) {
        double r593362 = y;
        double r593363 = 3.0;
        double r593364 = r593362 * r593363;
        double r593365 = x;
        double r593366 = r593364 * r593365;
        double r593367 = r593366 * r593365;
        return r593367;
}

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

Derivation

  1. Initial program 9.9

    \[\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-*r*0.2

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

    \[\leadsto \color{blue}{\left(3 \cdot \left(y \cdot x\right)\right)} \cdot x\]
  8. Using strategy rm
  9. Applied associate-*r*0.3

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

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

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

Reproduce

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