Average Error: 18.3 → 18.3
Time: 14.9s
Precision: 64
\[2.0 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[\sqrt{\left(y + z\right) \cdot x + z \cdot y} \cdot 2.0\]
2.0 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\sqrt{\left(y + z\right) \cdot x + z \cdot y} \cdot 2.0
double f(double x, double y, double z) {
        double r32678218 = 2.0;
        double r32678219 = x;
        double r32678220 = y;
        double r32678221 = r32678219 * r32678220;
        double r32678222 = z;
        double r32678223 = r32678219 * r32678222;
        double r32678224 = r32678221 + r32678223;
        double r32678225 = r32678220 * r32678222;
        double r32678226 = r32678224 + r32678225;
        double r32678227 = sqrt(r32678226);
        double r32678228 = r32678218 * r32678227;
        return r32678228;
}

double f(double x, double y, double z) {
        double r32678229 = y;
        double r32678230 = z;
        double r32678231 = r32678229 + r32678230;
        double r32678232 = x;
        double r32678233 = r32678231 * r32678232;
        double r32678234 = r32678230 * r32678229;
        double r32678235 = r32678233 + r32678234;
        double r32678236 = sqrt(r32678235);
        double r32678237 = 2.0;
        double r32678238 = r32678236 * r32678237;
        return r32678238;
}

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

Original18.3
Target17.5
Herbie18.3
\[\begin{array}{l} \mathbf{if}\;z \lt 7.636950090573675 \cdot 10^{+176}:\\ \;\;\;\;2.0 \cdot \sqrt{\left(x + y\right) \cdot z + x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{1}{4} \cdot \left(\left({y}^{\frac{-3}{4}} \cdot \left({z}^{\frac{-3}{4}} \cdot x\right)\right) \cdot \left(y + z\right)\right) + {z}^{\frac{1}{4}} \cdot {y}^{\frac{1}{4}}\right) \cdot \left(\frac{1}{4} \cdot \left(\left({y}^{\frac{-3}{4}} \cdot \left({z}^{\frac{-3}{4}} \cdot x\right)\right) \cdot \left(y + z\right)\right) + {z}^{\frac{1}{4}} \cdot {y}^{\frac{1}{4}}\right)\right) \cdot 2.0\\ \end{array}\]

Derivation

  1. Initial program 18.3

    \[2.0 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
  2. Simplified18.3

    \[\leadsto \color{blue}{\sqrt{z \cdot y + \left(y + z\right) \cdot x} \cdot 2.0}\]
  3. Final simplification18.3

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

Reproduce

herbie shell --seed 2019164 
(FPCore (x y z)
  :name "Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5"

  :herbie-target
  (if (< z 7.636950090573675e+176) (* 2.0 (sqrt (+ (* (+ x y) z) (* x y)))) (* (* (+ (* 1/4 (* (* (pow y -3/4) (* (pow z -3/4) x)) (+ y z))) (* (pow z 1/4) (pow y 1/4))) (+ (* 1/4 (* (* (pow y -3/4) (* (pow z -3/4) x)) (+ y z))) (* (pow z 1/4) (pow y 1/4)))) 2.0))

  (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))