Average Error: 0.3 → 0.3
Time: 15.4s
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 r22464947 = x;
        double r22464948 = 3.0;
        double r22464949 = r22464947 * r22464948;
        double r22464950 = y;
        double r22464951 = r22464949 * r22464950;
        double r22464952 = r22464951 * r22464950;
        return r22464952;
}

double f(double x, double y) {
        double r22464953 = y;
        double r22464954 = x;
        double r22464955 = r22464953 * r22464954;
        double r22464956 = r22464953 * r22464955;
        double r22464957 = 3.0;
        double r22464958 = r22464956 * r22464957;
        return r22464958;
}

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 0.3

    \[\leadsto \color{blue}{\left(3.0 \cdot \left(x \cdot y\right)\right)} \cdot y\]
  3. Using strategy rm
  4. Applied associate-*l*0.3

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

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

Reproduce

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