Average Error: 0.1 → 0.1
Time: 15.1s
Precision: 64
\[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
\[\left(x \cdot y + z \cdot z\right) + 2 \cdot {z}^{2}\]
\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z
\left(x \cdot y + z \cdot z\right) + 2 \cdot {z}^{2}
double f(double x, double y, double z) {
        double r369196 = x;
        double r369197 = y;
        double r369198 = r369196 * r369197;
        double r369199 = z;
        double r369200 = r369199 * r369199;
        double r369201 = r369198 + r369200;
        double r369202 = r369201 + r369200;
        double r369203 = r369202 + r369200;
        return r369203;
}

double f(double x, double y, double z) {
        double r369204 = x;
        double r369205 = y;
        double r369206 = r369204 * r369205;
        double r369207 = z;
        double r369208 = r369207 * r369207;
        double r369209 = r369206 + r369208;
        double r369210 = 2.0;
        double r369211 = pow(r369207, r369210);
        double r369212 = r369210 * r369211;
        double r369213 = r369209 + r369212;
        return r369213;
}

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. Using strategy rm
  3. Applied associate-+l+0.1

    \[\leadsto \color{blue}{\left(x \cdot y + z \cdot z\right) + \left(z \cdot z + z \cdot z\right)}\]
  4. Simplified0.1

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

    \[\leadsto \left(x \cdot y + z \cdot z\right) + 2 \cdot {z}^{2}\]

Reproduce

herbie shell --seed 2019347 +o rules:numerics
(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)))