
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $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[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $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[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.im x.re)))
(t_2
(exp
(fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= y.im -1e-9)
(* t_2 (cos (* y.im (+ t_1 (* y.re (/ (atan2 x.im x.re) y.im))))))
(if (<= y.im 3.05e-16)
(* (fabs (cos t_0)) (pow (hypot x.im x.re) y.re))
(* t_2 (cos (* y.im (+ t_1 (/ t_0 y.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_im <= -1e-9) {
tmp = t_2 * cos((y_46_im * (t_1 + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
} else if (y_46_im <= 3.05e-16) {
tmp = fabs(cos(t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_2 * cos((y_46_im * (t_1 + (t_0 / y_46_im))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (y_46_im <= -1e-9) tmp = Float64(t_2 * cos(Float64(y_46_im * Float64(t_1 + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); elseif (y_46_im <= 3.05e-16) tmp = Float64(abs(cos(t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_2 * cos(Float64(y_46_im * Float64(t_1 + Float64(t_0 / y_46_im))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1e-9], N[(t$95$2 * N[Cos[N[(y$46$im * N[(t$95$1 + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.05e-16], N[(N[Abs[N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Cos[N[(y$46$im * N[(t$95$1 + N[(t$95$0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;y.im \leq -1 \cdot 10^{-9}:\\
\;\;\;\;t\_2 \cdot \cos \left(y.im \cdot \left(t\_1 + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\mathbf{elif}\;y.im \leq 3.05 \cdot 10^{-16}:\\
\;\;\;\;\left|\cos t\_0\right| \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \cos \left(y.im \cdot \left(t\_1 + \frac{t\_0}{y.im}\right)\right)\\
\end{array}
\end{array}
if y.im < -1.00000000000000006e-9Initial program 49.5%
cancel-sign-sub-inv49.5%
fma-define49.5%
hypot-define49.5%
distribute-lft-neg-in49.5%
distribute-rgt-neg-out49.5%
fma-define49.5%
hypot-define74.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in y.im around inf 49.5%
unpow249.5%
unpow249.5%
hypot-undefine74.0%
associate-/l*75.5%
Simplified75.5%
if -1.00000000000000006e-9 < y.im < 3.04999999999999976e-16Initial program 40.9%
cancel-sign-sub-inv40.9%
fma-define40.9%
hypot-define40.9%
distribute-lft-neg-in40.9%
distribute-rgt-neg-out40.9%
fma-define40.9%
hypot-define88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in y.im around 0 63.0%
unpow263.0%
unpow263.0%
hypot-undefine88.2%
Simplified88.2%
add-cbrt-cube89.8%
pow389.8%
Applied egg-rr89.8%
add-sqr-sqrt76.4%
sqrt-unprod96.1%
pow296.1%
rem-cbrt-cube96.1%
Applied egg-rr96.1%
unpow296.1%
rem-sqrt-square96.1%
Simplified96.1%
if 3.04999999999999976e-16 < y.im Initial program 37.2%
cancel-sign-sub-inv37.2%
fma-define37.2%
hypot-define37.2%
distribute-lft-neg-in37.2%
distribute-rgt-neg-out37.2%
fma-define37.2%
hypot-define73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in y.im around inf 37.2%
unpow237.2%
unpow237.2%
hypot-undefine75.4%
Simplified75.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (log (hypot x.re x.im))))
(if (<= y.re 1.7e+75)
(*
(exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_1 y.im t_0)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(fabs (cos (fma y.im (log (hypot x.im x.re)) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 1.7e+75) {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_1, y_46_im, t_0));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * fabs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 1.7e+75) tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_1, y_46_im, t_0))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * abs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 1.7e+75], N[(N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 1.7 \cdot 10^{+75}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_1, 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|\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right)\right|\\
\end{array}
\end{array}
if y.re < 1.70000000000000006e75Initial program 44.6%
cancel-sign-sub-inv44.6%
fma-define44.6%
hypot-define44.6%
distribute-lft-neg-in44.6%
distribute-rgt-neg-out44.6%
fma-define44.6%
hypot-define86.6%
*-commutative86.6%
Simplified86.6%
if 1.70000000000000006e75 < y.re Initial program 33.9%
fma-define33.9%
hypot-define60.7%
*-commutative60.7%
add-sqr-sqrt35.7%
sqrt-unprod76.8%
pow276.8%
Applied egg-rr76.8%
unpow276.8%
rem-sqrt-square76.8%
fma-define76.8%
hypot-undefine39.3%
unpow239.3%
unpow239.3%
+-commutative39.3%
+-commutative39.3%
fma-define39.3%
Simplified76.8%
Final simplification84.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (log (hypot x.re x.im))))
(if (<= y.re 2.1e+80)
(*
(exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_1 y.im t_0)))
(* (fabs (cos t_0)) (pow (hypot x.im x.re) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 2.1e+80) {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_1, y_46_im, t_0));
} else {
tmp = fabs(cos(t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 2.1e+80) tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_1, y_46_im, t_0))); else tmp = Float64(abs(cos(t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 2.1e+80], N[(N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 2.1 \cdot 10^{+80}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_1, y.im, t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|\cos t\_0\right| \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < 2.10000000000000001e80Initial program 45.4%
cancel-sign-sub-inv45.4%
fma-define45.4%
hypot-define45.4%
distribute-lft-neg-in45.4%
distribute-rgt-neg-out45.4%
fma-define45.4%
hypot-define86.8%
*-commutative86.8%
Simplified86.8%
if 2.10000000000000001e80 < y.re Initial program 30.2%
cancel-sign-sub-inv30.2%
fma-define30.2%
hypot-define30.2%
distribute-lft-neg-in30.2%
distribute-rgt-neg-out30.2%
fma-define30.2%
hypot-define58.5%
*-commutative58.5%
Simplified58.5%
Taylor expanded in y.im around 0 58.5%
unpow258.5%
unpow258.5%
hypot-undefine58.5%
Simplified58.5%
add-cbrt-cube62.3%
pow362.3%
Applied egg-rr62.3%
add-sqr-sqrt45.3%
sqrt-unprod73.6%
pow273.6%
rem-cbrt-cube73.6%
Applied egg-rr73.6%
unpow273.6%
rem-sqrt-square73.6%
Simplified73.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -7.8e-13) (not (<= y.im 5.3e-17)))
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(cos
(* y.im (+ (log (hypot x.im x.re)) (* y.re (/ (atan2 x.im x.re) y.im))))))
(* (fabs (cos (* y.re (atan2 x.im x.re)))) (pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -7.8e-13) || !(y_46_im <= 5.3e-17)) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((y_46_im * (log(hypot(x_46_im, x_46_re)) + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
} else {
tmp = fabs(cos((y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -7.8e-13) || !(y_46_im <= 5.3e-17)) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); else tmp = Float64(abs(cos(Float64(y_46_re * atan(x_46_im, x_46_re)))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -7.8e-13], N[Not[LessEqual[y$46$im, 5.3e-17]], $MachinePrecision]], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -7.8 \cdot 10^{-13} \lor \neg \left(y.im \leq 5.3 \cdot 10^{-17}\right):\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right| \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -7.80000000000000009e-13 or 5.2999999999999998e-17 < y.im Initial program 43.6%
cancel-sign-sub-inv43.6%
fma-define43.6%
hypot-define43.6%
distribute-lft-neg-in43.6%
distribute-rgt-neg-out43.6%
fma-define43.6%
hypot-define73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in y.im around inf 43.6%
unpow243.6%
unpow243.6%
hypot-undefine74.7%
associate-/l*73.9%
Simplified73.9%
if -7.80000000000000009e-13 < y.im < 5.2999999999999998e-17Initial program 40.9%
cancel-sign-sub-inv40.9%
fma-define40.9%
hypot-define40.9%
distribute-lft-neg-in40.9%
distribute-rgt-neg-out40.9%
fma-define40.9%
hypot-define88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in y.im around 0 63.0%
unpow263.0%
unpow263.0%
hypot-undefine88.2%
Simplified88.2%
add-cbrt-cube89.8%
pow389.8%
Applied egg-rr89.8%
add-sqr-sqrt76.4%
sqrt-unprod96.1%
pow296.1%
rem-cbrt-cube96.1%
Applied egg-rr96.1%
unpow296.1%
rem-sqrt-square96.1%
Simplified96.1%
Final simplification84.9%
(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 (log (hypot x.re x.im))))
(if (<= y.re -5.8e-37)
(*
(exp (fma t_2 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (pow (cbrt t_1) 3.0)))
(if (<= y.re 3.6)
(* (cos (fma t_2 y.im t_1)) (/ (pow (hypot x.re x.im) y.re) (exp t_0)))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(cos (* y.im (log (hypot x.im x.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 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -5.8e-37) {
tmp = exp(fma(t_2, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(pow(cbrt(t_1), 3.0));
} else if (y_46_re <= 3.6) {
tmp = cos(fma(t_2, y_46_im, t_1)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / exp(t_0));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
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 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -5.8e-37) tmp = Float64(exp(fma(t_2, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos((cbrt(t_1) ^ 3.0))); elseif (y_46_re <= 3.6) tmp = Float64(cos(fma(t_2, y_46_im, t_1)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / exp(t_0))); else tmp = Float64(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)) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -5.8e-37], N[(N[Exp[N[(t$95$2 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.6], N[(N[Cos[N[(t$95$2 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * 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]), $MachinePrecision], N[(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] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -5.8 \cdot 10^{-37}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_2, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left({\left(\sqrt[3]{t\_1}\right)}^{3}\right)\\
\mathbf{elif}\;y.re \leq 3.6:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t\_2, y.im, t\_1\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{t\_0}}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -5.80000000000000009e-37Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
add-cube-cbrt88.5%
pow390.1%
hypot-define42.6%
*-commutative42.6%
fma-define42.6%
+-commutative42.6%
*-commutative42.6%
fma-define42.6%
*-commutative42.6%
hypot-define90.1%
Applied egg-rr90.1%
Taylor expanded in y.re around inf 91.8%
if -5.80000000000000009e-37 < y.re < 3.60000000000000009Initial program 47.3%
exp-diff47.3%
exp-to-pow47.3%
hypot-define47.3%
*-commutative47.3%
exp-prod47.2%
fma-define47.2%
hypot-define86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in y.im around inf 87.0%
if 3.60000000000000009 < y.re Initial program 35.1%
Taylor expanded in y.re around 0 39.2%
*-commutative39.2%
unpow239.2%
unpow239.2%
hypot-undefine71.7%
Simplified71.7%
Final simplification83.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re)))))
(t_1 (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re -4e-37)
(*
(exp (fma (log (hypot x.re x.im)) y.re t_1))
(cos (pow (cbrt (* y.re (atan2 x.im x.re))) 3.0)))
(if (<= y.re 0.026)
(* t_0 (exp t_1))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = atan2(x_46_im, x_46_re) * -y_46_im;
double tmp;
if (y_46_re <= -4e-37) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, t_1)) * cos(pow(cbrt((y_46_re * atan2(x_46_im, x_46_re))), 3.0));
} else if (y_46_re <= 0.026) {
tmp = t_0 * exp(t_1);
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) tmp = 0.0 if (y_46_re <= -4e-37) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, t_1)) * cos((cbrt(Float64(y_46_re * atan(x_46_im, x_46_re))) ^ 3.0))); elseif (y_46_re <= 0.026) tmp = Float64(t_0 * exp(t_1)); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$re, -4e-37], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Cos[N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.026], N[(t$95$0 * N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision], N[(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] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\\
\mathbf{if}\;y.re \leq -4 \cdot 10^{-37}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, t\_1\right)} \cdot \cos \left({\left(\sqrt[3]{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}\right)\\
\mathbf{elif}\;y.re \leq 0.026:\\
\;\;\;\;t\_0 \cdot e^{t\_1}\\
\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 t\_0\\
\end{array}
\end{array}
if y.re < -4.00000000000000027e-37Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
add-cube-cbrt88.5%
pow390.1%
hypot-define42.6%
*-commutative42.6%
fma-define42.6%
+-commutative42.6%
*-commutative42.6%
fma-define42.6%
*-commutative42.6%
hypot-define90.1%
Applied egg-rr90.1%
Taylor expanded in y.re around inf 91.8%
if -4.00000000000000027e-37 < y.re < 0.0259999999999999988Initial program 47.3%
cancel-sign-sub-inv47.3%
fma-define47.3%
hypot-define47.3%
distribute-lft-neg-in47.3%
distribute-rgt-neg-out47.3%
fma-define47.3%
hypot-define87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in y.re around 0 47.3%
*-commutative47.3%
unpow247.3%
unpow247.3%
hypot-undefine85.8%
neg-mul-185.8%
distribute-rgt-neg-in85.8%
Simplified85.8%
if 0.0259999999999999988 < y.re Initial program 35.1%
Taylor expanded in y.re around 0 39.2%
*-commutative39.2%
unpow239.2%
unpow239.2%
hypot-undefine71.7%
Simplified71.7%
Final simplification83.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -5.8e-37)
(*
(pow (hypot x.im x.re) y.re)
(cos (* y.re (cbrt (pow (atan2 x.im x.re) 3.0)))))
(if (<= y.re 0.0025)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -5.8e-37) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * cos((y_46_re * cbrt(pow(atan2(x_46_im, x_46_re), 3.0))));
} else if (y_46_re <= 0.0025) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -5.8e-37) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((y_46_re * Math.cbrt(Math.pow(Math.atan2(x_46_im, x_46_re), 3.0))));
} else if (y_46_re <= 0.0025) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -5.8e-37) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(y_46_re * cbrt((atan(x_46_im, x_46_re) ^ 3.0))))); elseif (y_46_re <= 0.0025) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -5.8e-37], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(y$46$re * N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.0025], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -5.8 \cdot 10^{-37}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.re \cdot \sqrt[3]{{\tan^{-1}_* \frac{x.im}{x.re}}^{3}}\right)\\
\mathbf{elif}\;y.re \leq 0.0025:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\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 t\_0\\
\end{array}
\end{array}
if y.re < -5.80000000000000009e-37Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.im around 0 78.9%
unpow278.9%
unpow278.9%
hypot-undefine82.1%
Simplified82.1%
add-cbrt-cube90.3%
pow390.3%
Applied egg-rr90.3%
if -5.80000000000000009e-37 < y.re < 0.00250000000000000005Initial program 47.3%
cancel-sign-sub-inv47.3%
fma-define47.3%
hypot-define47.3%
distribute-lft-neg-in47.3%
distribute-rgt-neg-out47.3%
fma-define47.3%
hypot-define87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in y.re around 0 47.3%
*-commutative47.3%
unpow247.3%
unpow247.3%
hypot-undefine85.8%
neg-mul-185.8%
distribute-rgt-neg-in85.8%
Simplified85.8%
if 0.00250000000000000005 < y.re Initial program 35.1%
Taylor expanded in y.re around 0 39.2%
*-commutative39.2%
unpow239.2%
unpow239.2%
hypot-undefine71.7%
Simplified71.7%
Final simplification82.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re))))
(t_1 (pow (hypot x.im x.re) y.re))
(t_2 (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re -5.8e-37)
(* t_1 (cos (* y.re (cbrt (pow (atan2 x.im x.re) 3.0)))))
(if (<= y.re 1.92e-16)
(* (cos (* y.im (log (hypot x.im x.re)))) (exp t_2))
(if (<= y.re 1.8e+81)
(* (exp (fma (log (hypot x.re x.im)) y.re t_2)) t_0)
(* (fabs t_0) t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_2 = atan2(x_46_im, x_46_re) * -y_46_im;
double tmp;
if (y_46_re <= -5.8e-37) {
tmp = t_1 * cos((y_46_re * cbrt(pow(atan2(x_46_im, x_46_re), 3.0))));
} else if (y_46_re <= 1.92e-16) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(t_2);
} else if (y_46_re <= 1.8e+81) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, t_2)) * t_0;
} else {
tmp = fabs(t_0) * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re t_2 = Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) tmp = 0.0 if (y_46_re <= -5.8e-37) tmp = Float64(t_1 * cos(Float64(y_46_re * cbrt((atan(x_46_im, x_46_re) ^ 3.0))))); elseif (y_46_re <= 1.92e-16) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(t_2)); elseif (y_46_re <= 1.8e+81) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, t_2)) * t_0); else tmp = Float64(abs(t_0) * t_1); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$re, -5.8e-37], N[(t$95$1 * N[Cos[N[(y$46$re * N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.92e-16], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[t$95$2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.8e+81], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + t$95$2), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\\
\mathbf{if}\;y.re \leq -5.8 \cdot 10^{-37}:\\
\;\;\;\;t\_1 \cdot \cos \left(y.re \cdot \sqrt[3]{{\tan^{-1}_* \frac{x.im}{x.re}}^{3}}\right)\\
\mathbf{elif}\;y.re \leq 1.92 \cdot 10^{-16}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{t\_2}\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{+81}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, t\_2\right)} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|t\_0\right| \cdot t\_1\\
\end{array}
\end{array}
if y.re < -5.80000000000000009e-37Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.im around 0 78.9%
unpow278.9%
unpow278.9%
hypot-undefine82.1%
Simplified82.1%
add-cbrt-cube90.3%
pow390.3%
Applied egg-rr90.3%
if -5.80000000000000009e-37 < y.re < 1.91999999999999989e-16Initial program 48.5%
cancel-sign-sub-inv48.5%
fma-define48.5%
hypot-define48.5%
distribute-lft-neg-in48.5%
distribute-rgt-neg-out48.5%
fma-define48.5%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.re around 0 48.5%
*-commutative48.5%
unpow248.5%
unpow248.5%
hypot-undefine86.7%
neg-mul-186.7%
distribute-rgt-neg-in86.7%
Simplified86.7%
if 1.91999999999999989e-16 < y.re < 1.80000000000000003e81Initial program 41.7%
cancel-sign-sub-inv41.7%
fma-define41.7%
hypot-define41.7%
distribute-lft-neg-in41.7%
distribute-rgt-neg-out41.7%
fma-define41.7%
hypot-define83.3%
*-commutative83.3%
Simplified83.3%
add-cube-cbrt79.2%
pow383.3%
hypot-define41.7%
*-commutative41.7%
fma-define41.7%
+-commutative41.7%
*-commutative41.7%
fma-define41.7%
*-commutative41.7%
hypot-define83.3%
Applied egg-rr83.3%
Taylor expanded in y.im around 0 79.2%
if 1.80000000000000003e81 < y.re Initial program 30.2%
cancel-sign-sub-inv30.2%
fma-define30.2%
hypot-define30.2%
distribute-lft-neg-in30.2%
distribute-rgt-neg-out30.2%
fma-define30.2%
hypot-define58.5%
*-commutative58.5%
Simplified58.5%
Taylor expanded in y.im around 0 58.5%
unpow258.5%
unpow258.5%
hypot-undefine58.5%
Simplified58.5%
add-cbrt-cube62.3%
pow362.3%
Applied egg-rr62.3%
add-sqr-sqrt45.3%
sqrt-unprod73.6%
pow273.6%
rem-cbrt-cube73.6%
Applied egg-rr73.6%
unpow273.6%
rem-sqrt-square73.6%
Simplified73.6%
Final simplification84.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -5.8e-37)
(* t_0 (cos (* y.re (cbrt (pow (atan2 x.im x.re) 3.0)))))
(if (<= y.re 1.12e-13)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(* (fabs (cos (* y.re (atan2 x.im x.re)))) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -5.8e-37) {
tmp = t_0 * cos((y_46_re * cbrt(pow(atan2(x_46_im, x_46_re), 3.0))));
} else if (y_46_re <= 1.12e-13) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = fabs(cos((y_46_re * atan2(x_46_im, x_46_re)))) * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -5.8e-37) {
tmp = t_0 * Math.cos((y_46_re * Math.cbrt(Math.pow(Math.atan2(x_46_im, x_46_re), 3.0))));
} else if (y_46_re <= 1.12e-13) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.abs(Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)))) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -5.8e-37) tmp = Float64(t_0 * cos(Float64(y_46_re * cbrt((atan(x_46_im, x_46_re) ^ 3.0))))); elseif (y_46_re <= 1.12e-13) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(abs(cos(Float64(y_46_re * atan(x_46_im, x_46_re)))) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -5.8e-37], N[(t$95$0 * N[Cos[N[(y$46$re * N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.12e-13], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -5.8 \cdot 10^{-37}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \sqrt[3]{{\tan^{-1}_* \frac{x.im}{x.re}}^{3}}\right)\\
\mathbf{elif}\;y.re \leq 1.12 \cdot 10^{-13}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\left|\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right| \cdot t\_0\\
\end{array}
\end{array}
if y.re < -5.80000000000000009e-37Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.im around 0 78.9%
unpow278.9%
unpow278.9%
hypot-undefine82.1%
Simplified82.1%
add-cbrt-cube90.3%
pow390.3%
Applied egg-rr90.3%
if -5.80000000000000009e-37 < y.re < 1.12e-13Initial program 48.5%
cancel-sign-sub-inv48.5%
fma-define48.5%
hypot-define48.5%
distribute-lft-neg-in48.5%
distribute-rgt-neg-out48.5%
fma-define48.5%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.re around 0 48.5%
*-commutative48.5%
unpow248.5%
unpow248.5%
hypot-undefine86.7%
neg-mul-186.7%
distribute-rgt-neg-in86.7%
Simplified86.7%
if 1.12e-13 < y.re Initial program 33.8%
cancel-sign-sub-inv33.8%
fma-define33.8%
hypot-define33.8%
distribute-lft-neg-in33.8%
distribute-rgt-neg-out33.8%
fma-define33.8%
hypot-define66.2%
*-commutative66.2%
Simplified66.2%
Taylor expanded in y.im around 0 53.6%
unpow253.6%
unpow253.6%
hypot-undefine57.4%
Simplified57.4%
add-cbrt-cube57.4%
pow358.7%
Applied egg-rr58.7%
add-sqr-sqrt44.3%
sqrt-unprod67.8%
pow267.8%
rem-cbrt-cube67.8%
Applied egg-rr67.8%
unpow267.8%
rem-sqrt-square67.8%
Simplified67.8%
Final simplification81.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -5.8e-37)
(* t_0 (cos (* y.re (log1p (expm1 (atan2 x.im x.re))))))
(if (<= y.re 1.12e-13)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(* (fabs (cos (* y.re (atan2 x.im x.re)))) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -5.8e-37) {
tmp = t_0 * cos((y_46_re * log1p(expm1(atan2(x_46_im, x_46_re)))));
} else if (y_46_re <= 1.12e-13) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = fabs(cos((y_46_re * atan2(x_46_im, x_46_re)))) * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -5.8e-37) {
tmp = t_0 * Math.cos((y_46_re * Math.log1p(Math.expm1(Math.atan2(x_46_im, x_46_re)))));
} else if (y_46_re <= 1.12e-13) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.abs(Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)))) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -5.8e-37: tmp = t_0 * math.cos((y_46_re * math.log1p(math.expm1(math.atan2(x_46_im, x_46_re))))) elif y_46_re <= 1.12e-13: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.fabs(math.cos((y_46_re * math.atan2(x_46_im, x_46_re)))) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -5.8e-37) tmp = Float64(t_0 * cos(Float64(y_46_re * log1p(expm1(atan(x_46_im, x_46_re)))))); elseif (y_46_re <= 1.12e-13) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(abs(cos(Float64(y_46_re * atan(x_46_im, x_46_re)))) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -5.8e-37], N[(t$95$0 * N[Cos[N[(y$46$re * N[Log[1 + N[(Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.12e-13], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -5.8 \cdot 10^{-37}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 1.12 \cdot 10^{-13}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\left|\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right| \cdot t\_0\\
\end{array}
\end{array}
if y.re < -5.80000000000000009e-37Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.im around 0 78.9%
unpow278.9%
unpow278.9%
hypot-undefine82.1%
Simplified82.1%
log1p-expm1-u83.7%
Applied egg-rr83.7%
if -5.80000000000000009e-37 < y.re < 1.12e-13Initial program 48.5%
cancel-sign-sub-inv48.5%
fma-define48.5%
hypot-define48.5%
distribute-lft-neg-in48.5%
distribute-rgt-neg-out48.5%
fma-define48.5%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.re around 0 48.5%
*-commutative48.5%
unpow248.5%
unpow248.5%
hypot-undefine86.7%
neg-mul-186.7%
distribute-rgt-neg-in86.7%
Simplified86.7%
if 1.12e-13 < y.re Initial program 33.8%
cancel-sign-sub-inv33.8%
fma-define33.8%
hypot-define33.8%
distribute-lft-neg-in33.8%
distribute-rgt-neg-out33.8%
fma-define33.8%
hypot-define66.2%
*-commutative66.2%
Simplified66.2%
Taylor expanded in y.im around 0 53.6%
unpow253.6%
unpow253.6%
hypot-undefine57.4%
Simplified57.4%
add-cbrt-cube57.4%
pow358.7%
Applied egg-rr58.7%
add-sqr-sqrt44.3%
sqrt-unprod67.8%
pow267.8%
rem-cbrt-cube67.8%
Applied egg-rr67.8%
unpow267.8%
rem-sqrt-square67.8%
Simplified67.8%
Final simplification80.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re))))
(t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -5.8e-37)
(* t_0 t_1)
(if (<= y.re 1.12e-13)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(* (fabs t_0) t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -5.8e-37) {
tmp = t_0 * t_1;
} else if (y_46_re <= 1.12e-13) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = fabs(t_0) * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -5.8e-37) {
tmp = t_0 * t_1;
} else if (y_46_re <= 1.12e-13) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.abs(t_0) * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -5.8e-37: tmp = t_0 * t_1 elif y_46_re <= 1.12e-13: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.fabs(t_0) * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -5.8e-37) tmp = Float64(t_0 * t_1); elseif (y_46_re <= 1.12e-13) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(abs(t_0) * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -5.8e-37) tmp = t_0 * t_1; elseif (y_46_re <= 1.12e-13) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = abs(t_0) * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -5.8e-37], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.12e-13], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -5.8 \cdot 10^{-37}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1.12 \cdot 10^{-13}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\left|t\_0\right| \cdot t\_1\\
\end{array}
\end{array}
if y.re < -5.80000000000000009e-37Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.im around 0 78.9%
unpow278.9%
unpow278.9%
hypot-undefine82.1%
Simplified82.1%
if -5.80000000000000009e-37 < y.re < 1.12e-13Initial program 48.5%
cancel-sign-sub-inv48.5%
fma-define48.5%
hypot-define48.5%
distribute-lft-neg-in48.5%
distribute-rgt-neg-out48.5%
fma-define48.5%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.re around 0 48.5%
*-commutative48.5%
unpow248.5%
unpow248.5%
hypot-undefine86.7%
neg-mul-186.7%
distribute-rgt-neg-in86.7%
Simplified86.7%
if 1.12e-13 < y.re Initial program 33.8%
cancel-sign-sub-inv33.8%
fma-define33.8%
hypot-define33.8%
distribute-lft-neg-in33.8%
distribute-rgt-neg-out33.8%
fma-define33.8%
hypot-define66.2%
*-commutative66.2%
Simplified66.2%
Taylor expanded in y.im around 0 53.6%
unpow253.6%
unpow253.6%
hypot-undefine57.4%
Simplified57.4%
add-cbrt-cube57.4%
pow358.7%
Applied egg-rr58.7%
add-sqr-sqrt44.3%
sqrt-unprod67.8%
pow267.8%
rem-cbrt-cube67.8%
Applied egg-rr67.8%
unpow267.8%
rem-sqrt-square67.8%
Simplified67.8%
Final simplification79.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re))))
(t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -3.7e-9)
(* t_0 t_1)
(if (<= y.re 1.85e-20)
(exp (* (atan2 x.im x.re) (- y.im)))
(* (fabs t_0) t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -3.7e-9) {
tmp = t_0 * t_1;
} else if (y_46_re <= 1.85e-20) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = fabs(t_0) * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -3.7e-9) {
tmp = t_0 * t_1;
} else if (y_46_re <= 1.85e-20) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.abs(t_0) * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -3.7e-9: tmp = t_0 * t_1 elif y_46_re <= 1.85e-20: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.fabs(t_0) * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -3.7e-9) tmp = Float64(t_0 * t_1); elseif (y_46_re <= 1.85e-20) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = Float64(abs(t_0) * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -3.7e-9) tmp = t_0 * t_1; elseif (y_46_re <= 1.85e-20) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = abs(t_0) * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -3.7e-9], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.85e-20], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -3.7 \cdot 10^{-9}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1.85 \cdot 10^{-20}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\left|t\_0\right| \cdot t\_1\\
\end{array}
\end{array}
if y.re < -3.7e-9Initial program 42.4%
cancel-sign-sub-inv42.4%
fma-define42.4%
hypot-define42.4%
distribute-lft-neg-in42.4%
distribute-rgt-neg-out42.4%
fma-define42.4%
hypot-define89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in y.im around 0 81.5%
unpow281.5%
unpow281.5%
hypot-undefine83.1%
Simplified83.1%
if -3.7e-9 < y.re < 1.85e-20Initial program 48.5%
cancel-sign-sub-inv48.5%
fma-define48.5%
hypot-define48.5%
distribute-lft-neg-in48.5%
distribute-rgt-neg-out48.5%
fma-define48.5%
hypot-define86.6%
*-commutative86.6%
Simplified86.6%
add-cube-cbrt86.1%
pow383.6%
hypot-define46.3%
*-commutative46.3%
fma-define46.3%
+-commutative46.3%
*-commutative46.3%
fma-define46.3%
*-commutative46.3%
hypot-define83.6%
Applied egg-rr83.6%
Taylor expanded in y.im around 0 77.5%
Taylor expanded in y.re around 0 77.5%
mul-1-neg77.5%
Simplified77.5%
if 1.85e-20 < y.re Initial program 32.9%
cancel-sign-sub-inv32.9%
fma-define32.9%
hypot-define32.9%
distribute-lft-neg-in32.9%
distribute-rgt-neg-out32.9%
fma-define32.9%
hypot-define66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in y.im around 0 52.3%
unpow252.3%
unpow252.3%
hypot-undefine56.1%
Simplified56.1%
add-cbrt-cube56.1%
pow357.4%
Applied egg-rr57.4%
add-sqr-sqrt43.4%
sqrt-unprod66.3%
pow266.3%
rem-cbrt-cube66.3%
Applied egg-rr66.3%
unpow266.3%
rem-sqrt-square66.3%
Simplified66.3%
Final simplification75.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.2e-12) (not (<= y.re 9.4e-17))) (* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)) (exp (* (atan2 x.im x.re) (- y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.2e-12) || !(y_46_re <= 9.4e-17)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.2e-12) || !(y_46_re <= 9.4e-17)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -3.2e-12) or not (y_46_re <= 9.4e-17): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -3.2e-12) || !(y_46_re <= 9.4e-17)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -3.2e-12) || ~((y_46_re <= 9.4e-17))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3.2e-12], N[Not[LessEqual[y$46$re, 9.4e-17]], $MachinePrecision]], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.2 \cdot 10^{-12} \lor \neg \left(y.re \leq 9.4 \cdot 10^{-17}\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -3.2000000000000001e-12 or 9.3999999999999999e-17 < y.re Initial program 37.2%
cancel-sign-sub-inv37.2%
fma-define37.2%
hypot-define37.2%
distribute-lft-neg-in37.2%
distribute-rgt-neg-out37.2%
fma-define37.2%
hypot-define76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in y.im around 0 65.2%
unpow265.2%
unpow265.2%
hypot-undefine68.0%
Simplified68.0%
if -3.2000000000000001e-12 < y.re < 9.3999999999999999e-17Initial program 48.1%
cancel-sign-sub-inv48.1%
fma-define48.1%
hypot-define48.1%
distribute-lft-neg-in48.1%
distribute-rgt-neg-out48.1%
fma-define48.1%
hypot-define86.0%
*-commutative86.0%
Simplified86.0%
add-cube-cbrt85.4%
pow382.9%
hypot-define45.9%
*-commutative45.9%
fma-define45.9%
+-commutative45.9%
*-commutative45.9%
fma-define45.9%
*-commutative45.9%
hypot-define82.9%
Applied egg-rr82.9%
Taylor expanded in y.im around 0 77.0%
Taylor expanded in y.re around 0 77.0%
mul-1-neg77.0%
Simplified77.0%
Final simplification72.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -1e+183)
(* t_0 (pow x.im y.re))
(if (or (<= y.re -8.4e+21) (not (<= y.re 5.5e-12)))
(* t_0 (pow x.re y.re))
(exp (* (atan2 x.im x.re) (- y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1e+183) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else if ((y_46_re <= -8.4e+21) || !(y_46_re <= 5.5e-12)) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = cos((y_46re * atan2(x_46im, x_46re)))
if (y_46re <= (-1d+183)) then
tmp = t_0 * (x_46im ** y_46re)
else if ((y_46re <= (-8.4d+21)) .or. (.not. (y_46re <= 5.5d-12))) then
tmp = t_0 * (x_46re ** y_46re)
else
tmp = exp((atan2(x_46im, x_46re) * -y_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1e+183) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else if ((y_46_re <= -8.4e+21) || !(y_46_re <= 5.5e-12)) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -1e+183: tmp = t_0 * math.pow(x_46_im, y_46_re) elif (y_46_re <= -8.4e+21) or not (y_46_re <= 5.5e-12): tmp = t_0 * math.pow(x_46_re, y_46_re) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -1e+183) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); elseif ((y_46_re <= -8.4e+21) || !(y_46_re <= 5.5e-12)) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); else tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -1e+183) tmp = t_0 * (x_46_im ^ y_46_re); elseif ((y_46_re <= -8.4e+21) || ~((y_46_re <= 5.5e-12))) tmp = t_0 * (x_46_re ^ y_46_re); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1e+183], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$re, -8.4e+21], N[Not[LessEqual[y$46$re, 5.5e-12]], $MachinePrecision]], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{+183}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq -8.4 \cdot 10^{+21} \lor \neg \left(y.re \leq 5.5 \cdot 10^{-12}\right):\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -9.99999999999999947e182Initial program 33.3%
cancel-sign-sub-inv33.3%
fma-define33.3%
hypot-define33.3%
distribute-lft-neg-in33.3%
distribute-rgt-neg-out33.3%
fma-define33.3%
hypot-define85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y.im around 0 77.8%
unpow277.8%
unpow277.8%
hypot-undefine77.8%
Simplified77.8%
Taylor expanded in x.re around 0 74.2%
if -9.99999999999999947e182 < y.re < -8.4e21 or 5.5000000000000004e-12 < y.re Initial program 38.1%
cancel-sign-sub-inv38.1%
fma-define38.1%
hypot-define38.1%
distribute-lft-neg-in38.1%
distribute-rgt-neg-out38.1%
fma-define38.1%
hypot-define73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in y.im around 0 64.1%
unpow264.1%
unpow264.1%
hypot-undefine65.9%
Simplified65.9%
Taylor expanded in x.im around 0 58.6%
if -8.4e21 < y.re < 5.5000000000000004e-12Initial program 47.7%
cancel-sign-sub-inv47.7%
fma-define47.7%
hypot-define47.7%
distribute-lft-neg-in47.7%
distribute-rgt-neg-out47.7%
fma-define47.7%
hypot-define86.5%
*-commutative86.5%
Simplified86.5%
add-cube-cbrt86.0%
pow383.6%
hypot-define45.6%
*-commutative45.6%
fma-define45.6%
+-commutative45.6%
*-commutative45.6%
fma-define45.6%
*-commutative45.6%
hypot-define83.6%
Applied egg-rr83.6%
Taylor expanded in y.im around 0 77.1%
Taylor expanded in y.re around 0 76.0%
mul-1-neg76.0%
Simplified76.0%
Final simplification68.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -4.9e-9) (not (<= y.re 240.0))) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (exp (* (atan2 x.im x.re) (- y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.9e-9) || !(y_46_re <= 240.0)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-4.9d-9)) .or. (.not. (y_46re <= 240.0d0))) then
tmp = cos((y_46re * atan2(x_46im, x_46re))) * (x_46im ** y_46re)
else
tmp = exp((atan2(x_46im, x_46re) * -y_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.9e-9) || !(y_46_re <= 240.0)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -4.9e-9) or not (y_46_re <= 240.0): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -4.9e-9) || !(y_46_re <= 240.0)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -4.9e-9) || ~((y_46_re <= 240.0))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -4.9e-9], N[Not[LessEqual[y$46$re, 240.0]], $MachinePrecision]], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -4.9 \cdot 10^{-9} \lor \neg \left(y.re \leq 240\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -4.90000000000000004e-9 or 240 < y.re Initial program 38.6%
cancel-sign-sub-inv38.6%
fma-define38.6%
hypot-define38.6%
distribute-lft-neg-in38.6%
distribute-rgt-neg-out38.6%
fma-define38.6%
hypot-define75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in y.im around 0 67.6%
unpow267.6%
unpow267.6%
hypot-undefine68.3%
Simplified68.3%
Taylor expanded in x.re around 0 52.7%
if -4.90000000000000004e-9 < y.re < 240Initial program 46.1%
cancel-sign-sub-inv46.1%
fma-define46.1%
hypot-define46.1%
distribute-lft-neg-in46.1%
distribute-rgt-neg-out46.1%
fma-define46.1%
hypot-define86.5%
*-commutative86.5%
Simplified86.5%
add-cube-cbrt86.0%
pow383.6%
hypot-define44.0%
*-commutative44.0%
fma-define44.0%
+-commutative44.0%
*-commutative44.0%
fma-define44.0%
*-commutative44.0%
hypot-define83.6%
Applied egg-rr83.6%
Taylor expanded in y.im around 0 76.3%
Taylor expanded in y.re around 0 75.2%
mul-1-neg75.2%
Simplified75.2%
Final simplification63.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow (exp (- y.im)) (atan2 x.im x.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(exp(-y_46_im), atan2(x_46_im, x_46_re));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = exp(-y_46im) ** atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.exp(-y_46_im), Math.atan2(x_46_im, x_46_re));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.exp(-y_46_im), math.atan2(x_46_im, x_46_re))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp(-y_46_im) ^ atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}
\end{array}
Initial program 42.3%
cancel-sign-sub-inv42.3%
fma-define42.3%
hypot-define42.3%
distribute-lft-neg-in42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
add-cube-cbrt79.2%
pow379.5%
hypot-define42.4%
*-commutative42.4%
fma-define42.4%
+-commutative42.4%
*-commutative42.4%
fma-define42.4%
*-commutative42.4%
hypot-define79.5%
Applied egg-rr79.5%
Taylor expanded in y.im around 0 76.0%
Taylor expanded in y.re around 0 47.8%
mul-1-neg47.8%
Simplified47.8%
distribute-lft-neg-in47.8%
exp-prod48.2%
Applied egg-rr48.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (* (atan2 x.im x.re) (- y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = exp((atan2(x_46im, x_46re) * -y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}
\end{array}
Initial program 42.3%
cancel-sign-sub-inv42.3%
fma-define42.3%
hypot-define42.3%
distribute-lft-neg-in42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
add-cube-cbrt79.2%
pow379.5%
hypot-define42.4%
*-commutative42.4%
fma-define42.4%
+-commutative42.4%
*-commutative42.4%
fma-define42.4%
*-commutative42.4%
hypot-define79.5%
Applied egg-rr79.5%
Taylor expanded in y.im around 0 76.0%
Taylor expanded in y.re around 0 47.8%
mul-1-neg47.8%
Simplified47.8%
Final simplification47.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (* (atan2 x.im x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp((atan2(x_46_im, x_46_re) * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = exp((atan2(x_46im, x_46re) * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.exp((Math.atan2(x_46_im, x_46_re) * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.exp((math.atan2(x_46_im, x_46_re) * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(atan(x_46_im, x_46_re) * y_46_im)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp((atan2(x_46_im, x_46_re) * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}
\end{array}
Initial program 42.3%
cancel-sign-sub-inv42.3%
fma-define42.3%
hypot-define42.3%
distribute-lft-neg-in42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
add-cube-cbrt79.2%
pow379.5%
hypot-define42.4%
*-commutative42.4%
fma-define42.4%
+-commutative42.4%
*-commutative42.4%
fma-define42.4%
*-commutative42.4%
hypot-define79.5%
Applied egg-rr79.5%
Taylor expanded in y.im around 0 76.0%
Taylor expanded in y.re around 0 47.8%
mul-1-neg47.8%
Simplified47.8%
neg-sub047.8%
sub-neg47.8%
add-sqr-sqrt20.7%
sqrt-unprod34.7%
sqr-neg34.7%
sqrt-unprod16.3%
add-sqr-sqrt32.7%
*-commutative32.7%
Applied egg-rr32.7%
+-lft-identity32.7%
Simplified32.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (- 1.0 (* (atan2 x.im x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 - (atan2(x_46_im, x_46_re) * y_46_im);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0 - (atan2(x_46im, x_46re) * y_46im)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 - (Math.atan2(x_46_im, x_46_re) * y_46_im);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 - (math.atan2(x_46_im, x_46_re) * y_46_im)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 - Float64(atan(x_46_im, x_46_re) * y_46_im)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 - (atan2(x_46_im, x_46_re) * y_46_im); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im
\end{array}
Initial program 42.3%
cancel-sign-sub-inv42.3%
fma-define42.3%
hypot-define42.3%
distribute-lft-neg-in42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
add-cube-cbrt79.2%
pow379.5%
hypot-define42.4%
*-commutative42.4%
fma-define42.4%
+-commutative42.4%
*-commutative42.4%
fma-define42.4%
*-commutative42.4%
hypot-define79.5%
Applied egg-rr79.5%
Taylor expanded in y.im around 0 76.0%
Taylor expanded in y.re around 0 47.8%
mul-1-neg47.8%
Simplified47.8%
Taylor expanded in y.im around 0 28.1%
mul-1-neg28.1%
*-commutative28.1%
unsub-neg28.1%
Simplified28.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 42.3%
cancel-sign-sub-inv42.3%
fma-define42.3%
hypot-define42.3%
distribute-lft-neg-in42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.im around 0 49.4%
unpow249.4%
unpow249.4%
hypot-undefine62.2%
Simplified62.2%
Taylor expanded in y.re around 0 28.1%
herbie shell --seed 2024172
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
: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)))))