\[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 \cos \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)\\
t_1 := {e}^{\left(t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_2 := \sqrt[3]{e^{e^{\tan^{-1}_* \frac{x.im}{x.re}}}}\\
\mathbf{if}\;y.im \leq -10000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 100000:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(\log \left({t_2}^{2}\right) + \log t_2\right)}^{y.im}} \cdot \cos \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\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)))
(cos
(+
(* (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)))
(t_1 (pow E (- (* t_0 y.re) (* y.im (atan2 x.im x.re)))))
(t_2 (cbrt (exp (exp (atan2 x.im x.re))))))
(if (<= y.im -10000000000.0)
t_1
(if (<= y.im 100000.0)
(*
(/
(pow (hypot x.re x.im) y.re)
(pow (+ (log (pow t_2 2.0)) (log t_2)) y.im))
(cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
t_1))))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))) * cos(((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 t_1 = pow(((double) M_E), ((t_0 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_2 = cbrt(exp(exp(atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -10000000000.0) {
tmp = t_1;
} else if (y_46_im <= 100000.0) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow((log(pow(t_2, 2.0)) + log(t_2)), y_46_im)) * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = t_1;
}
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))) * cos(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))
t_1 = exp(1) ^ Float64(Float64(t_0 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))
t_2 = cbrt(exp(exp(atan(x_46_im, x_46_re))))
tmp = 0.0
if (y_46_im <= -10000000000.0)
tmp = t_1;
elseif (y_46_im <= 100000.0)
tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (Float64(log((t_2 ^ 2.0)) + log(t_2)) ^ y_46_im)) * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))));
else
tmp = t_1;
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[Cos[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]}, Block[{t$95$1 = N[Power[E, N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Exp[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[y$46$im, -10000000000.0], t$95$1, If[LessEqual[y$46$im, 100000.0], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[(N[Log[N[Power[t$95$2, 2.0], $MachinePrecision]], $MachinePrecision] + N[Log[t$95$2], $MachinePrecision]), $MachinePrecision], y$46$im], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
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 \cos \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)\\
t_1 := {e}^{\left(t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_2 := \sqrt[3]{e^{e^{\tan^{-1}_* \frac{x.im}{x.re}}}}\\
\mathbf{if}\;y.im \leq -10000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 100000:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(\log \left({t_2}^{2}\right) + \log t_2\right)}^{y.im}} \cdot \cos \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 3.4 |
|---|
| Cost | 78024 |
|---|
\[\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := {e}^{\left(t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;y.im \leq -10000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 100000:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\log \left(e^{e^{\tan^{-1}_* \frac{x.im}{x.re}}}\right)}^{y.im}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 3.4 |
|---|
| Cost | 71816 |
|---|
\[\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := {e}^{\left(t_1 \cdot y.re - t_0\right)}\\
\mathbf{if}\;y.im \leq -10000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq 100000:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{t_0}} \cdot \log \left(1 + \mathsf{expm1}\left(\cos \left(\mathsf{fma}\left(t_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 3.4 |
|---|
| Cost | 71752 |
|---|
\[\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := {e}^{\left(t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;y.im \leq -10000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 100000:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\sqrt[3]{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(y.im \cdot 3\right)}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 3.4 |
|---|
| Cost | 65224 |
|---|
\[\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := {e}^{\left(t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;y.im \leq -10000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 100000:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 3.4 |
|---|
| Cost | 58888 |
|---|
\[\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := {e}^{\left(t_1 \cdot y.re - t_0\right)}\\
\mathbf{if}\;y.im \leq -10000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq 100000:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{t_0}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 3.6 |
|---|
| Cost | 52232 |
|---|
\[\begin{array}{l}
t_0 := {e}^{\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;y.im \leq -10000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 100000:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 4.2 |
|---|
| Cost | 39168 |
|---|
\[{e}^{\left(3 \cdot \left(0.3333333333333333 \cdot \mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)}
\]
| Alternative 8 |
|---|
| Error | 4.2 |
|---|
| Cost | 32576 |
|---|
\[{e}^{\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}
\]
| Alternative 9 |
|---|
| Error | 6.1 |
|---|
| Cost | 26760 |
|---|
\[\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -8.028392562145345 \cdot 10^{-16}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.02 \cdot 10^{+21}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 8.1 |
|---|
| Cost | 26440 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{-8}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{+100}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)}}{{\left(\frac{-1}{x.im}\right)}^{y.re}}\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 7.2 |
|---|
| Cost | 20104 |
|---|
\[\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{-8}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.02 \cdot 10^{+21}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 7.2 |
|---|
| Cost | 13384 |
|---|
\[\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{-8}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.02 \cdot 10^{+21}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 17.1 |
|---|
| Cost | 12992 |
|---|
\[{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\]
| Alternative 14 |
|---|
| Error | 38.9 |
|---|
| Cost | 6912 |
|---|
\[\frac{1}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}
\]