\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}
\mathbf{if}\;{\left(\frac{2 \cdot \ell}{Om}\right)}^{2} \leq 6.582775082776307 \cdot 10^{+292}:\\
\;\;\;\;\sqrt{0.5 + \sqrt[3]{{\left(\frac{0.5}{\sqrt{1 + {\left(\frac{2 \cdot \ell}{Om}\right)}^{2} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)}}\right)}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5}\\
\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
(if (<= (pow (/ (* 2.0 l) Om) 2.0) 6.582775082776307e+292)
(sqrt
(+
0.5
(cbrt
(pow
(/
0.5
(sqrt
(+
1.0
(*
(pow (/ (* 2.0 l) Om) 2.0)
(+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))
3.0))))
(sqrt 0.5)))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 tmp;
if (pow(((2.0 * l) / Om), 2.0) <= 6.582775082776307e+292) {
tmp = sqrt(0.5 + cbrt(pow((0.5 / sqrt(1.0 + (pow(((2.0 * l) / Om), 2.0) * (pow(sin(kx), 2.0) + pow(sin(ky), 2.0))))), 3.0)));
} else {
tmp = sqrt(0.5);
}
return tmp;
}



Bits error versus l



Bits error versus Om



Bits error versus kx



Bits error versus ky
Results
if (pow.f64 (/.f64 (*.f64 2 l) Om) 2) < 6.5827750827763074e292Initial program 0.0
Simplified0.0
rmApplied add-cbrt-cube_binary640.0
Simplified0.0
if 6.5827750827763074e292 < (pow.f64 (/.f64 (*.f64 2 l) Om) 2) Initial program 3.1
Simplified3.1
Taylor expanded around 0 0.9
Final simplification0.3
herbie shell --seed 2020260
(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))))))))))