Average Error: 10.4 → 0.3
Time: 34.1s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(x \cdot \left(x \cdot y\right)\right) \cdot 3\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(x \cdot \left(x \cdot y\right)\right) \cdot 3
double f(double x, double y) {
        double r39937947 = x;
        double r39937948 = 3.0;
        double r39937949 = r39937947 * r39937948;
        double r39937950 = r39937949 * r39937947;
        double r39937951 = y;
        double r39937952 = r39937950 * r39937951;
        return r39937952;
}

double f(double x, double y) {
        double r39937953 = x;
        double r39937954 = y;
        double r39937955 = r39937953 * r39937954;
        double r39937956 = r39937953 * r39937955;
        double r39937957 = 3.0;
        double r39937958 = r39937956 * r39937957;
        return r39937958;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.4
Target0.2
Herbie0.3
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]

Derivation

  1. Initial program 10.4

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

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

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

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

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

Reproduce

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

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

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