Average Error: 20.0 → 20.0
Time: 20.8s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
double f(double x, double y, double z) {
        double r41321708 = 2.0;
        double r41321709 = x;
        double r41321710 = y;
        double r41321711 = r41321709 * r41321710;
        double r41321712 = z;
        double r41321713 = r41321709 * r41321712;
        double r41321714 = r41321711 + r41321713;
        double r41321715 = r41321710 * r41321712;
        double r41321716 = r41321714 + r41321715;
        double r41321717 = sqrt(r41321716);
        double r41321718 = r41321708 * r41321717;
        return r41321718;
}

double f(double x, double y, double z) {
        double r41321719 = 2.0;
        double r41321720 = x;
        double r41321721 = y;
        double r41321722 = r41321720 * r41321721;
        double r41321723 = z;
        double r41321724 = r41321720 * r41321723;
        double r41321725 = r41321722 + r41321724;
        double r41321726 = r41321721 * r41321723;
        double r41321727 = r41321725 + r41321726;
        double r41321728 = sqrt(r41321727);
        double r41321729 = r41321719 * r41321728;
        return r41321729;
}

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 2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(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)))))