Average Error: 0.3 → 0.2
Time: 7.7s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(x \cdot y\right) \cdot \left(y \cdot 3\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(x \cdot y\right) \cdot \left(y \cdot 3\right)
double f(double x, double y) {
        double r573043 = x;
        double r573044 = 3.0;
        double r573045 = r573043 * r573044;
        double r573046 = y;
        double r573047 = r573045 * r573046;
        double r573048 = r573047 * r573046;
        return r573048;
}

double f(double x, double y) {
        double r573049 = x;
        double r573050 = y;
        double r573051 = r573049 * r573050;
        double r573052 = 3.0;
        double r573053 = r573050 * r573052;
        double r573054 = r573051 * r573053;
        return r573054;
}

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

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

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

Reproduce

herbie shell --seed 2019195 
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, B"

  :herbie-target
  (* (* x (* 3.0 y)) y)

  (* (* (* x 3.0) y) y))