Average Error: 0.3 → 0.2
Time: 7.5s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(3 \cdot \left(x \cdot y\right)\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(3 \cdot \left(x \cdot y\right)\right) \cdot y
double f(double x, double y) {
        double r47653067 = x;
        double r47653068 = 3.0;
        double r47653069 = r47653067 * r47653068;
        double r47653070 = y;
        double r47653071 = r47653069 * r47653070;
        double r47653072 = r47653071 * r47653070;
        return r47653072;
}

double f(double x, double y) {
        double r47653073 = 3.0;
        double r47653074 = x;
        double r47653075 = y;
        double r47653076 = r47653074 * r47653075;
        double r47653077 = r47653073 * r47653076;
        double r47653078 = r47653077 * r47653075;
        return r47653078;
}

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 \cdot y\right)\right) \cdot y\]

Derivation

  1. Initial program 0.3

    \[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
  2. Using strategy rm
  3. Applied associate-*l*0.3

    \[\leadsto \color{blue}{\left(x \cdot \left(3 \cdot y\right)\right)} \cdot y\]
  4. Taylor expanded around 0 0.2

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

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

Reproduce

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