Average Error: 9.8 → 0.2
Time: 25.1s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[x \cdot \left(3 \cdot \left(x \cdot y\right)\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
x \cdot \left(3 \cdot \left(x \cdot y\right)\right)
double f(double x, double y) {
        double r576380 = x;
        double r576381 = 3.0;
        double r576382 = r576380 * r576381;
        double r576383 = r576382 * r576380;
        double r576384 = y;
        double r576385 = r576383 * r576384;
        return r576385;
}

double f(double x, double y) {
        double r576386 = x;
        double r576387 = 3.0;
        double r576388 = y;
        double r576389 = r576386 * r576388;
        double r576390 = r576387 * r576389;
        double r576391 = r576386 * r576390;
        return r576391;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 9.8

    \[\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. Using strategy rm
  5. Applied associate-*l*0.2

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

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

Reproduce

herbie shell --seed 2019303 +o rules:numerics
(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))