Average Error: 10.4 → 0.2
Time: 20.6s
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 r492292 = x;
        double r492293 = 3.0;
        double r492294 = r492292 * r492293;
        double r492295 = r492294 * r492292;
        double r492296 = y;
        double r492297 = r492295 * r492296;
        return r492297;
}

double f(double x, double y) {
        double r492298 = x;
        double r492299 = 3.0;
        double r492300 = r492298 * r492299;
        double r492301 = y;
        double r492302 = r492301 * r492298;
        double r492303 = r492300 * r492302;
        return r492303;
}

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.2
Herbie0.2
\[\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.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 2019304 
(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))