Average Error: 0.3 → 0.2
Time: 14.1s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot x\right) \cdot 3\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(\left(y \cdot x\right) \cdot 3\right) \cdot y
double f(double x, double y) {
        double r29236405 = x;
        double r29236406 = 3.0;
        double r29236407 = r29236405 * r29236406;
        double r29236408 = y;
        double r29236409 = r29236407 * r29236408;
        double r29236410 = r29236409 * r29236408;
        return r29236410;
}

double f(double x, double y) {
        double r29236411 = y;
        double r29236412 = x;
        double r29236413 = r29236411 * r29236412;
        double r29236414 = 3.0;
        double r29236415 = r29236413 * r29236414;
        double r29236416 = r29236415 * r29236411;
        return r29236416;
}

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. Taylor expanded around 0 0.2

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

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

Reproduce

herbie shell --seed 2019170 +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))