Average Error: 0.1 → 0.1
Time: 13.6s
Precision: 64
\[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
\[z \cdot \left(z \cdot 3\right) + x \cdot y\]
\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z
z \cdot \left(z \cdot 3\right) + x \cdot y
double f(double x, double y, double z) {
        double r26521960 = x;
        double r26521961 = y;
        double r26521962 = r26521960 * r26521961;
        double r26521963 = z;
        double r26521964 = r26521963 * r26521963;
        double r26521965 = r26521962 + r26521964;
        double r26521966 = r26521965 + r26521964;
        double r26521967 = r26521966 + r26521964;
        return r26521967;
}

double f(double x, double y, double z) {
        double r26521968 = z;
        double r26521969 = 3.0;
        double r26521970 = r26521968 * r26521969;
        double r26521971 = r26521968 * r26521970;
        double r26521972 = x;
        double r26521973 = y;
        double r26521974 = r26521972 * r26521973;
        double r26521975 = r26521971 + r26521974;
        return r26521975;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[\left(3 \cdot z\right) \cdot z + y \cdot x\]

Derivation

  1. Initial program 0.1

    \[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
  2. Simplified0.1

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

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

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

Reproduce

herbie shell --seed 2019162 
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, A"

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

  (+ (+ (+ (* x y) (* z z)) (* z z)) (* z z)))