Math FPCore C Java Python Julia MATLAB Wolfram TeX \[\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\]
↓
\[\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\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 ky) (sin kx)) (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(ky), sin(kx)) / 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(ky), Math.sin(kx)) / 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(ky), math.sin(kx)) / 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(ky), sin(kx)) / 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(ky), sin(kx)) / 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[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $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 ky, \sin kx\right)}{\sin ky}}
Alternatives Alternative 1 Accuracy 99.7% Cost 32384
\[\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}
\]
Alternative 2 Accuracy 46.0% Cost 52376
\[\begin{array}{l}
t_1 := \frac{\sin th \cdot \left(-ky\right)}{\sin kx}\\
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 10^{-301}:\\
\;\;\;\;\frac{ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-187}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 10^{-128}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{ky}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
Alternative 3 Accuracy 45.8% Cost 52376
\[\begin{array}{l}
t_1 := \frac{\sin th \cdot \left(-ky\right)}{\sin kx}\\
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq -4 \cdot 10^{-139}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-187}:\\
\;\;\;\;\sin th \cdot \frac{-ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-128}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{ky}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
Alternative 4 Accuracy 45.9% Cost 52376
\[\begin{array}{l}
t_1 := \frac{-\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;\frac{\sin th \cdot \left(-ky\right)}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq -4 \cdot 10^{-139}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-187}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 10^{-128}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{ky}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
Alternative 5 Accuracy 46.4% Cost 52376
\[\begin{array}{l}
t_1 := \frac{\sin kx}{ky}\\
t_2 := \frac{-\sin th}{t_1}\\
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-77}:\\
\;\;\;\;\frac{\sin th \cdot \left(-ky\right)}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-301}:\\
\;\;\;\;\frac{\sin th}{t_1 + 0.5 \cdot \frac{ky}{kx}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-187}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\sin ky \leq 10^{-128}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{ky}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-60}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
Alternative 6 Accuracy 48.8% Cost 45648
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -2 \cdot 10^{-74}:\\
\;\;\;\;\frac{-\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-283}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin kx \leq 10^{-88}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin kx \leq 4 \cdot 10^{-87}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\]
Alternative 7 Accuracy 58.4% Cost 45648
\[\begin{array}{l}
t_1 := \frac{ky}{\frac{\left|\sin kx\right|}{\sin th}}\\
\mathbf{if}\;\sin ky \leq -0.065:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-168}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 10^{-129}:\\
\;\;\;\;\frac{\sin th}{1 + \frac{0.5 \cdot \left(kx \cdot kx\right)}{{\sin ky}^{2}}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
Alternative 8 Accuracy 58.6% Cost 45648
\[\begin{array}{l}
t_1 := \left|\sin kx\right|\\
\mathbf{if}\;\sin ky \leq -0.065:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-168}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{t_1}\\
\mathbf{elif}\;\sin ky \leq 10^{-129}:\\
\;\;\;\;\frac{\sin th}{1 + \frac{0.5 \cdot \left(kx \cdot kx\right)}{{\sin ky}^{2}}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-60}:\\
\;\;\;\;\frac{ky}{\frac{t_1}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
Alternative 9 Accuracy 76.9% Cost 45580
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.004:\\
\;\;\;\;\sin th \cdot \left(\sin ky \cdot \frac{-1}{\sin kx}\right)\\
\mathbf{elif}\;\sin kx \leq 0.07:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin kx \leq 0.91:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\end{array}
\]
Alternative 10 Accuracy 77.0% Cost 45580
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.004:\\
\;\;\;\;\sin th \cdot \left(\sin ky \cdot \frac{-1}{\sin kx}\right)\\
\mathbf{elif}\;\sin kx \leq 0.07:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin kx \leq 0.91:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\end{array}
\]
Alternative 11 Accuracy 46.3% Cost 39248
\[\begin{array}{l}
t_1 := \sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{if}\;\sin ky \leq -5 \cdot 10^{-64}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-168}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\sin ky \leq 10^{-129}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{ky}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
Alternative 12 Accuracy 46.3% Cost 39248
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -5 \cdot 10^{-64}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-168}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-129}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{ky}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-71}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
Alternative 13 Accuracy 78.6% Cost 39048
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.004:\\
\;\;\;\;\sin th \cdot \left(\sin ky \cdot \frac{-1}{\sin kx}\right)\\
\mathbf{elif}\;\sin kx \leq 0.05:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin kx\right|}\\
\end{array}
\]
Alternative 14 Accuracy 32.0% Cost 32976
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -2 \cdot 10^{-74}:\\
\;\;\;\;\frac{ky}{\frac{-\sin kx}{th}}\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-283}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin kx \leq 10^{-88}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin kx \leq 0.55:\\
\;\;\;\;\frac{\sin th}{\frac{kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky}{\sin kx \cdot \frac{1}{th}}\\
\end{array}
\]
Alternative 15 Accuracy 40.4% Cost 32848
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -2 \cdot 10^{-84}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-168}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-129}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-71}:\\
\;\;\;\;\frac{th \cdot ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
Alternative 16 Accuracy 40.4% Cost 32848
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -2 \cdot 10^{-84}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-168}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-129}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{ky}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-71}:\\
\;\;\;\;\frac{th \cdot ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
Alternative 17 Accuracy 59.7% Cost 32584
\[\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.065:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-60}:\\
\;\;\;\;\frac{ky}{\frac{\left|\sin kx\right|}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
Alternative 18 Accuracy 99.6% Cost 32384
\[\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\]
Alternative 19 Accuracy 99.7% Cost 32384
\[\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\]
Alternative 20 Accuracy 32.8% Cost 19912
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -2 \cdot 10^{-74}:\\
\;\;\;\;\frac{ky}{\frac{-\sin kx}{th}}\\
\mathbf{elif}\;\sin kx \leq 4 \cdot 10^{-53}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{1}{\frac{\sin kx}{th}}\\
\end{array}
\]
Alternative 21 Accuracy 32.8% Cost 19912
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -2 \cdot 10^{-74}:\\
\;\;\;\;\frac{ky}{\frac{-\sin kx}{th}}\\
\mathbf{elif}\;\sin kx \leq 4 \cdot 10^{-53}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky}{\sin kx \cdot \frac{1}{th}}\\
\end{array}
\]
Alternative 22 Accuracy 29.6% Cost 19784
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -1 \cdot 10^{-66}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{elif}\;\sin kx \leq 4 \cdot 10^{-53}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;th \cdot \frac{ky}{\sin kx}\\
\end{array}
\]
Alternative 23 Accuracy 29.9% Cost 19784
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -5 \cdot 10^{-49}:\\
\;\;\;\;\frac{ky}{\frac{kx}{\sin th}}\\
\mathbf{elif}\;\sin kx \leq 4 \cdot 10^{-53}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;th \cdot \frac{ky}{\sin kx}\\
\end{array}
\]
Alternative 24 Accuracy 29.9% Cost 19784
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -5 \cdot 10^{-49}:\\
\;\;\;\;\frac{ky}{\frac{kx}{\sin th}}\\
\mathbf{elif}\;\sin kx \leq 4 \cdot 10^{-53}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky}{\frac{\sin kx}{th}}\\
\end{array}
\]
Alternative 25 Accuracy 32.8% Cost 19784
\[\begin{array}{l}
\mathbf{if}\;\sin kx \leq -2 \cdot 10^{-74}:\\
\;\;\;\;\frac{ky}{\frac{-\sin kx}{th}}\\
\mathbf{elif}\;\sin kx \leq 4 \cdot 10^{-53}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky}{\frac{\sin kx}{th}}\\
\end{array}
\]
Alternative 26 Accuracy 29.2% Cost 6993
\[\begin{array}{l}
\mathbf{if}\;ky \leq -3.1:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 1.8 \cdot 10^{-249} \lor \neg \left(ky \leq 5.8 \cdot 10^{-127}\right) \land ky \leq 3.8 \cdot 10^{-70}:\\
\;\;\;\;th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\]
Alternative 27 Accuracy 21.4% Cost 584
\[\begin{array}{l}
\mathbf{if}\;ky \leq -2.45 \cdot 10^{+20}:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 10^{-68}:\\
\;\;\;\;th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\]
Alternative 28 Accuracy 13.4% Cost 64
\[th
\]