Average Error: 0.3 → 0.2
Time: 6.9s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(x \cdot y\right) \cdot \left(y \cdot 3\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(x \cdot y\right) \cdot \left(y \cdot 3\right)
double f(double x, double y) {
        double r38272920 = x;
        double r38272921 = 3.0;
        double r38272922 = r38272920 * r38272921;
        double r38272923 = y;
        double r38272924 = r38272922 * r38272923;
        double r38272925 = r38272924 * r38272923;
        return r38272925;
}

double f(double x, double y) {
        double r38272926 = x;
        double r38272927 = y;
        double r38272928 = r38272926 * r38272927;
        double r38272929 = 3.0;
        double r38272930 = r38272927 * r38272929;
        double r38272931 = r38272928 * r38272930;
        return r38272931;
}

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. Taylor expanded around 0 10.4

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

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

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

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

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

Reproduce

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