\[\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}}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{\sin ky}{-kx} \cdot \sin th\\
\mathbf{elif}\;t_1 \leq 0.9998:\\
\;\;\;\;t_1 \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\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))))))
(if (<= t_1 (- INFINITY))
(* (/ (sin ky) (- kx)) (sin th))
(if (<= t_1 0.9998) (* t_1 (sin th)) (sin th)))))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)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (sin(ky) / -kx) * sin(th);
} else if (t_1 <= 0.9998) {
tmp = t_1 * sin(th);
} else {
tmp = sin(th);
}
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(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (Math.sin(ky) / -kx) * Math.sin(th);
} else if (t_1 <= 0.9998) {
tmp = t_1 * Math.sin(th);
} else {
tmp = Math.sin(th);
}
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)))
tmp = 0
if t_1 <= -math.inf:
tmp = (math.sin(ky) / -kx) * math.sin(th)
elif t_1 <= 0.9998:
tmp = t_1 * math.sin(th)
else:
tmp = math.sin(th)
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(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0))))
tmp = 0.0
if (t_1 <= Float64(-Inf))
tmp = Float64(Float64(sin(ky) / Float64(-kx)) * sin(th));
elseif (t_1 <= 0.9998)
tmp = Float64(t_1 * sin(th));
else
tmp = sin(th);
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)));
tmp = 0.0;
if (t_1 <= -Inf)
tmp = (sin(ky) / -kx) * sin(th);
elseif (t_1 <= 0.9998)
tmp = t_1 * sin(th);
else
tmp = sin(th);
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[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]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[Sin[ky], $MachinePrecision] / (-kx)), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.9998], N[(t$95$1 * N[Sin[th], $MachinePrecision]), $MachinePrecision], N[Sin[th], $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}}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{\sin ky}{-kx} \cdot \sin th\\
\mathbf{elif}\;t_1 \leq 0.9998:\\
\;\;\;\;t_1 \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 18.4 |
|---|
| Cost | 52040 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.001:\\
\;\;\;\;\frac{\sin ky}{\sqrt{{kx}^{2} + {\sin ky}^{2}}} \cdot \sin th\\
\mathbf{elif}\;\sin ky \leq 10^{-5}:\\
\;\;\;\;\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {ky}^{2}}} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 33.2 |
|---|
| Cost | 45640 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-130}:\\
\;\;\;\;\frac{\sin ky}{\sqrt{{kx}^{2} + {ky}^{2}}} \cdot \sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-179}:\\
\;\;\;\;\frac{ky}{\sin kx} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 24.2 |
|---|
| Cost | 45508 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq 10^{-22}:\\
\;\;\;\;\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 4 |
|---|
| Error | 34.7 |
|---|
| Cost | 32644 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-179}:\\
\;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 38.0 |
|---|
| Cost | 32584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -1 \cdot 10^{-85}:\\
\;\;\;\;\frac{\sin ky}{-kx} \cdot \sin th\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-155}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 40.5 |
|---|
| Cost | 26184 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -1 \cdot 10^{-85}:\\
\;\;\;\;-\frac{\sin ky \cdot th}{kx}\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-141}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky}{\sin kx} \cdot \sin th\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 40.7 |
|---|
| Cost | 26184 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -1 \cdot 10^{-85}:\\
\;\;\;\;-\frac{\sin ky \cdot th}{kx}\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-141}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th \cdot ky}{\sin kx}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 39.8 |
|---|
| Cost | 26184 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -1 \cdot 10^{-85}:\\
\;\;\;\;-\frac{\sin ky \cdot \sin th}{kx}\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-141}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th \cdot ky}{\sin kx}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 39.7 |
|---|
| Cost | 26184 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -1 \cdot 10^{-85}:\\
\;\;\;\;\frac{\sin ky}{-kx} \cdot \sin th\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-141}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th \cdot ky}{\sin kx}\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 42.4 |
|---|
| Cost | 13252 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 2 \cdot 10^{-179}:\\
\;\;\;\;\frac{ky}{kx} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 44.4 |
|---|
| Cost | 6728 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -8 \cdot 10^{-15}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 5.3 \cdot 10^{-192}:\\
\;\;\;\;\frac{th \cdot ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 51.1 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -1 \cdot 10^{+44}:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 8.2 \cdot 10^{-192}:\\
\;\;\;\;\frac{th \cdot ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 55.5 |
|---|
| Cost | 64 |
|---|
\[th
\]