Average Error: 0.3 → 0.3
Time: 22.1s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[y \cdot \left(\left(x \cdot 3\right) \cdot y\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
y \cdot \left(\left(x \cdot 3\right) \cdot y\right)
double f(double x, double y) {
        double r476066 = x;
        double r476067 = 3.0;
        double r476068 = r476066 * r476067;
        double r476069 = y;
        double r476070 = r476068 * r476069;
        double r476071 = r476070 * r476069;
        return r476071;
}

double f(double x, double y) {
        double r476072 = y;
        double r476073 = x;
        double r476074 = 3.0;
        double r476075 = r476073 * r476074;
        double r476076 = r476075 * r476072;
        double r476077 = r476072 * r476076;
        return r476077;
}

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 *-commutative0.3

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

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

Reproduce

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