\[\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\]
↓
\[\begin{array}{l}
t_1 := \frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th\\
\mathbf{if}\;t_1 \leq 1:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\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 ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))
(sin th))))
(if (<= t_1 1.0) t_1 (* ky (/ (sin th) kx)))))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(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
double tmp;
if (t_1 <= 1.0) {
tmp = t_1;
} else {
tmp = ky * (sin(th) / kx);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
↓
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: t_1
real(8) :: tmp
t_1 = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
if (t_1 <= 1.0d0) then
tmp = t_1
else
tmp = ky * (sin(th) / kx)
end if
code = tmp
end function
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(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
double tmp;
if (t_1 <= 1.0) {
tmp = t_1;
} else {
tmp = ky * (Math.sin(th) / kx);
}
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(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
tmp = 0
if t_1 <= 1.0:
tmp = t_1
else:
tmp = ky * (math.sin(th) / kx)
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(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th))
tmp = 0.0
if (t_1 <= 1.0)
tmp = t_1;
else
tmp = Float64(ky * Float64(sin(th) / kx));
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(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th);
tmp = 0.0;
if (t_1 <= 1.0)
tmp = t_1;
else
tmp = ky * (sin(th) / kx);
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[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]}, If[LessEqual[t$95$1, 1.0], t$95$1, N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision]]]
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
↓
\begin{array}{l}
t_1 := \frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th\\
\mathbf{if}\;t_1 \leq 1:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 17.3 |
|---|
| Cost | 52040 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.0001:\\
\;\;\;\;\left(\sqrt{\frac{1}{{\sin kx}^{2}}} \cdot \sin ky\right) \cdot \sin th\\
\mathbf{elif}\;\sin kx \leq 10^{-14}:\\
\;\;\;\;\frac{\sin ky}{\sqrt{{kx}^{2} + {\sin ky}^{2}}} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 17.1 |
|---|
| Cost | 52040 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.001:\\
\;\;\;\;\left(\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \sin ky\right) \cdot \sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {ky}^{2}}} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 27.9 |
|---|
| Cost | 45576 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.004:\\
\;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-67}:\\
\;\;\;\;\left(\sqrt{\frac{1}{{\sin kx}^{2}}} \cdot \sin ky\right) \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 23.7 |
|---|
| Cost | 45576 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -5 \cdot 10^{-87}:\\
\;\;\;\;\left(\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \sin ky\right) \cdot \sin th\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-67}:\\
\;\;\;\;\left(\sqrt{\frac{1}{{\sin kx}^{2}}} \cdot \sin ky\right) \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 33.9 |
|---|
| Cost | 39880 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -2 \cdot 10^{-98}:\\
\;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-67}:\\
\;\;\;\;\frac{1}{\frac{\sin kx}{ky} + \left(0.5 \cdot \frac{1}{\sin kx} + 0.16666666666666666 \cdot \sin kx\right) \cdot ky} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 33.9 |
|---|
| Cost | 32644 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -2 \cdot 10^{-98}:\\
\;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-67}:\\
\;\;\;\;\frac{ky}{\sin kx} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 37.2 |
|---|
| Cost | 26052 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-67}:\\
\;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 38.3 |
|---|
| Cost | 13384 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -1900000000000:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 2.5 \cdot 10^{-60}:\\
\;\;\;\;\frac{ky}{\sin kx} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 42.1 |
|---|
| Cost | 13380 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-98}:\\
\;\;\;\;-1 \cdot \left(ky \cdot \frac{\sin th}{kx}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 42.1 |
|---|
| Cost | 13316 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-98}:\\
\;\;\;\;\frac{ky}{-kx} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 42.6 |
|---|
| Cost | 13252 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-75}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 43.9 |
|---|
| Cost | 6728 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -1750:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 1.65 \cdot 10^{-192}:\\
\;\;\;\;\frac{0.5}{\frac{\frac{0.5}{th}}{\frac{ky}{kx}}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 50.1 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -1750:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 10^{-66}:\\
\;\;\;\;th \cdot \left(\frac{0.5}{kx} \cdot \left(ky + ky\right)\right)\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 50.2 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -1750:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 1.9 \cdot 10^{-60}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 50.1 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -950:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 1.02 \cdot 10^{-66}:\\
\;\;\;\;th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 55.3 |
|---|
| Cost | 64 |
|---|
\[th
\]