Average Error: 0.3 → 0.2
Time: 13.7s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot x\right) \cdot 3\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(\left(y \cdot x\right) \cdot 3\right) \cdot y
double f(double x, double y) {
        double r38491510 = x;
        double r38491511 = 3.0;
        double r38491512 = r38491510 * r38491511;
        double r38491513 = y;
        double r38491514 = r38491512 * r38491513;
        double r38491515 = r38491514 * r38491513;
        return r38491515;
}

double f(double x, double y) {
        double r38491516 = y;
        double r38491517 = x;
        double r38491518 = r38491516 * r38491517;
        double r38491519 = 3.0;
        double r38491520 = r38491518 * r38491519;
        double r38491521 = r38491520 * r38491516;
        return r38491521;
}

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. Final simplification0.2

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

Reproduce

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