Average Error: 0.3 → 0.3
Time: 3.6s
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 r847871 = x;
        double r847872 = 3.0;
        double r847873 = r847871 * r847872;
        double r847874 = y;
        double r847875 = r847873 * r847874;
        double r847876 = r847875 * r847874;
        return r847876;
}

double f(double x, double y) {
        double r847877 = x;
        double r847878 = 3.0;
        double r847879 = y;
        double r847880 = r847878 * r847879;
        double r847881 = r847877 * r847880;
        double r847882 = r847881 * r847879;
        return r847882;
}

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. Final simplification0.3

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

Reproduce

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