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 r42539270 = x;
        double r42539271 = 3.0;
        double r42539272 = r42539270 * r42539271;
        double r42539273 = y;
        double r42539274 = r42539272 * r42539273;
        double r42539275 = r42539274 * r42539273;
        return r42539275;
}

double f(double x, double y) {
        double r42539276 = y;
        double r42539277 = x;
        double r42539278 = r42539276 * r42539277;
        double r42539279 = r42539276 * r42539278;
        double r42539280 = 3.0;
        double r42539281 = r42539279 * r42539280;
        return r42539281;
}

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