Average Error: 0.1 → 0.1
Time: 2.7s
Precision: 64
\[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
\[x \cdot y + 3 \cdot \left(z \cdot z\right)\]
\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z
x \cdot y + 3 \cdot \left(z \cdot z\right)
double f(double x, double y, double z) {
        double r510076 = x;
        double r510077 = y;
        double r510078 = r510076 * r510077;
        double r510079 = z;
        double r510080 = r510079 * r510079;
        double r510081 = r510078 + r510080;
        double r510082 = r510081 + r510080;
        double r510083 = r510082 + r510080;
        return r510083;
}

double f(double x, double y, double z) {
        double r510084 = x;
        double r510085 = y;
        double r510086 = r510084 * r510085;
        double r510087 = 3.0;
        double r510088 = z;
        double r510089 = r510088 * r510088;
        double r510090 = r510087 * r510089;
        double r510091 = r510086 + r510090;
        return r510091;
}

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 *-un-lft-identity0.1

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

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

Reproduce

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