\[\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\]
↓
\[\sin ky \cdot \frac{\sin th}{\sqrt{{\sin ky}^{2} + {\sin kx}^{2}}}
\]
(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) (/ (sin th) (sqrt (+ (pow (sin ky) 2.0) (pow (sin kx) 2.0))))))
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) * (sin(th) / sqrt((pow(sin(ky), 2.0) + pow(sin(kx), 2.0))));
}
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) * (sin(th) / sqrt(((sin(ky) ** 2.0d0) + (sin(kx) ** 2.0d0))))
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.sin(th) / Math.sqrt((Math.pow(Math.sin(ky), 2.0) + Math.pow(Math.sin(kx), 2.0))));
}
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.sin(th) / math.sqrt((math.pow(math.sin(ky), 2.0) + math.pow(math.sin(kx), 2.0))))
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(ky) * Float64(sin(th) / sqrt(Float64((sin(ky) ^ 2.0) + (sin(kx) ^ 2.0)))))
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) * (sin(th) / sqrt(((sin(ky) ^ 2.0) + (sin(kx) ^ 2.0))));
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[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
↓
\sin ky \cdot \frac{\sin th}{\sqrt{{\sin ky}^{2} + {\sin kx}^{2}}}
Alternatives
| Alternative 1 |
|---|
| Error | 10.2 |
|---|
| Cost | 123208 |
|---|
\[\begin{array}{l}
t_1 := \frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}}\\
\mathbf{if}\;t_1 \leq -1:\\
\;\;\;\;\frac{\sin th}{\frac{-ky}{\sin ky}}\\
\mathbf{elif}\;t_1 \leq 2:\\
\;\;\;\;t_1 \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \left(\frac{1}{\sin kx} \cdot ky\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 33.9 |
|---|
| Cost | 71960 |
|---|
\[\begin{array}{l}
t_1 := \frac{\sin ky}{0.5 \cdot \frac{{ky}^{2}}{\sin kx} + \sin kx} \cdot \sin th\\
\mathbf{if}\;\sin ky \leq -4 \cdot 10^{-10}:\\
\;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-305}:\\
\;\;\;\;\frac{\sin th}{\frac{\left(-ky\right) + -0.5 \cdot \frac{{\sin kx}^{2}}{ky}}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 10^{-166}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-62}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{{kx}^{2} + {ky}^{2}}}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 34.0 |
|---|
| Cost | 65236 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -4 \cdot 10^{-10}:\\
\;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-85}:\\
\;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-305}:\\
\;\;\;\;\frac{\sin th}{\frac{\left(-ky\right) + -0.5 \cdot \frac{{\sin kx}^{2}}{ky}}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 10^{-166}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-62}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{{kx}^{2} + {ky}^{2}}}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 10^{-16}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 18.1 |
|---|
| Cost | 58572 |
|---|
\[\begin{array}{l}
t_1 := {\sin kx}^{2}\\
t_2 := {\sin ky}^{2}\\
\mathbf{if}\;\sin ky \leq -0.92:\\
\;\;\;\;th \cdot \left(\sin ky \cdot \sqrt{\frac{1}{t_2 + t_1}}\right)\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-7}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{{kx}^{2} + t_2}}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 0.04:\\
\;\;\;\;\frac{\sin ky}{\sqrt{t_1 + {ky}^{2}}} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 18.1 |
|---|
| Cost | 58572 |
|---|
\[\begin{array}{l}
t_1 := {\sin kx}^{2}\\
t_2 := {\sin ky}^{2}\\
\mathbf{if}\;\sin ky \leq -0.92:\\
\;\;\;\;\sin ky \cdot \left(th \cdot \sqrt{\frac{1}{t_2 + t_1}}\right)\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-7}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{{kx}^{2} + t_2}}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 0.04:\\
\;\;\;\;\frac{\sin ky}{\sqrt{t_1 + {ky}^{2}}} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 21.1 |
|---|
| Cost | 52040 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.08:\\
\;\;\;\;\sqrt{\frac{1}{{\sin kx}^{2}}} \cdot \left(\sin ky \cdot th\right)\\
\mathbf{elif}\;\sin kx \leq 10^{-7}:\\
\;\;\;\;\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 7 |
|---|
| Error | 17.9 |
|---|
| Cost | 52040 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-7}:\\
\;\;\;\;\frac{\sin ky}{\sqrt{{kx}^{2} + {\sin ky}^{2}}} \cdot \sin th\\
\mathbf{elif}\;\sin ky \leq 0.04:\\
\;\;\;\;\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {ky}^{2}}} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 17.9 |
|---|
| Cost | 52040 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-7}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{{kx}^{2} + {\sin ky}^{2}}}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 0.04:\\
\;\;\;\;\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {ky}^{2}}} \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 35.1 |
|---|
| Cost | 46028 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -4 \cdot 10^{-10}:\\
\;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-85}:\\
\;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-305}:\\
\;\;\;\;\frac{\sin th}{\frac{\left(-ky\right) + -0.5 \cdot \frac{{\sin kx}^{2}}{ky}}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 10^{-16}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 38.3 |
|---|
| Cost | 39376 |
|---|
\[\begin{array}{l}
t_1 := \sin ky \cdot \left(-\frac{\sin th}{ky}\right)\\
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-85}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-176}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 10^{-16}:\\
\;\;\;\;\sin th \cdot \left(\frac{1}{\sin kx} \cdot ky\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 34.1 |
|---|
| Cost | 39376 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -4 \cdot 10^{-10}:\\
\;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-85}:\\
\;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-176}:\\
\;\;\;\;\sin ky \cdot \left(-\frac{\sin th}{ky}\right)\\
\mathbf{elif}\;\sin ky \leq 10^{-16}:\\
\;\;\;\;\sin th \cdot \left(\frac{1}{\sin kx} \cdot ky\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 38.3 |
|---|
| Cost | 39248 |
|---|
\[\begin{array}{l}
t_1 := \sin ky \cdot \left(-\frac{\sin th}{ky}\right)\\
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-85}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-176}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 10^{-16}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 38.1 |
|---|
| Cost | 32844 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-85}:\\
\;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-176}:\\
\;\;\;\;\sin ky \cdot \left(-\frac{\sin th}{ky}\right)\\
\mathbf{elif}\;\sin ky \leq 10^{-16}:\\
\;\;\;\;\sin th \cdot \left(\frac{1}{\sin kx} \cdot ky\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 38.1 |
|---|
| Cost | 32844 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-85}:\\
\;\;\;\;\frac{\sin ky}{\sin kx} \cdot \frac{1}{\frac{1}{\sin th}}\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-176}:\\
\;\;\;\;\sin ky \cdot \left(-\frac{\sin th}{ky}\right)\\
\mathbf{elif}\;\sin ky \leq 10^{-16}:\\
\;\;\;\;\sin th \cdot \left(\frac{1}{\sin kx} \cdot ky\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 35.5 |
|---|
| Cost | 32712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -1 \cdot 10^{-24}:\\
\;\;\;\;\sqrt{\frac{1}{{\sin kx}^{2}}} \cdot \left(\sin ky \cdot th\right)\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-38}:\\
\;\;\;\;\frac{1}{\frac{\sin ky}{\sin ky \cdot \sin th}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\sin kx} \cdot \sin ky\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 38.6 |
|---|
| Cost | 19652 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-16}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 17 |
|---|
| Error | 42.6 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -4.2 \cdot 10^{-10}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 5.2 \cdot 10^{-200}:\\
\;\;\;\;th \cdot \left(\frac{1}{\sin kx} \cdot ky\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 18 |
|---|
| Error | 41.8 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -3 \cdot 10^{-10}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 4.7 \cdot 10^{-168}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 19 |
|---|
| Error | 42.6 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -3.6 \cdot 10^{-10}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 3.4 \cdot 10^{-199}:\\
\;\;\;\;th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 20 |
|---|
| Error | 43.6 |
|---|
| Cost | 6728 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -4.2 \cdot 10^{-10}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 2.8 \cdot 10^{-168}:\\
\;\;\;\;\frac{\frac{th}{0.5}}{kx \cdot \frac{2}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
| Alternative 21 |
|---|
| Error | 49.8 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -4.2 \cdot 10^{-12}:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 4 \cdot 10^{-100}:\\
\;\;\;\;\frac{2}{\frac{kx}{ky} \cdot \frac{2}{th}}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\]
| Alternative 22 |
|---|
| Error | 49.7 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -1.3 \cdot 10^{-11}:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 7 \cdot 10^{-100}:\\
\;\;\;\;\frac{\frac{th}{0.5}}{kx \cdot \frac{2}{ky}}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\]
| Alternative 23 |
|---|
| Error | 49.8 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -2.75 \cdot 10^{-12}:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 2.1 \cdot 10^{-100}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\]
| Alternative 24 |
|---|
| Error | 49.7 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -5.5 \cdot 10^{-12}:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 4.2 \cdot 10^{-100}:\\
\;\;\;\;th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\]
| Alternative 25 |
|---|
| Error | 49.7 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;ky \leq -4.2 \cdot 10^{-11}:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 1.7 \cdot 10^{-100}:\\
\;\;\;\;\frac{th}{\frac{kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\]
| Alternative 26 |
|---|
| Error | 54.8 |
|---|
| Cost | 64 |
|---|
\[th
\]