Average Error: 0.3 → 0.2
Time: 4.8s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(x \cdot \left(3 \cdot y\right)\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(x \cdot \left(3 \cdot y\right)\right) \cdot y
double f(double x, double y) {
        double r521390 = x;
        double r521391 = 3.0;
        double r521392 = r521390 * r521391;
        double r521393 = y;
        double r521394 = r521392 * r521393;
        double r521395 = r521394 * r521393;
        return r521395;
}

double f(double x, double y) {
        double r521396 = x;
        double r521397 = 3.0;
        double r521398 = y;
        double r521399 = r521397 * r521398;
        double r521400 = r521396 * r521399;
        double r521401 = r521400 * r521398;
        return r521401;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.3
Target0.2
Herbie0.2
\[\left(x \cdot \left(3 \cdot y\right)\right) \cdot y\]

Derivation

  1. Initial program 0.3

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

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

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

Reproduce

herbie shell --seed 2019304 
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, B"
  :precision binary64

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

  (* (* (* x 3) y) y))