Average Error: 0.3 → 0.3
Time: 37.4s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(y \cdot \left(y \cdot x\right)\right) \cdot 3\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(y \cdot \left(y \cdot x\right)\right) \cdot 3
double f(double x, double y) {
        double r36574904 = x;
        double r36574905 = 3.0;
        double r36574906 = r36574904 * r36574905;
        double r36574907 = y;
        double r36574908 = r36574906 * r36574907;
        double r36574909 = r36574908 * r36574907;
        return r36574909;
}

double f(double x, double y) {
        double r36574910 = y;
        double r36574911 = x;
        double r36574912 = r36574910 * r36574911;
        double r36574913 = r36574910 * r36574912;
        double r36574914 = 3.0;
        double r36574915 = r36574913 * r36574914;
        return r36574915;
}

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. Taylor expanded around 0 0.2

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

    \[\leadsto \color{blue}{3 \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\]

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))