Average Error: 0.3 → 0.2
Time: 11.0s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot 3\right) \cdot x\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(\left(y \cdot 3\right) \cdot x\right) \cdot y
double f(double x, double y) {
        double r27370547 = x;
        double r27370548 = 3.0;
        double r27370549 = r27370547 * r27370548;
        double r27370550 = y;
        double r27370551 = r27370549 * r27370550;
        double r27370552 = r27370551 * r27370550;
        return r27370552;
}

double f(double x, double y) {
        double r27370553 = y;
        double r27370554 = 3.0;
        double r27370555 = r27370553 * r27370554;
        double r27370556 = x;
        double r27370557 = r27370555 * r27370556;
        double r27370558 = r27370557 * r27370553;
        return r27370558;
}

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. Final simplification0.2

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

Reproduce

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