Average Error: 0.3 → 0.2
Time: 5.9s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot 3.0\right) \cdot x\right) \cdot y\]
\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y
\left(\left(y \cdot 3.0\right) \cdot x\right) \cdot y
double f(double x, double y) {
        double r15706673 = x;
        double r15706674 = 3.0;
        double r15706675 = r15706673 * r15706674;
        double r15706676 = y;
        double r15706677 = r15706675 * r15706676;
        double r15706678 = r15706677 * r15706676;
        return r15706678;
}

double f(double x, double y) {
        double r15706679 = y;
        double r15706680 = 3.0;
        double r15706681 = r15706679 * r15706680;
        double r15706682 = x;
        double r15706683 = r15706681 * r15706682;
        double r15706684 = r15706683 * r15706679;
        return r15706684;
}

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.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 10.1

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

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

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

Reproduce

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