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\]
\[x \cdot y + \left(z \cdot z\right) \cdot 3\]
\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z
x \cdot y + \left(z \cdot z\right) \cdot 3
double f(double x, double y, double z) {
        double r29958077 = x;
        double r29958078 = y;
        double r29958079 = r29958077 * r29958078;
        double r29958080 = z;
        double r29958081 = r29958080 * r29958080;
        double r29958082 = r29958079 + r29958081;
        double r29958083 = r29958082 + r29958081;
        double r29958084 = r29958083 + r29958081;
        return r29958084;
}

double f(double x, double y, double z) {
        double r29958085 = x;
        double r29958086 = y;
        double r29958087 = r29958085 * r29958086;
        double r29958088 = z;
        double r29958089 = r29958088 * r29958088;
        double r29958090 = 3.0;
        double r29958091 = r29958089 * r29958090;
        double r29958092 = r29958087 + r29958091;
        return r29958092;
}

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 +-commutative0.1

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

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

Reproduce

herbie shell --seed 2019158 
(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)))