\[\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\]
↓
\[\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{\sin ky}}
\]
(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
(/ (sin th) (/ (hypot (sin kx) (sin ky)) (sin ky))))
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) {
return sin(th) / (hypot(sin(kx), sin(ky)) / sin(ky));
}
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) {
return Math.sin(th) / (Math.hypot(Math.sin(kx), Math.sin(ky)) / Math.sin(ky));
}
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):
return math.sin(th) / (math.hypot(math.sin(kx), math.sin(ky)) / math.sin(ky))
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)
return Float64(sin(th) / Float64(hypot(sin(kx), sin(ky)) / sin(ky)))
end
function tmp = code(kx, ky, th)
tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th);
end
↓
function tmp = code(kx, ky, th)
tmp = sin(th) / (hypot(sin(kx), sin(ky)) / sin(ky));
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_] := N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
↓
\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{\sin ky}}
Alternatives
| Alternative 1 |
|---|
| Error | 33.8 |
|---|
| Cost | 59096 |
|---|
\[\begin{array}{l}
t_1 := \left(\sin th \cdot ky\right) \cdot \sqrt{\frac{2}{1 - \cos \left(kx \cdot 2\right)}}\\
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-33}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq -2 \cdot 10^{-216}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-262}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{-kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-184}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-113}:\\
\;\;\;\;\sqrt[3]{{\sin th}^{3}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-27}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 33.7 |
|---|
| Cost | 59096 |
|---|
\[\begin{array}{l}
t_1 := \left(\sin th \cdot ky\right) \cdot \sqrt{\frac{2}{1 - \cos \left(kx \cdot 2\right)}}\\
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-33}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq -2 \cdot 10^{-216}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-231}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{-kx}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-205}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-170}:\\
\;\;\;\;\sqrt{\frac{1}{kx \cdot kx} + 0.3333333333333333} \cdot \left(\sin th \cdot \sin ky\right)\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-27}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 35.2 |
|---|
| Cost | 58712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-189}:\\
\;\;\;\;\frac{ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-262}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{-kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-184}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{elif}\;\sin ky \leq 10^{-106}:\\
\;\;\;\;\sqrt[3]{{\sin th}^{3}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-81}:\\
\;\;\;\;\frac{\sin th \cdot ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th \cdot \sin ky}{\sin ky}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 35.4 |
|---|
| Cost | 52312 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-189}:\\
\;\;\;\;\frac{ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-262}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{-kx}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-142}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-106}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sin th \cdot ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 35.6 |
|---|
| Cost | 52312 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-189}:\\
\;\;\;\;\frac{ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-262}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{-kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-184}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{elif}\;\sin ky \leq 10^{-106}:\\
\;\;\;\;\sqrt[3]{{\sin th}^{3}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sin th \cdot ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 34.3 |
|---|
| Cost | 39248 |
|---|
\[\begin{array}{l}
t_1 := \frac{ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 10^{-106}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-44}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 34.3 |
|---|
| Cost | 39248 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-142}:\\
\;\;\;\;\frac{ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{elif}\;\sin ky \leq 10^{-106}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sin th \cdot ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 34.3 |
|---|
| Cost | 39248 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-142}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{elif}\;\sin ky \leq 10^{-106}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sin th \cdot ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 34.3 |
|---|
| Cost | 39248 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-142}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-106}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sin th \cdot ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 0.3 |
|---|
| Cost | 32384 |
|---|
\[\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin th}}
\]
| Alternative 11 |
|---|
| Error | 24.8 |
|---|
| Cost | 26776 |
|---|
\[\begin{array}{l}
t_1 := \left(\sin th \cdot ky\right) \cdot \sqrt{\frac{2}{1 - \cos \left(kx \cdot 2\right)}}\\
\mathbf{if}\;th \leq -2.9142807725010324 \cdot 10^{+183}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;th \leq -1.5233437980199724 \cdot 10^{+108}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;th \leq -5.88964338125302 \cdot 10^{+39}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;th \leq -1.2754234967578714 \cdot 10^{+25}:\\
\;\;\;\;\frac{\sin th \cdot \sin ky}{\sin kx}\\
\mathbf{elif}\;th \leq -515992601159.6631:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;th \leq 8.927690943893876 \cdot 10^{+21}:\\
\;\;\;\;th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 16.4 |
|---|
| Cost | 26248 |
|---|
\[\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
t_2 := \frac{\sin th \cdot ky}{t_1}\\
\mathbf{if}\;th \leq -3.5527479179531057 \cdot 10^{-10}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;th \leq 0.0011350981318073547:\\
\;\;\;\;th \cdot \frac{\sin ky}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 37.2 |
|---|
| Cost | 26184 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-169}:\\
\;\;\;\;\frac{\sin th}{\frac{kx}{\sin ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 37.2 |
|---|
| Cost | 19784 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-169}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 43.0 |
|---|
| Cost | 13252 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-169}:\\
\;\;\;\;\frac{\sin th \cdot ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 42.7 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -269491158731.4664:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 4.458747481384666 \cdot 10^{-169}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 17 |
|---|
| Error | 46.0 |
|---|
| Cost | 6920 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -1.5936717305920108 \cdot 10^{-6}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 4.458747481384666 \cdot 10^{-169}:\\
\;\;\;\;-0.16666666666666666 \cdot {th}^{3}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 18 |
|---|
| Error | 48.8 |
|---|
| Cost | 6464 |
|---|
\[\sin th
\]
| Alternative 19 |
|---|
| Error | 55.3 |
|---|
| Cost | 64 |
|---|
\[th
\]