Average Error: 0.3 → 0.3
Time: 14.1s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
\[\left(y \cdot \left(y \cdot x\right)\right) \cdot 3.0\]
\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y
\left(y \cdot \left(y \cdot x\right)\right) \cdot 3.0
double f(double x, double y) {
        double r39858991 = x;
        double r39858992 = 3.0;
        double r39858993 = r39858991 * r39858992;
        double r39858994 = y;
        double r39858995 = r39858993 * r39858994;
        double r39858996 = r39858995 * r39858994;
        return r39858996;
}

double f(double x, double y) {
        double r39858997 = y;
        double r39858998 = x;
        double r39858999 = r39858997 * r39858998;
        double r39859000 = r39858997 * r39858999;
        double r39859001 = 3.0;
        double r39859002 = r39859000 * r39859001;
        return r39859002;
}

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.3
Herbie0.3
\[\left(x \cdot \left(3.0 \cdot y\right)\right) \cdot y\]

Derivation

  1. Initial program 0.3

    \[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
  2. Taylor expanded around 0 10.4

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

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

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

Reproduce

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