Average Error: 0.3 → 0.3
Time: 14.3s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
\[\left(y \cdot \left(y \cdot x\right)\right) \cdot 3.0\]
\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y
\left(y \cdot \left(y \cdot x\right)\right) \cdot 3.0
double f(double x, double y) {
        double r37398360 = x;
        double r37398361 = 3.0;
        double r37398362 = r37398360 * r37398361;
        double r37398363 = y;
        double r37398364 = r37398362 * r37398363;
        double r37398365 = r37398364 * r37398363;
        return r37398365;
}

double f(double x, double y) {
        double r37398366 = y;
        double r37398367 = x;
        double r37398368 = r37398366 * r37398367;
        double r37398369 = r37398366 * r37398368;
        double r37398370 = 3.0;
        double r37398371 = r37398369 * r37398370;
        return r37398371;
}

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

    \[\leadsto \color{blue}{\left(3.0 \cdot \left(x \cdot y\right)\right)} \cdot y\]
  3. Using strategy rm
  4. Applied associate-*l*0.3

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

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

Reproduce

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