Average Error: 0.3 → 0.2
Time: 6.9s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(y \cdot 3\right) \cdot \left(x \cdot y\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(y \cdot 3\right) \cdot \left(x \cdot y\right)
double f(double x, double y) {
        double r559462 = x;
        double r559463 = 3.0;
        double r559464 = r559462 * r559463;
        double r559465 = y;
        double r559466 = r559464 * r559465;
        double r559467 = r559466 * r559465;
        return r559467;
}

double f(double x, double y) {
        double r559468 = y;
        double r559469 = 3.0;
        double r559470 = r559468 * r559469;
        double r559471 = x;
        double r559472 = r559471 * r559468;
        double r559473 = r559470 * r559472;
        return r559473;
}

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. Using strategy rm
  3. Applied associate-*l*0.2

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

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

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

    \[\leadsto \color{blue}{y \cdot \left(3 \cdot \left(x \cdot y\right)\right)}\]
  7. Using strategy rm
  8. Applied associate-*r*0.2

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

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

Reproduce

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