Average Error: 0.1 → 0.1
Time: 14.8s
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 r26818840 = x;
        double r26818841 = y;
        double r26818842 = r26818840 * r26818841;
        double r26818843 = z;
        double r26818844 = r26818843 * r26818843;
        double r26818845 = r26818842 + r26818844;
        double r26818846 = r26818845 + r26818844;
        double r26818847 = r26818846 + r26818844;
        return r26818847;
}

double f(double x, double y, double z) {
        double r26818848 = z;
        double r26818849 = 3.0;
        double r26818850 = r26818848 * r26818849;
        double r26818851 = r26818848 * r26818850;
        double r26818852 = x;
        double r26818853 = y;
        double r26818854 = r26818852 * r26818853;
        double r26818855 = r26818851 + r26818854;
        return r26818855;
}

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 2019168 
(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)))