Average Error: 10.3 → 0.2
Time: 15.6s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y\]
\[\left(y \cdot x\right) \cdot \left(x \cdot 3.0\right)\]
\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y
\left(y \cdot x\right) \cdot \left(x \cdot 3.0\right)
double f(double x, double y) {
        double r29378508 = x;
        double r29378509 = 3.0;
        double r29378510 = r29378508 * r29378509;
        double r29378511 = r29378510 * r29378508;
        double r29378512 = y;
        double r29378513 = r29378511 * r29378512;
        return r29378513;
}

double f(double x, double y) {
        double r29378514 = y;
        double r29378515 = x;
        double r29378516 = r29378514 * r29378515;
        double r29378517 = 3.0;
        double r29378518 = r29378515 * r29378517;
        double r29378519 = r29378516 * r29378518;
        return r29378519;
}

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

Derivation

  1. Initial program 10.3

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

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

Reproduce

herbie shell --seed 2019163 +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))