Average Error: 0.1 → 0.1
Time: 8.0s
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 r23393215 = x;
        double r23393216 = y;
        double r23393217 = r23393215 * r23393216;
        double r23393218 = z;
        double r23393219 = r23393218 * r23393218;
        double r23393220 = r23393217 + r23393219;
        double r23393221 = r23393220 + r23393219;
        double r23393222 = r23393221 + r23393219;
        return r23393222;
}

double f(double x, double y, double z) {
        double r23393223 = x;
        double r23393224 = y;
        double r23393225 = r23393223 * r23393224;
        double r23393226 = z;
        double r23393227 = 3.0;
        double r23393228 = r23393226 * r23393227;
        double r23393229 = r23393226 * r23393228;
        double r23393230 = r23393225 + r23393229;
        return r23393230;
}

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