Average Error: 0.3 → 0.3
Time: 15.7s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(x \cdot \left(y \cdot 3\right)\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(x \cdot \left(y \cdot 3\right)\right) \cdot y
double f(double x, double y) {
        double r976698 = x;
        double r976699 = 3.0;
        double r976700 = r976698 * r976699;
        double r976701 = y;
        double r976702 = r976700 * r976701;
        double r976703 = r976702 * r976701;
        return r976703;
}

double f(double x, double y) {
        double r976704 = x;
        double r976705 = y;
        double r976706 = 3.0;
        double r976707 = r976705 * r976706;
        double r976708 = r976704 * r976707;
        double r976709 = r976708 * r976705;
        return r976709;
}

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.3
Herbie0.3
\[\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.3

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

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

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

Reproduce

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