Average Error: 10.6 → 0.2
Time: 28.7s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(y \cdot x\right) \cdot \left(x \cdot 3\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(y \cdot x\right) \cdot \left(x \cdot 3\right)
double f(double x, double y) {
        double r20215443 = x;
        double r20215444 = 3.0;
        double r20215445 = r20215443 * r20215444;
        double r20215446 = r20215445 * r20215443;
        double r20215447 = y;
        double r20215448 = r20215446 * r20215447;
        return r20215448;
}

double f(double x, double y) {
        double r20215449 = y;
        double r20215450 = x;
        double r20215451 = r20215449 * r20215450;
        double r20215452 = 3.0;
        double r20215453 = r20215450 * r20215452;
        double r20215454 = r20215451 * r20215453;
        return r20215454;
}

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.2
\[\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}{3 \cdot \left(x \cdot \left(x \cdot y\right)\right)}\]
  4. Using strategy rm
  5. Applied associate-*r*0.2

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

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

Reproduce

herbie shell --seed 2019200 +o rules:numerics
(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))