Average Error: 20.0 → 20.0
Time: 13.3s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[\sqrt{z \cdot y + \left(y \cdot x + x \cdot z\right)} \cdot 2\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\sqrt{z \cdot y + \left(y \cdot x + x \cdot z\right)} \cdot 2
double f(double x, double y, double z) {
        double r801826 = 2.0;
        double r801827 = x;
        double r801828 = y;
        double r801829 = r801827 * r801828;
        double r801830 = z;
        double r801831 = r801827 * r801830;
        double r801832 = r801829 + r801831;
        double r801833 = r801828 * r801830;
        double r801834 = r801832 + r801833;
        double r801835 = sqrt(r801834);
        double r801836 = r801826 * r801835;
        return r801836;
}

double f(double x, double y, double z) {
        double r801837 = z;
        double r801838 = y;
        double r801839 = r801837 * r801838;
        double r801840 = x;
        double r801841 = r801838 * r801840;
        double r801842 = r801840 * r801837;
        double r801843 = r801841 + r801842;
        double r801844 = r801839 + r801843;
        double r801845 = sqrt(r801844);
        double r801846 = 2.0;
        double r801847 = r801845 * r801846;
        return r801847;
}

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

Original20.0
Target19.0
Herbie20.0
\[\begin{array}{l} \mathbf{if}\;z \lt 7.636950090573674520215292914121377944071 \cdot 10^{176}:\\ \;\;\;\;2 \cdot \sqrt{\left(x + y\right) \cdot z + x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(0.25 \cdot \left(\left({y}^{-0.75} \cdot \left({z}^{-0.75} \cdot x\right)\right) \cdot \left(y + z\right)\right) + {z}^{0.25} \cdot {y}^{0.25}\right) \cdot \left(0.25 \cdot \left(\left({y}^{-0.75} \cdot \left({z}^{-0.75} \cdot x\right)\right) \cdot \left(y + z\right)\right) + {z}^{0.25} \cdot {y}^{0.25}\right)\right) \cdot 2\\ \end{array}\]

Derivation

  1. Initial program 20.0

    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
  2. Final simplification20.0

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

Reproduce

herbie shell --seed 2019174 
(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)))) (* (* (+ (* 0.25 (* (* (pow y -0.75) (* (pow z -0.75) x)) (+ y z))) (* (pow z 0.25) (pow y 0.25))) (+ (* 0.25 (* (* (pow y -0.75) (* (pow z -0.75) x)) (+ y z))) (* (pow z 0.25) (pow y 0.25)))) 2.0))

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