Average Error: 0.1 → 0.1
Time: 10.1s
Precision: 64
\[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
\[x \cdot y + z \cdot \left(z \cdot 3\right)\]
\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z
x \cdot y + z \cdot \left(z \cdot 3\right)
double f(double x, double y, double z) {
        double r341056 = x;
        double r341057 = y;
        double r341058 = r341056 * r341057;
        double r341059 = z;
        double r341060 = r341059 * r341059;
        double r341061 = r341058 + r341060;
        double r341062 = r341061 + r341060;
        double r341063 = r341062 + r341060;
        return r341063;
}

double f(double x, double y, double z) {
        double r341064 = x;
        double r341065 = y;
        double r341066 = r341064 * r341065;
        double r341067 = z;
        double r341068 = 3.0;
        double r341069 = r341067 * r341068;
        double r341070 = r341067 * r341069;
        double r341071 = r341066 + r341070;
        return r341071;
}

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}{x \cdot y + \left(z \cdot z\right) \cdot 3}\]
  3. Using strategy rm
  4. Applied associate-*l*0.1

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

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

Reproduce

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

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

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