\[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 := \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^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\
t_3 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_1\right)\right)\\
\mathbf{if}\;y.re \leq -1.65 \cdot 10^{+48}:\\
\;\;\;\;t_2 \cdot t_1\\
\mathbf{elif}\;y.re \leq 1.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{t_0}} \cdot t_3\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sqrt{{t_3}^{2}}\\
\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 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))
(t_3 (sin (fma (log (hypot x.re x.im)) y.im t_1))))
(if (<= y.re -1.65e+48)
(* t_2 t_1)
(if (<= y.re 1.5e-29)
(* (/ (pow (hypot x.re x.im) y.re) (exp t_0)) t_3)
(* t_2 (sqrt (pow t_3 2.0)))))))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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double t_3 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1));
double tmp;
if (y_46_re <= -1.65e+48) {
tmp = t_2 * t_1;
} else if (y_46_re <= 1.5e-29) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / exp(t_0)) * t_3;
} else {
tmp = t_2 * sqrt(pow(t_3, 2.0));
}
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 = Float64(atan(x_46_im, x_46_re) * y_46_im)
t_1 = Float64(y_46_re * atan(x_46_im, x_46_re))
t_2 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0))
t_3 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1))
tmp = 0.0
if (y_46_re <= -1.65e+48)
tmp = Float64(t_2 * t_1);
elseif (y_46_re <= 1.5e-29)
tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / exp(t_0)) * t_3);
else
tmp = Float64(t_2 * sqrt((t_3 ^ 2.0)));
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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.65e+48], N[(t$95$2 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.5e-29], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision], N[(t$95$2 * N[Sqrt[N[Power[t$95$3, 2.0], $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 := \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^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\
t_3 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_1\right)\right)\\
\mathbf{if}\;y.re \leq -1.65 \cdot 10^{+48}:\\
\;\;\;\;t_2 \cdot t_1\\
\mathbf{elif}\;y.re \leq 1.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{t_0}} \cdot t_3\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sqrt{{t_3}^{2}}\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 5.7 |
|---|
| Cost | 58888 |
|---|
\[\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^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot t_1\\
\mathbf{if}\;y.re \leq -1.65 \cdot 10^{+48}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq 1.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{t_0}} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 7.9 |
|---|
| Cost | 46280 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y.im \leq -9.4 \cdot 10^{+39}:\\
\;\;\;\;y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.im \leq 0.10493681366943237:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \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)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 12.5 |
|---|
| Cost | 46028 |
|---|
\[\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^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot t_1\\
t_3 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.65 \cdot 10^{+48}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq -1 \cdot 10^{-108}:\\
\;\;\;\;\sin t_1 \cdot \frac{t_3}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}\\
\mathbf{elif}\;y.re \leq 10^{-75}:\\
\;\;\;\;\frac{t_3}{e^{t_0}} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 2.4 \cdot 10^{+41}:\\
\;\;\;\;t_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 8.0 |
|---|
| Cost | 45768 |
|---|
\[\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -9.4 \cdot 10^{+39}:\\
\;\;\;\;y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.im \leq 1.95 \cdot 10^{+14}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\left(1 + \sin t_0\right) + -1\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 20.2 |
|---|
| Cost | 33480 |
|---|
\[\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t_0\\
\mathbf{if}\;y.re \leq -280000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq 2.4 \cdot 10^{+41}:\\
\;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 23.7 |
|---|
| Cost | 33292 |
|---|
\[\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 := \sin t_1\\
t_3 := t_2 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{if}\;x.im \leq -2.9 \cdot 10^{-42}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x.im \leq -2.75 \cdot 10^{-139}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(t_1 - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\
\mathbf{elif}\;x.im \leq 0:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 23.9 |
|---|
| Cost | 33028 |
|---|
\[\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq 0:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 27.2 |
|---|
| Cost | 20104 |
|---|
\[\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := t_0 \cdot {x.im}^{y.re}\\
\mathbf{if}\;y.re \leq -1.6 \cdot 10^{+48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq 2.4 \cdot 10^{+41}:\\
\;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 37.2 |
|---|
| Cost | 19780 |
|---|
\[\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1.15 \cdot 10^{-16}:\\
\;\;\;\;\sin t_0 \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 6 \cdot 10^{+28}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {x.im}^{y.re}\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 37.2 |
|---|
| Cost | 13512 |
|---|
\[\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := t_0 \cdot {x.im}^{y.re}\\
\mathbf{if}\;y.re \leq -1.15 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq 6 \cdot 10^{+28}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 51.4 |
|---|
| Cost | 6656 |
|---|
\[y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\]