Average Error: 0.3 → 0.2
Time: 11.8s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot x\right) \cdot 3.0\right) \cdot y\]
\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y
\left(\left(y \cdot x\right) \cdot 3.0\right) \cdot y
double f(double x, double y) {
        double r34665420 = x;
        double r34665421 = 3.0;
        double r34665422 = r34665420 * r34665421;
        double r34665423 = y;
        double r34665424 = r34665422 * r34665423;
        double r34665425 = r34665424 * r34665423;
        return r34665425;
}

double f(double x, double y) {
        double r34665426 = y;
        double r34665427 = x;
        double r34665428 = r34665426 * r34665427;
        double r34665429 = 3.0;
        double r34665430 = r34665428 * r34665429;
        double r34665431 = r34665430 * r34665426;
        return r34665431;
}

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.2
\[\left(x \cdot \left(3.0 \cdot y\right)\right) \cdot y\]

Derivation

  1. Initial program 0.3

    \[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
  2. Taylor expanded around 0 0.2

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

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

Reproduce

herbie shell --seed 2019168 
(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))