Average Error: 10.1 → 0.2
Time: 13.4s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y\]
\[\left(\left(x \cdot y\right) \cdot 3.0\right) \cdot x\]
\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y
\left(\left(x \cdot y\right) \cdot 3.0\right) \cdot x
double f(double x, double y) {
        double r35219479 = x;
        double r35219480 = 3.0;
        double r35219481 = r35219479 * r35219480;
        double r35219482 = r35219481 * r35219479;
        double r35219483 = y;
        double r35219484 = r35219482 * r35219483;
        return r35219484;
}

double f(double x, double y) {
        double r35219485 = x;
        double r35219486 = y;
        double r35219487 = r35219485 * r35219486;
        double r35219488 = 3.0;
        double r35219489 = r35219487 * r35219488;
        double r35219490 = r35219489 * r35219485;
        return r35219490;
}

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.0\right) \cdot \left(x \cdot y\right)\]

Derivation

  1. Initial program 10.1

    \[\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y\]
  2. Using strategy rm
  3. Applied associate-*l*0.2

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

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

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, A"

  :herbie-target
  (* (* x 3.0) (* x y))

  (* (* (* x 3.0) x) y))