Average Error: 10.3 → 0.3
Time: 15.5s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(y \cdot x\right) \cdot \left(3 \cdot x\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(y \cdot x\right) \cdot \left(3 \cdot x\right)
double f(double x, double y) {
        double r33486521 = x;
        double r33486522 = 3.0;
        double r33486523 = r33486521 * r33486522;
        double r33486524 = r33486523 * r33486521;
        double r33486525 = y;
        double r33486526 = r33486524 * r33486525;
        return r33486526;
}

double f(double x, double y) {
        double r33486527 = y;
        double r33486528 = x;
        double r33486529 = r33486527 * r33486528;
        double r33486530 = 3.0;
        double r33486531 = r33486530 * r33486528;
        double r33486532 = r33486529 * r33486531;
        return r33486532;
}

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.3
Target0.3
Herbie0.3
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]

Derivation

  1. Initial program 10.3

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

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

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

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

Reproduce

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