Average Error: 0.3 → 0.3
Time: 2.5s
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 r705928 = x;
        double r705929 = 3.0;
        double r705930 = r705928 * r705929;
        double r705931 = y;
        double r705932 = r705930 * r705931;
        double r705933 = r705932 * r705931;
        return r705933;
}

double f(double x, double y) {
        double r705934 = x;
        double r705935 = 3.0;
        double r705936 = y;
        double r705937 = r705935 * r705936;
        double r705938 = r705934 * r705937;
        double r705939 = r705938 * r705936;
        return r705939;
}

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 2019356 
(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))