\[\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\]
↓
\[\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \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) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (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) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
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
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
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) {
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.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.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * 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) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * 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) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * 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[(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]
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
↓
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
Alternatives
| Alternative 1 |
|---|
| Error | 18.9 |
|---|
| Cost | 52040 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.002:\\
\;\;\;\;\frac{\sin ky}{\sqrt{{kx}^{2} + {\sin ky}^{2}}} \cdot \sin th\\
\mathbf{elif}\;\sin ky \leq 10^{-6}:\\
\;\;\;\;\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {ky}^{2}}} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 24.2 |
|---|
| Cost | 45508 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq 0.002:\\
\;\;\;\;\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 3 |
|---|
| Error | 38.0 |
|---|
| Cost | 26052 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-59}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 38.0 |
|---|
| Cost | 26052 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-59}:\\
\;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 38.9 |
|---|
| Cost | 19652 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-59}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 38.9 |
|---|
| Cost | 13384 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -0.0032:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 8.2 \cdot 10^{-59}:\\
\;\;\;\;\frac{ky}{\sin kx} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 42.5 |
|---|
| Cost | 7116 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -0.0032:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq -4.2 \cdot 10^{-216}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\mathbf{elif}\;ky \leq 3.2 \cdot 10^{-130}:\\
\;\;\;\;\frac{ky}{kx} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 42.5 |
|---|
| Cost | 7116 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -0.0032:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq -5.4 \cdot 10^{-216}:\\
\;\;\;\;\frac{th \cdot ky}{\sin kx}\\
\mathbf{elif}\;ky \leq 3.4 \cdot 10^{-131}:\\
\;\;\;\;\frac{ky}{kx} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 44.2 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -0.0032:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 9.2 \cdot 10^{-60}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 48.8 |
|---|
| Cost | 6464 |
|---|
\[\sin th
\]