\[\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.0 |
|---|
| Cost | 45648 |
|---|
\[\begin{array}{l}
t_1 := \frac{\sin th}{\frac{\sin kx}{\sin ky}}\\
\mathbf{if}\;\sin ky \leq -0.0005:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-156}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-64}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\sin ky}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 28.7 |
|---|
| Cost | 39624 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.0005:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-11}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{\left(0.5 + \cos \left(kx + kx\right) \cdot -0.5\right) + ky \cdot ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 33.8 |
|---|
| Cost | 39436 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -2 \cdot 10^{-8}:\\
\;\;\;\;\sin th \cdot \left(ky \cdot \sqrt{\frac{1}{0.5 + \cos \left(kx \cdot 2\right) \cdot -0.5}}\right)\\
\mathbf{elif}\;\sin kx \leq -2 \cdot 10^{-263}:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sin th}{0.5 \cdot {\left(\frac{kx}{\sin ky}\right)}^{2} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{\sin ky}}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 32.4 |
|---|
| Cost | 39436 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -2 \cdot 10^{-8}:\\
\;\;\;\;\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^{-263}:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sin th}{0.5 \cdot {\left(\frac{kx}{\sin ky}\right)}^{2} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{\sin ky}}\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 36.0 |
|---|
| Cost | 39248 |
|---|
\[\begin{array}{l}
t_1 := \frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{if}\;\sin ky \leq -0.0005:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-156}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-64}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\sin ky}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 0.2 |
|---|
| Cost | 32384 |
|---|
\[\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}
\]
| Alternative 7 |
|---|
| Error | 39.6 |
|---|
| Cost | 13648 |
|---|
\[\begin{array}{l}
t_1 := \sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{if}\;ky \leq -448056818614.6629:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 3.505809371626864 \cdot 10^{-156}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;ky \leq 1.6522915464139594 \cdot 10^{-64}:\\
\;\;\;\;\frac{\sin th}{1 + \left(kx \cdot kx\right) \cdot \left(\frac{0.5}{ky \cdot ky} + 0.16666666666666666\right)}\\
\mathbf{elif}\;ky \leq 3.127663083485781 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 39.6 |
|---|
| Cost | 13648 |
|---|
\[\begin{array}{l}
t_1 := \frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{if}\;ky \leq -448056818614.6629:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 3.505809371626864 \cdot 10^{-156}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;ky \leq 1.6522915464139594 \cdot 10^{-64}:\\
\;\;\;\;\frac{\sin th}{1 + \left(kx \cdot kx\right) \cdot \left(\frac{0.5}{ky \cdot ky} + 0.16666666666666666\right)}\\
\mathbf{elif}\;ky \leq 3.127663083485781 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 39.8 |
|---|
| Cost | 13648 |
|---|
\[\begin{array}{l}
t_1 := \frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{if}\;ky \leq -448056818614.6629:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 3.505809371626864 \cdot 10^{-156}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;ky \leq 1.6522915464139594 \cdot 10^{-64}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\sin ky}\\
\mathbf{elif}\;ky \leq 3.127663083485781 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 46.1 |
|---|
| Cost | 7492 |
|---|
\[\begin{array}{l}
\mathbf{if}\;th \leq 1.8618355634580832 \cdot 10^{-126}:\\
\;\;\;\;\frac{\sin th}{1 + \left(kx \cdot kx\right) \cdot \left(\frac{0.5}{ky \cdot ky} + 0.16666666666666666\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 45.7 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -0.0007719611587784836:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 9.964511369354392 \cdot 10^{-129}:\\
\;\;\;\;\sin ky \cdot \left(0.16666666666666666 \cdot \left(ky \cdot th\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 46.5 |
|---|
| Cost | 6920 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -6.473984689813482 \cdot 10^{-5}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 4.6024765211504276 \cdot 10^{-141}:\\
\;\;\;\;-0.16666666666666666 \cdot {th}^{3}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 49.0 |
|---|
| Cost | 6464 |
|---|
\[\sin th
\]
| Alternative 14 |
|---|
| Error | 55.0 |
|---|
| Cost | 576 |
|---|
\[\frac{1}{\frac{1}{th} + th \cdot 0.16666666666666666}
\]
| Alternative 15 |
|---|
| Error | 55.4 |
|---|
| Cost | 64 |
|---|
\[th
\]