Average Error: 20.3 → 20.3
Time: 17.7s
Precision: 64
\[2 \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\]
2 \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
double f(double x, double y, double z) {
        double r30035157 = 2.0;
        double r30035158 = x;
        double r30035159 = y;
        double r30035160 = r30035158 * r30035159;
        double r30035161 = z;
        double r30035162 = r30035158 * r30035161;
        double r30035163 = r30035160 + r30035162;
        double r30035164 = r30035159 * r30035161;
        double r30035165 = r30035163 + r30035164;
        double r30035166 = sqrt(r30035165);
        double r30035167 = r30035157 * r30035166;
        return r30035167;
}

double f(double x, double y, double z) {
        double r30035168 = y;
        double r30035169 = z;
        double r30035170 = r30035168 + r30035169;
        double r30035171 = x;
        double r30035172 = r30035170 * r30035171;
        double r30035173 = r30035169 * r30035168;
        double r30035174 = r30035172 + r30035173;
        double r30035175 = sqrt(r30035174);
        double r30035176 = 2.0;
        double r30035177 = r30035175 * r30035176;
        return r30035177;
}

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.3
Target19.3
Herbie20.3
\[\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.3

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

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

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

Reproduce

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