Average Error: 0.3 → 0.2
Time: 14.4s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(3 \cdot y\right) \cdot \left(y \cdot x\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(3 \cdot y\right) \cdot \left(y \cdot x\right)
double f(double x, double y) {
        double r37457092 = x;
        double r37457093 = 3.0;
        double r37457094 = r37457092 * r37457093;
        double r37457095 = y;
        double r37457096 = r37457094 * r37457095;
        double r37457097 = r37457096 * r37457095;
        return r37457097;
}

double f(double x, double y) {
        double r37457098 = 3.0;
        double r37457099 = y;
        double r37457100 = r37457098 * r37457099;
        double r37457101 = x;
        double r37457102 = r37457099 * r37457101;
        double r37457103 = r37457100 * r37457102;
        return r37457103;
}

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.2
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. 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 *-un-lft-identity0.2

    \[\leadsto \left(3 \cdot \left(x \cdot y\right)\right) \cdot \color{blue}{\left(1 \cdot y\right)}\]
  5. Applied associate-*r*0.2

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

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

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

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

Reproduce

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