\[\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\]
↓
\[\begin{array}{l}
t_1 := \frac{\sin th \cdot \sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{if}\;\sin kx \leq -0.04:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin kx \leq 10^{-7}:\\
\;\;\;\;\frac{\sin th}{\frac{\mathsf{hypot}\left(kx, \sin ky\right)}{\sin ky}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
(FPCore (kx ky th)
:precision binary64
(* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
↓
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (* (sin th) (sin ky)) (hypot (sin ky) (sin kx)))))
(if (<= (sin kx) -0.04)
t_1
(if (<= (sin kx) 1e-7)
(/ (sin th) (/ (hypot kx (sin ky)) (sin ky)))
t_1))))double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
↓
double code(double kx, double ky, double th) {
double t_1 = (sin(th) * sin(ky)) / hypot(sin(ky), sin(kx));
double tmp;
if (sin(kx) <= -0.04) {
tmp = t_1;
} else if (sin(kx) <= 1e-7) {
tmp = sin(th) / (hypot(kx, sin(ky)) / sin(ky));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
↓
public static double code(double kx, double ky, double th) {
double t_1 = (Math.sin(th) * Math.sin(ky)) / Math.hypot(Math.sin(ky), Math.sin(kx));
double tmp;
if (Math.sin(kx) <= -0.04) {
tmp = t_1;
} else if (Math.sin(kx) <= 1e-7) {
tmp = Math.sin(th) / (Math.hypot(kx, Math.sin(ky)) / Math.sin(ky));
} else {
tmp = t_1;
}
return tmp;
}
def code(kx, ky, th):
return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
↓
def code(kx, ky, th):
t_1 = (math.sin(th) * math.sin(ky)) / math.hypot(math.sin(ky), math.sin(kx))
tmp = 0
if math.sin(kx) <= -0.04:
tmp = t_1
elif math.sin(kx) <= 1e-7:
tmp = math.sin(th) / (math.hypot(kx, math.sin(ky)) / math.sin(ky))
else:
tmp = t_1
return tmp
function code(kx, ky, th)
return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th))
end
↓
function code(kx, ky, th)
t_1 = Float64(Float64(sin(th) * sin(ky)) / hypot(sin(ky), sin(kx)))
tmp = 0.0
if (sin(kx) <= -0.04)
tmp = t_1;
elseif (sin(kx) <= 1e-7)
tmp = Float64(sin(th) / Float64(hypot(kx, sin(ky)) / sin(ky)));
else
tmp = t_1;
end
return tmp
end
function tmp = code(kx, ky, th)
tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th);
end
↓
function tmp_2 = code(kx, ky, th)
t_1 = (sin(th) * sin(ky)) / hypot(sin(ky), sin(kx));
tmp = 0.0;
if (sin(kx) <= -0.04)
tmp = t_1;
elseif (sin(kx) <= 1e-7)
tmp = sin(th) / (hypot(kx, sin(ky)) / sin(ky));
else
tmp = t_1;
end
tmp_2 = tmp;
end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
↓
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[(N[Sin[th], $MachinePrecision] * N[Sin[ky], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.04], t$95$1, If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-7], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[kx ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
↓
\begin{array}{l}
t_1 := \frac{\sin th \cdot \sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{if}\;\sin kx \leq -0.04:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin kx \leq 10^{-7}:\\
\;\;\;\;\frac{\sin th}{\frac{\mathsf{hypot}\left(kx, \sin ky\right)}{\sin ky}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 13.9 |
|---|
| Cost | 65356 |
|---|
\[\begin{array}{l}
t_1 := \sin th \cdot \frac{\sin ky}{\sqrt{0.5 + \cos \left(kx \cdot 2\right) \cdot -0.5}}\\
t_2 := {\sin kx}^{2}\\
\mathbf{if}\;t_2 \leq 5 \cdot 10^{-10}:\\
\;\;\;\;\frac{\sin th}{\frac{\mathsf{hypot}\left(kx, \sin ky\right)}{\sin ky}}\\
\mathbf{elif}\;t_2 \leq 0.22:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq 0.54:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right) \cdot \left(\frac{1}{th} + th \cdot 0.16666666666666666\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 24.9 |
|---|
| Cost | 58644 |
|---|
\[\begin{array}{l}
t_1 := \left(\sin th \cdot ky\right) \cdot \sqrt{\frac{1}{0.5 + \cos \left(kx \cdot 2\right) \cdot -0.5}}\\
\mathbf{if}\;\sin th \leq -0.96:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin th \leq -0.66:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin th \leq -0.296:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin th \leq -0.05:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin th \leq 4 \cdot 10^{-5}:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 14.6 |
|---|
| Cost | 52112 |
|---|
\[\begin{array}{l}
t_1 := \left(\sin th \cdot ky\right) \cdot \sqrt{\frac{1}{0.5 + \cos \left(kx \cdot 2\right) \cdot -0.5}}\\
\mathbf{if}\;\sin kx \leq -0.912:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin kx \leq -0.484:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{th}}\\
\mathbf{elif}\;\sin kx \leq -0.05:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\frac{\sin th}{\frac{\mathsf{hypot}\left(kx, \sin ky\right)}{\sin ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 37.1 |
|---|
| Cost | 45648 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -2 \cdot 10^{-44}:\\
\;\;\;\;ky \cdot \frac{th}{\sqrt{{\sin kx}^{2}}}\\
\mathbf{elif}\;\sin kx \leq -5 \cdot 10^{-273}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin kx \leq 10^{-250}:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-128}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 33.7 |
|---|
| Cost | 45648 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.05:\\
\;\;\;\;\left(\sin th \cdot ky\right) \cdot \sqrt{\frac{1}{0.5 + \cos \left(kx \cdot 2\right) \cdot -0.5}}\\
\mathbf{elif}\;\sin kx \leq -5 \cdot 10^{-273}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin kx \leq 10^{-250}:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-128}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 13.2 |
|---|
| Cost | 39048 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.04:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{0.5 + \cos \left(kx \cdot 2\right) \cdot -0.5}}\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\frac{\sin th}{\frac{\mathsf{hypot}\left(kx, \sin ky\right)}{\sin ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 0.2 |
|---|
| Cost | 32384 |
|---|
\[\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{\sin ky}}
\]
| Alternative 8 |
|---|
| Error | 34.4 |
|---|
| Cost | 26184 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -5 \cdot 10^{-25}:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-126}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 38.4 |
|---|
| Cost | 13384 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -2.6852159100877643 \cdot 10^{+33}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 1.761721877997747 \cdot 10^{-126}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 38.4 |
|---|
| Cost | 13384 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -2.6852159100877643 \cdot 10^{+33}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 1.761721877997747 \cdot 10^{-126}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 44.1 |
|---|
| Cost | 13252 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-237}:\\
\;\;\;\;th \cdot \frac{\sin ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 43.6 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -1078333431473.9033:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 3.731262313640193 \cdot 10^{-239}:\\
\;\;\;\;\frac{ky}{\frac{\sin kx}{th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 43.5 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -1078333431473.9033:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 3.731262313640193 \cdot 10^{-239}:\\
\;\;\;\;th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 44.9 |
|---|
| Cost | 6728 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -3.987174777426221 \cdot 10^{+42}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 6.586137216934689 \cdot 10^{-238}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 49.9 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -1078333431473.9033:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 1.761721877997747 \cdot 10^{-126}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 55.2 |
|---|
| Cost | 64 |
|---|
\[th
\]