\sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\sqrt{1 + {\left(\frac{2 \cdot \ell}{Om}\right)}^{2} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)}}\right)}
\begin{array}{l}
t_0 := {\sin kx}^{2}\\
t_1 := {\sin ky}^{2}\\
t_2 := {\left(\frac{2 \cdot \ell}{Om}\right)}^{2}\\
\mathbf{if}\;t_2 \leq 3.033132613028815 \cdot 10^{+261}:\\
\;\;\;\;\sqrt{0.5 + \frac{0.5}{\sqrt[3]{{\left(\mathsf{fma}\left(t_2, t_0 + t_1, 1\right)\right)}^{1.5}}}}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \frac{4}{Om} \cdot \left(\frac{t_1}{Om} + \frac{t_0}{Om}\right)\\
\sqrt{0.5 + \frac{0.5}{\mathsf{fma}\left(\ell, \sqrt{t_3}, 0.5 \cdot \frac{{t_3}^{-0.5}}{\ell}\right)}}
\end{array}\\
\end{array}
(FPCore (l Om kx ky)
:precision binary64
(sqrt
(*
(/ 1.0 2.0)
(+
1.0
(/
1.0
(sqrt
(+
1.0
(*
(pow (/ (* 2.0 l) Om) 2.0)
(+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))))))(FPCore (l Om kx ky)
:precision binary64
(let* ((t_0 (pow (sin kx) 2.0))
(t_1 (pow (sin ky) 2.0))
(t_2 (pow (/ (* 2.0 l) Om) 2.0)))
(if (<= t_2 3.033132613028815e+261)
(sqrt (+ 0.5 (/ 0.5 (cbrt (pow (fma t_2 (+ t_0 t_1) 1.0) 1.5)))))
(let* ((t_3 (* (/ 4.0 Om) (+ (/ t_1 Om) (/ t_0 Om)))))
(sqrt
(+ 0.5 (/ 0.5 (fma l (sqrt t_3) (* 0.5 (/ (pow t_3 -0.5) l))))))))))double code(double l, double Om, double kx, double ky) {
return sqrt((1.0 / 2.0) * (1.0 + (1.0 / sqrt(1.0 + (pow(((2.0 * l) / Om), 2.0) * (pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))))));
}
double code(double l, double Om, double kx, double ky) {
double t_0 = pow(sin(kx), 2.0);
double t_1 = pow(sin(ky), 2.0);
double t_2 = pow(((2.0 * l) / Om), 2.0);
double tmp;
if (t_2 <= 3.033132613028815e+261) {
tmp = sqrt(0.5 + (0.5 / cbrt(pow(fma(t_2, (t_0 + t_1), 1.0), 1.5))));
} else {
double t_3 = (4.0 / Om) * ((t_1 / Om) + (t_0 / Om));
tmp = sqrt(0.5 + (0.5 / fma(l, sqrt(t_3), (0.5 * (pow(t_3, -0.5) / l)))));
}
return tmp;
}



Bits error versus l



Bits error versus Om



Bits error versus kx



Bits error versus ky
if (pow.f64 (/.f64 (*.f64 2 l) Om) 2) < 3.03313261302881495e261Initial program 0.0
Simplified0.0
rmApplied add-cbrt-cube_binary640.0
Simplified0.0
if 3.03313261302881495e261 < (pow.f64 (/.f64 (*.f64 2 l) Om) 2) Initial program 3.4
Simplified3.4
Taylor expanded around inf 14.5
Simplified0.9
rmApplied inv-pow_binary640.9
Applied sqrt-pow1_binary640.9
Simplified0.9
Final simplification0.3
herbie shell --seed 2021211
(FPCore (l Om kx ky)
:name "Toniolo and Linder, Equation (3a)"
:precision binary64
(sqrt (* (/ 1.0 2.0) (+ 1.0 (/ 1.0 (sqrt (+ 1.0 (* (pow (/ (* 2.0 l) Om) 2.0) (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))))))