Average Error: 0.1 → 0.2
Time: 12.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) + \sqrt{z \cdot z + z \cdot z} \cdot \sqrt{z \cdot z + z \cdot z}\]
\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z
\left(x \cdot y + z \cdot z\right) + \sqrt{z \cdot z + z \cdot z} \cdot \sqrt{z \cdot z + z \cdot z}
double f(double x, double y, double z) {
        double r29367067 = x;
        double r29367068 = y;
        double r29367069 = r29367067 * r29367068;
        double r29367070 = z;
        double r29367071 = r29367070 * r29367070;
        double r29367072 = r29367069 + r29367071;
        double r29367073 = r29367072 + r29367071;
        double r29367074 = r29367073 + r29367071;
        return r29367074;
}

double f(double x, double y, double z) {
        double r29367075 = x;
        double r29367076 = y;
        double r29367077 = r29367075 * r29367076;
        double r29367078 = z;
        double r29367079 = r29367078 * r29367078;
        double r29367080 = r29367077 + r29367079;
        double r29367081 = r29367079 + r29367079;
        double r29367082 = sqrt(r29367081);
        double r29367083 = r29367082 * r29367082;
        double r29367084 = r29367080 + r29367083;
        return r29367084;
}

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.2
\[\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. Using strategy rm
  5. Applied add-sqr-sqrt0.2

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

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

Reproduce

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

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

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