Average Error: 0.3 → 0.2
Time: 7.3s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(x \cdot \left(y \cdot 3\right)\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(x \cdot \left(y \cdot 3\right)\right) \cdot y
double f(double x, double y) {
        double r559451 = x;
        double r559452 = 3.0;
        double r559453 = r559451 * r559452;
        double r559454 = y;
        double r559455 = r559453 * r559454;
        double r559456 = r559455 * r559454;
        return r559456;
}

double f(double x, double y) {
        double r559457 = x;
        double r559458 = y;
        double r559459 = 3.0;
        double r559460 = r559458 * r559459;
        double r559461 = r559457 * r559460;
        double r559462 = r559461 * r559458;
        return r559462;
}

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 pow10.3

    \[\leadsto \left(\left(x \cdot 3\right) \cdot \color{blue}{{y}^{1}}\right) \cdot y\]
  4. Applied pow10.3

    \[\leadsto \left(\left(x \cdot \color{blue}{{3}^{1}}\right) \cdot {y}^{1}\right) \cdot y\]
  5. Applied pow10.3

    \[\leadsto \left(\left(\color{blue}{{x}^{1}} \cdot {3}^{1}\right) \cdot {y}^{1}\right) \cdot y\]
  6. Applied pow-prod-down0.3

    \[\leadsto \left(\color{blue}{{\left(x \cdot 3\right)}^{1}} \cdot {y}^{1}\right) \cdot y\]
  7. Applied pow-prod-down0.3

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

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

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

Reproduce

herbie shell --seed 2019212 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, B"
  :precision binary64

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

  (* (* (* x 3) y) y))