\[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.re \leq -4.4 \cdot 10^{-16} \lor \neg \left(y.re \leq 4.9 \cdot 10^{-45}\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}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \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.re -4.4e-16) (not (<= y.re 4.9e-45)))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(* y.re (atan2 x.im x.re)))
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(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_re <= -4.4e-16) || !(y_46_re <= 4.9e-45)) {
tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * (y_46_re * atan2(x_46_im, x_46_re));
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * 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_re <= -4.4e-16) || !(y_46_re <= 4.9e-45))
tmp = Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * Float64(y_46_re * atan(x_46_im, x_46_re)));
else
tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * 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$re, -4.4e-16], N[Not[LessEqual[y$46$re, 4.9e-45]], $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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $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.re \leq -4.4 \cdot 10^{-16} \lor \neg \left(y.re \leq 4.9 \cdot 10^{-45}\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}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \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 |
|---|
| Accuracy | 94.6% |
|---|
| Cost | 71488 |
|---|
\[\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 \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 94.6% |
|---|
| 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 3 |
|---|
| Accuracy | 69.6% |
|---|
| Cost | 33560 |
|---|
\[\begin{array}{l}
t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := t_1 \cdot t_0\\
t_3 := t_1 \cdot e^{\log \left({x.re}^{y.re}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_4 := t_0 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -3.3 \cdot 10^{+71}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.re \leq -4.9 \cdot 10^{-79}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq -3.4 \cdot 10^{-98}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y.re \leq -2.1 \cdot 10^{-150}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq 3.4 \cdot 10^{-139}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y.re \leq 26000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 80.0% |
|---|
| Cost | 33560 |
|---|
\[\begin{array}{l}
t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_1 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_2 := t_0 \cdot t_1\\
t_3 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_4 := t_3 \cdot t_0\\
\mathbf{if}\;y.re \leq -2:\\
\;\;\;\;t_1 \cdot {\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq -4.9 \cdot 10^{-79}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y.re \leq -3.6 \cdot 10^{-98}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq -4.3 \cdot 10^{-151}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y.re \leq 2.05 \cdot 10^{-137}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq 220000000000:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot e^{\log \left({x.re}^{y.re}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 83.6% |
|---|
| Cost | 33424 |
|---|
\[\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := 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 t_0\\
t_2 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_3 := t_2 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -4.9 \cdot 10^{-79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq -4.5 \cdot 10^{-101}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.re \leq -1.35 \cdot 10^{-150}:\\
\;\;\;\;t_0 \cdot t_2\\
\mathbf{elif}\;y.re \leq 1.95 \cdot 10^{-137}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 58.8% |
|---|
| Cost | 33168 |
|---|
\[\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_2 := t_1 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_3 := t_0 \cdot t_1\\
\mathbf{if}\;y.re \leq -4.9 \cdot 10^{-79}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.re \leq -1.55 \cdot 10^{-101}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq -3.3 \cdot 10^{-150}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.re \leq 3.3 \cdot 10^{-139}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{+113}:\\
\;\;\;\;t_3\\
\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 7 |
|---|
| Accuracy | 55.1% |
|---|
| Cost | 26564 |
|---|
\[\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq 5 \cdot 10^{-286}:\\
\;\;\;\;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 8 |
|---|
| Accuracy | 50.4% |
|---|
| Cost | 19972 |
|---|
\[\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq 5.8 \cdot 10^{+24}:\\
\;\;\;\;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}\\
\end{array}
\]
| Alternative 9 |
|---|
| Accuracy | 21.2% |
|---|
| Cost | 19712 |
|---|
\[\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.re}
\]