Average Error: 10.6 → 0.3
Time: 38.4s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(\left(y \cdot 3\right) \cdot x\right) \cdot x\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(\left(y \cdot 3\right) \cdot x\right) \cdot x
double f(double x, double y) {
        double r33398229 = x;
        double r33398230 = 3.0;
        double r33398231 = r33398229 * r33398230;
        double r33398232 = r33398231 * r33398229;
        double r33398233 = y;
        double r33398234 = r33398232 * r33398233;
        return r33398234;
}

double f(double x, double y) {
        double r33398235 = y;
        double r33398236 = 3.0;
        double r33398237 = r33398235 * r33398236;
        double r33398238 = x;
        double r33398239 = r33398237 * r33398238;
        double r33398240 = r33398239 * r33398238;
        return r33398240;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.6
Target0.2
Herbie0.3
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]

Derivation

  1. Initial program 10.6

    \[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
  2. Taylor expanded around 0 10.6

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

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

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

Reproduce

herbie shell --seed 2019200 
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, A"

  :herbie-target
  (* (* x 3.0) (* x y))

  (* (* (* x 3.0) x) y))