\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 1.8079115660273032 \cdot 10^{+264}:\\
\;\;\;\;\sqrt{0.5 + \log \left(e^{\frac{0.5}{\sqrt{1 + {\left(\frac{2 \cdot \ell}{Om}\right)}^{2} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)}}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 \cdot \left(1 + \frac{1}{\frac{\sqrt{4 \cdot \left(\ell \cdot \left(\ell \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)\right)\right)}}{Om} + 0.5 \cdot \left(Om \cdot \sqrt{\frac{1}{4 \cdot \left(\ell \cdot \left(\ell \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)\right)\right)}}\right)}\right)}\\
\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) 1.8079115660273032e+264)
(sqrt
(+
0.5
(log
(exp
(/
0.5
(sqrt
(+
1.0
(*
(pow (/ (* 2.0 l) Om) 2.0)
(+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))))))
(sqrt
(*
0.5
(+
1.0
(/
1.0
(+
(/
(sqrt (* 4.0 (* l (* l (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))
Om)
(*
0.5
(*
Om
(sqrt
(/
1.0
(*
4.0
(* l (* l (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))))))))))))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) <= 1.8079115660273032e+264) {
tmp = sqrt(0.5 + log(exp(0.5 / sqrt(1.0 + (pow(((2.0 * l) / Om), 2.0) * (pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))))));
} else {
tmp = sqrt(0.5 * (1.0 + (1.0 / ((sqrt(4.0 * (l * (l * (pow(sin(kx), 2.0) + pow(sin(ky), 2.0))))) / Om) + (0.5 * (Om * sqrt(1.0 / (4.0 * (l * (l * (pow(sin(kx), 2.0) + pow(sin(ky), 2.0))))))))))));
}
return tmp;
}














Bits error versus l














Bits error versus Om














Bits error versus kx














Bits error versus ky
Results
| Alternative 1 | |
|---|---|
| Error | 0.5 |
| Cost | 112513 |
| Alternative 2 | |
|---|---|
| Error | 0.8 |
| Cost | 39872 |
| Alternative 3 | |
|---|---|
| Error | 1.1 |
| Cost | 39744 |
| Alternative 4 | |
|---|---|
| Error | 1.6 |
| Cost | 40450 |
| Alternative 5 | |
|---|---|
| Error | 1.8 |
| Cost | 40136 |
| Alternative 6 | |
|---|---|
| Error | 4.4 |
| Cost | 40136 |
| Alternative 7 | |
|---|---|
| Error | 10.7 |
| Cost | 28164 |
| Alternative 8 | |
|---|---|
| Error | 11.5 |
| Cost | 27843 |
| Alternative 9 | |
|---|---|
| Error | 11.2 |
| Cost | 27715 |
| Alternative 10 | |
|---|---|
| Error | 13.0 |
| Cost | 27080 |
| Alternative 11 | |
|---|---|
| Error | 23.9 |
| Cost | 64 |


if (pow.f64 (/.f64 (*.f64 2 l) Om) 2) < 1.8079115660273032e264Initial program 0.0
Simplified0.0
rmApplied add-log-exp_binary64_4580.0
Simplified0.0
if 1.8079115660273032e264 < (pow.f64 (/.f64 (*.f64 2 l) Om) 2) Initial program 3.6
rmApplied unpow2_binary64_4843.6
Applied associate-*l*_binary64_3602.6
rmApplied add-cube-cbrt_binary64_4542.6
Taylor expanded around 0 15.2
Simplified1.0
Simplified1.0
Final simplification0.3
herbie shell --seed 2021065
(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))))))))))