\[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\]
↓
\[\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -9.5 \cdot 10^{-16} \lor \neg \left(y.im \leq 1.65 \cdot 10^{-36}\right):\\
\;\;\;\;e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t_0 \cdot y.im\right)\right)\\
\end{array}
\]
(FPCore (x.re x.im y.re y.im)
:precision binary64
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin
(+
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im)
(* (atan2 x.im x.re) y.re)))))↓
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (or (<= y.im -9.5e-16) (not (<= y.im 1.65e-36)))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (* y.im (log (hypot x.im x.re)))))
(*
(pow (hypot x.re x.im) y.re)
(sin (fma y.re (atan2 x.im x.re) (* t_0 y.im)))))))double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
↓
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((y_46_im <= -9.5e-16) || !(y_46_im <= 1.65e-36)) {
tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (t_0 * y_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
return Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re))))
end
↓
function code(x_46_re, x_46_im, y_46_re, y_46_im)
t_0 = log(hypot(x_46_re, x_46_im))
tmp = 0.0
if ((y_46_im <= -9.5e-16) || !(y_46_im <= 1.65e-36))
tmp = Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))));
else
tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(t_0 * y_46_im))));
end
return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
↓
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -9.5e-16], N[Not[LessEqual[y$46$im, 1.65e-36]], $MachinePrecision]], N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(t$95$0 * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
↓
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -9.5 \cdot 10^{-16} \lor \neg \left(y.im \leq 1.65 \cdot 10^{-36}\right):\\
\;\;\;\;e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t_0 \cdot y.im\right)\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 5.47% |
|---|
| Cost | 58688 |
|---|
\[\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\]
| Alternative 2 |
|---|
| Error | 17.68% |
|---|
| Cost | 46096 |
|---|
\[\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := {\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}\\
t_3 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0} \cdot t_1\\
t_4 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_5 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -41000000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.im \leq -3.3 \cdot 10^{-199}:\\
\;\;\;\;\frac{\sin t_4}{\frac{t_0 + 1}{t_5}}\\
\mathbf{elif}\;y.im \leq 3.7 \cdot 10^{-187}:\\
\;\;\;\;\frac{t_5}{t_2} \cdot \sin t_1\\
\mathbf{elif}\;y.im \leq 4.9 \cdot 10^{+23}:\\
\;\;\;\;\frac{t_4}{\frac{t_2}{t_5}}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 17.24% |
|---|
| Cost | 45964 |
|---|
\[\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0} \cdot t_1\\
t_3 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_4 := \frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{\frac{t_0 + 1}{t_3}}\\
\mathbf{if}\;y.im \leq -41000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq -7.6 \cdot 10^{-204}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y.im \leq 6.8 \cdot 10^{-187}:\\
\;\;\;\;\frac{t_3}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}} \cdot \sin t_1\\
\mathbf{elif}\;y.im \leq 460:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 6.75% |
|---|
| Cost | 45769 |
|---|
\[\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -41000000000 \lor \neg \left(y.im \leq 700\right):\\
\;\;\;\;e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t_0 \cdot y.im\right)\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 17.29% |
|---|
| Cost | 39888 |
|---|
\[\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{\frac{t_0 + 1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
t_3 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0}\\
t_4 := t_3 \cdot t_1\\
\mathbf{if}\;y.im \leq -42000000000:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y.im \leq -1.65 \cdot 10^{-198}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq 4.8 \cdot 10^{-187}:\\
\;\;\;\;t_3 \cdot \sin t_1\\
\mathbf{elif}\;y.im \leq 650:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 17.53% |
|---|
| Cost | 39692 |
|---|
\[\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
t_2 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := t_2 \cdot t_0\\
\mathbf{if}\;y.im \leq -41000000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.im \leq -1.85 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 6.6 \cdot 10^{-188}:\\
\;\;\;\;t_2 \cdot \sin t_0\\
\mathbf{elif}\;y.im \leq 470:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 17.6% |
|---|
| Cost | 33426 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y.im \leq -41000000000 \lor \neg \left(y.im \leq -1.9 \cdot 10^{-199}\right) \land \left(y.im \leq 7.7 \cdot 10^{-187} \lor \neg \left(y.im \leq 420\right)\right):\\
\;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 27.48% |
|---|
| Cost | 33170 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y.im \leq -105000000000 \lor \neg \left(y.im \leq -3.9 \cdot 10^{-303}\right) \land \left(y.im \leq 2.85 \cdot 10^{-244} \lor \neg \left(y.im \leq 5500\right)\right):\\
\;\;\;\;\tan^{-1}_* \frac{x.im}{x.re} \cdot \frac{y.re}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 46.54% |
|---|
| Cost | 26564 |
|---|
\[\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq 6 \cdot 10^{-238}:\\
\;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot e^{y.re \cdot \log x.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 53.5% |
|---|
| Cost | 26112 |
|---|
\[\tan^{-1}_* \frac{x.im}{x.re} \cdot \frac{y.re}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}
\]
| Alternative 11 |
|---|
| Error | 54.38% |
|---|
| Cost | 19840 |
|---|
\[\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}
\]
| Alternative 12 |
|---|
| Error | 77.29% |
|---|
| Cost | 19776 |
|---|
\[\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}
\]
| Alternative 13 |
|---|
| Error | 80.04% |
|---|
| Cost | 6656 |
|---|
\[y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\]