Average Error: 0.3 → 0.2
Time: 7.1s
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 r500139 = x;
        double r500140 = 3.0;
        double r500141 = r500139 * r500140;
        double r500142 = y;
        double r500143 = r500141 * r500142;
        double r500144 = r500143 * r500142;
        return r500144;
}

double f(double x, double y) {
        double r500145 = x;
        double r500146 = y;
        double r500147 = r500145 * r500146;
        double r500148 = 3.0;
        double r500149 = r500146 * r500148;
        double r500150 = r500147 * r500149;
        return r500150;
}

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 2019179 +o rules:numerics
(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))