Average Error: 10.1 → 0.2
Time: 1.4s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[x \cdot \left(\left(3 \cdot x\right) \cdot y\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
x \cdot \left(\left(3 \cdot x\right) \cdot y\right)
double f(double x, double y) {
        double r777160 = x;
        double r777161 = 3.0;
        double r777162 = r777160 * r777161;
        double r777163 = r777162 * r777160;
        double r777164 = y;
        double r777165 = r777163 * r777164;
        return r777165;
}

double f(double x, double y) {
        double r777166 = x;
        double r777167 = 3.0;
        double r777168 = r777167 * r777166;
        double r777169 = y;
        double r777170 = r777168 * r777169;
        double r777171 = r777166 * r777170;
        return r777171;
}

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

Derivation

  1. Initial program 10.1

    \[\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. Using strategy rm
  5. Applied associate-*l*0.2

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

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

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

Reproduce

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