Average Error: 0.1 → 0.1
Time: 35.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 r25560196 = x;
        double r25560197 = y;
        double r25560198 = r25560196 * r25560197;
        double r25560199 = z;
        double r25560200 = r25560199 * r25560199;
        double r25560201 = r25560198 + r25560200;
        double r25560202 = r25560201 + r25560200;
        double r25560203 = r25560202 + r25560200;
        return r25560203;
}

double f(double x, double y, double z) {
        double r25560204 = z;
        double r25560205 = 3.0;
        double r25560206 = r25560204 * r25560205;
        double r25560207 = r25560204 * r25560206;
        double r25560208 = x;
        double r25560209 = y;
        double r25560210 = r25560208 * r25560209;
        double r25560211 = r25560207 + r25560210;
        return r25560211;
}

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.0 z) z) (* y x))

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