Average Error: 0.1 → 0.1
Time: 2.3s
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 r737915 = x;
        double r737916 = y;
        double r737917 = r737915 * r737916;
        double r737918 = z;
        double r737919 = r737918 * r737918;
        double r737920 = r737917 + r737919;
        double r737921 = r737920 + r737919;
        double r737922 = r737921 + r737919;
        return r737922;
}

double f(double x, double y, double z) {
        double r737923 = z;
        double r737924 = 3.0;
        double r737925 = r737923 * r737924;
        double r737926 = r737923 * r737925;
        double r737927 = x;
        double r737928 = y;
        double r737929 = r737927 * r737928;
        double r737930 = r737926 + r737929;
        return r737930;
}

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

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

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

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

Reproduce

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

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

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