Average Error: 20.1 → 20.1
Time: 56.6s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[\sqrt{z \cdot y + \left(y \cdot x + z \cdot x\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 + z \cdot x\right)} \cdot 2
double f(double x, double y, double z) {
        double r29908290 = 2.0;
        double r29908291 = x;
        double r29908292 = y;
        double r29908293 = r29908291 * r29908292;
        double r29908294 = z;
        double r29908295 = r29908291 * r29908294;
        double r29908296 = r29908293 + r29908295;
        double r29908297 = r29908292 * r29908294;
        double r29908298 = r29908296 + r29908297;
        double r29908299 = sqrt(r29908298);
        double r29908300 = r29908290 * r29908299;
        return r29908300;
}

double f(double x, double y, double z) {
        double r29908301 = z;
        double r29908302 = y;
        double r29908303 = r29908301 * r29908302;
        double r29908304 = x;
        double r29908305 = r29908302 * r29908304;
        double r29908306 = r29908301 * r29908304;
        double r29908307 = r29908305 + r29908306;
        double r29908308 = r29908303 + r29908307;
        double r29908309 = sqrt(r29908308);
        double r29908310 = 2.0;
        double r29908311 = r29908309 * r29908310;
        return r29908311;
}

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

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

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

Reproduce

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