Average Error: 10.6 → 0.3
Time: 1.6s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(x \cdot 3\right) \cdot \left(x \cdot y\right)
double f(double x, double y) {
        double r710426 = x;
        double r710427 = 3.0;
        double r710428 = r710426 * r710427;
        double r710429 = r710428 * r710426;
        double r710430 = y;
        double r710431 = r710429 * r710430;
        return r710431;
}

double f(double x, double y) {
        double r710432 = x;
        double r710433 = 3.0;
        double r710434 = r710432 * r710433;
        double r710435 = y;
        double r710436 = r710432 * r710435;
        double r710437 = r710434 * r710436;
        return r710437;
}

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

Derivation

  1. Initial program 10.6

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

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

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

Reproduce

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