2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\begin{array}{l}
t_0 := 2 \cdot {\left(e^{0.25 \cdot \left(\log \left(-\left(y + z\right)\right) - \log \left(\frac{-1}{x}\right)\right)}\right)}^{2}\\
\mathbf{if}\;y \leq -3.5016519017157693 \cdot 10^{+22}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -5.029427106894932 \cdot 10^{-174}:\\
\;\;\;\;2 \cdot \sqrt{\mathsf{fma}\left(y \cdot x, 1, z \cdot x\right) + y \cdot z}\\
\mathbf{elif}\;y \leq 2.0611617972601002 \cdot 10^{-268}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;2 \cdot {\left(e^{0.25 \cdot \left(\log \left(y + x\right) - \log \left(\frac{1}{z}\right)\right)}\right)}^{2}\\
\end{array}
(FPCore (x y z) :precision binary64 (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
2.0
(pow (exp (* 0.25 (- (log (- (+ y z))) (log (/ -1.0 x))))) 2.0))))
(if (<= y -3.5016519017157693e+22)
t_0
(if (<= y -5.029427106894932e-174)
(* 2.0 (sqrt (+ (fma (* y x) 1.0 (* z x)) (* y z))))
(if (<= y 2.0611617972601002e-268)
t_0
(*
2.0
(pow (exp (* 0.25 (- (log (+ y x)) (log (/ 1.0 z))))) 2.0)))))))double code(double x, double y, double z) {
return 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
}
double code(double x, double y, double z) {
double t_0 = 2.0 * pow(exp((0.25 * (log(-(y + z)) - log((-1.0 / x))))), 2.0);
double tmp;
if (y <= -3.5016519017157693e+22) {
tmp = t_0;
} else if (y <= -5.029427106894932e-174) {
tmp = 2.0 * sqrt((fma((y * x), 1.0, (z * x)) + (y * z)));
} else if (y <= 2.0611617972601002e-268) {
tmp = t_0;
} else {
tmp = 2.0 * pow(exp((0.25 * (log((y + x)) - log((1.0 / z))))), 2.0);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 19.8 |
|---|---|
| Target | 11.7 |
| Herbie | 5.2 |
if y < -3.5016519017157693e22 or -5.0294271068949322e-174 < y < 2.06116179726010015e-268Initial program 34.7
Applied egg-rr34.8
Taylor expanded in x around -inf 7.4
if -3.5016519017157693e22 < y < -5.0294271068949322e-174Initial program 0.6
Applied egg-rr0.6
if 2.06116179726010015e-268 < y Initial program 19.4
Applied egg-rr19.6
Taylor expanded in z around inf 5.9
Final simplification5.2
herbie shell --seed 2022129
(FPCore (x y z)
:name "Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5"
:precision binary64
: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)))))