\[\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\]
↓
\[\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th
\]
(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 ky) (hypot (sin ky) (sin kx))) (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) {
return (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th);
}
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(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * Math.sin(th);
}
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(ky) / math.hypot(math.sin(ky), math.sin(kx))) * math.sin(th)
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(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * sin(th))
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(ky) / hypot(sin(ky), sin(kx))) * sin(th);
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[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
↓
\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th
Alternatives
| Alternative 1 |
|---|
| Error | 36.9 |
|---|
| Cost | 38984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-265}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-94}:\\
\;\;\;\;\left|\sin th \cdot \frac{\sin ky}{\sin kx}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 33.6 |
|---|
| Cost | 38984 |
|---|
\[\begin{array}{l}
t_1 := \frac{\sin ky}{\sin kx}\\
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-290}:\\
\;\;\;\;\frac{\sin th}{\frac{1}{t_1}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-66}:\\
\;\;\;\;\sin th \cdot \left|t_1\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 33.3 |
|---|
| Cost | 38984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -5 \cdot 10^{-294}:\\
\;\;\;\;\frac{\sin ky}{\left|\frac{\sin kx}{\sin th}\right|}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-66}:\\
\;\;\;\;\sin th \cdot \left|\frac{\sin ky}{\sin kx}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 37.4 |
|---|
| Cost | 32584 |
|---|
\[\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-265}:\\
\;\;\;\;\frac{t_1}{ky \cdot 0.16666666666666666 + \frac{1}{ky}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-94}:\\
\;\;\;\;\left|ky \cdot t_1\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 37.4 |
|---|
| Cost | 32584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-265}:\\
\;\;\;\;\frac{\frac{\sin th}{\sin kx}}{ky \cdot 0.16666666666666666 + \frac{1}{ky}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-94}:\\
\;\;\;\;\left|\frac{\sin th}{\frac{\sin kx}{ky}}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 36.9 |
|---|
| Cost | 32584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-265}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-94}:\\
\;\;\;\;\left|\frac{\sin th}{\frac{\sin kx}{ky}}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 36.9 |
|---|
| Cost | 32584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-265}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-94}:\\
\;\;\;\;\left|\frac{\sin th}{\frac{\sin kx}{ky}}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 22.0 |
|---|
| Cost | 32516 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 0.03:\\
\;\;\;\;\sin th \cdot \frac{ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 16.5 |
|---|
| Cost | 26764 |
|---|
\[\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
t_2 := \frac{\sin ky}{t_1 \cdot \left(\frac{1}{th} + th \cdot 0.16666666666666666\right)}\\
\mathbf{if}\;ky \leq -0.0005:\\
\;\;\;\;t_2\\
\mathbf{elif}\;ky \leq 0.028:\\
\;\;\;\;\frac{\sin th}{\frac{t_1}{ky}}\\
\mathbf{elif}\;ky \leq 1.1 \cdot 10^{+93}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 16.6 |
|---|
| Cost | 26380 |
|---|
\[\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
t_2 := \sin ky \cdot \frac{th}{t_1}\\
\mathbf{if}\;ky \leq -0.012:\\
\;\;\;\;t_2\\
\mathbf{elif}\;ky \leq 0.045:\\
\;\;\;\;\sin th \cdot \frac{ky}{t_1}\\
\mathbf{elif}\;ky \leq 6.5 \cdot 10^{+90}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 16.7 |
|---|
| Cost | 26380 |
|---|
\[\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
\mathbf{if}\;ky \leq -0.0012:\\
\;\;\;\;\sin ky \cdot \frac{th}{t_1}\\
\mathbf{elif}\;ky \leq 0.028:\\
\;\;\;\;\sin th \cdot \frac{ky}{t_1}\\
\mathbf{elif}\;ky \leq 1.5 \cdot 10^{+93}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{t_1} \cdot th\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 16.7 |
|---|
| Cost | 26380 |
|---|
\[\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
\mathbf{if}\;ky \leq -0.0022:\\
\;\;\;\;\sin ky \cdot \frac{th}{t_1}\\
\mathbf{elif}\;ky \leq 0.07:\\
\;\;\;\;\frac{\sin th}{\frac{t_1}{ky}}\\
\mathbf{elif}\;ky \leq 1.1 \cdot 10^{+93}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{t_1} \cdot th\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 37.4 |
|---|
| Cost | 20036 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 2 \cdot 10^{-120}:\\
\;\;\;\;\frac{\frac{\sin th}{\sin kx}}{ky \cdot 0.16666666666666666 + \frac{1}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 37.7 |
|---|
| Cost | 19780 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 2 \cdot 10^{-120}:\\
\;\;\;\;\frac{\frac{\sin th}{\sin kx}}{\frac{1}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 37.8 |
|---|
| Cost | 19652 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 2 \cdot 10^{-120}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 37.8 |
|---|
| Cost | 19652 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 2 \cdot 10^{-120}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 17 |
|---|
| Error | 42.4 |
|---|
| Cost | 13516 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -7 \cdot 10^{-24}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq -3.95 \cdot 10^{-203}:\\
\;\;\;\;\frac{ky}{\frac{\sin kx}{th}}\\
\mathbf{elif}\;ky \leq 3 \cdot 10^{-119}:\\
\;\;\;\;th \cdot \left|\frac{ky}{\sin kx}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 18 |
|---|
| Error | 42.8 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -7 \cdot 10^{-24}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 7.5 \cdot 10^{-120}:\\
\;\;\;\;th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 19 |
|---|
| Error | 43.8 |
|---|
| Cost | 6728 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -15.6:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 2.3 \cdot 10^{-120}:\\
\;\;\;\;th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 20 |
|---|
| Error | 49.6 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -15:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 1.75 \cdot 10^{-119}:\\
\;\;\;\;th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\]
| Alternative 21 |
|---|
| Error | 55.2 |
|---|
| Cost | 64 |
|---|
\[th
\]