
(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 18 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 (* (atan2 x.im x.re) y.im)) (t_1 (log (hypot x.im x.re))))
(if (<= y.re 5.2e+27)
(*
(exp (- (* 2.0 (* (/ y.re 2.0) (log (hypot x.re x.im)))) t_0))
(cos
(+
(* y.im (* (pow (cbrt (cbrt (pow t_1 2.0))) 3.0) (cbrt t_1)))
(* y.re (atan2 x.im x.re)))))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(cos (* y.im t_1))))))
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 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= 5.2e+27) {
tmp = exp(((2.0 * ((y_46_re / 2.0) * log(hypot(x_46_re, x_46_im)))) - t_0)) * cos(((y_46_im * (pow(cbrt(cbrt(pow(t_1, 2.0))), 3.0) * cbrt(t_1))) + (y_46_re * atan2(x_46_im, x_46_re))));
} 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 * 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.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= 5.2e+27) {
tmp = Math.exp(((2.0 * ((y_46_re / 2.0) * Math.log(Math.hypot(x_46_re, x_46_im)))) - t_0)) * Math.cos(((y_46_im * (Math.pow(Math.cbrt(Math.cbrt(Math.pow(t_1, 2.0))), 3.0) * Math.cbrt(t_1))) + (y_46_re * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * Math.cos((y_46_im * t_1));
}
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 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= 5.2e+27) tmp = Float64(exp(Float64(Float64(2.0 * Float64(Float64(y_46_re / 2.0) * log(hypot(x_46_re, x_46_im)))) - t_0)) * cos(Float64(Float64(y_46_im * Float64((cbrt(cbrt((t_1 ^ 2.0))) ^ 3.0) * cbrt(t_1))) + Float64(y_46_re * atan(x_46_im, x_46_re))))); 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 * t_1))); 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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 5.2e+27], N[(N[Exp[N[(N[(2.0 * N[(N[(y$46$re / 2.0), $MachinePrecision] * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(y$46$im * N[(N[Power[N[Power[N[Power[N[Power[t$95$1, 2.0], $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] * N[Power[t$95$1, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $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 * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq 5.2 \cdot 10^{+27}:\\
\;\;\;\;e^{2 \cdot \left(\frac{y.re}{2} \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) - t\_0} \cdot \cos \left(y.im \cdot \left({\left(\sqrt[3]{\sqrt[3]{{t\_1}^{2}}}\right)}^{3} \cdot \sqrt[3]{t\_1}\right) + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\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 t\_1\right)\\
\end{array}
\end{array}
if y.re < 5.20000000000000018e27Initial program 42.8%
add-log-exp42.3%
hypot-define42.3%
pow-to-exp42.3%
add-sqr-sqrt42.3%
log-prod42.3%
Applied egg-rr42.3%
count-242.3%
hypot-undefine42.3%
unpow242.3%
unpow242.3%
+-commutative42.3%
unpow242.3%
unpow242.3%
hypot-undefine42.3%
Simplified42.3%
hypot-define82.6%
add-cube-cbrt81.1%
pow382.2%
Applied egg-rr82.2%
add-cube-cbrt83.6%
unpow-prod-down82.7%
Applied egg-rr83.4%
sqrt-pow183.4%
hypot-undefine63.9%
+-commutative63.9%
hypot-define83.4%
log-pow85.6%
Applied egg-rr85.6%
if 5.20000000000000018e27 < y.re Initial program 23.2%
Taylor expanded in y.re around 0 36.2%
*-commutative36.2%
unpow236.2%
unpow236.2%
hypot-undefine76.9%
Simplified76.9%
Final simplification83.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -7.4e+96)
(* (fabs (cos t_0)) (pow (hypot x.im x.re) y.re))
(if (<= y.re 85000000000000.0)
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -7.4e+96) {
tmp = fabs(cos(t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 85000000000000.0) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} 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))) * 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(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -7.4e+96) tmp = Float64(abs(cos(t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 85000000000000.0) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); 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))) * 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.4e+96], 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], If[LessEqual[y$46$re, 85000000000000.0], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $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[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 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -7.4 \cdot 10^{+96}:\\
\;\;\;\;\left|\cos t\_0\right| \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 85000000000000:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\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 \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -7.39999999999999982e96Initial program 44.7%
cancel-sign-sub-inv44.7%
fma-define44.7%
hypot-define44.7%
distribute-lft-neg-in44.7%
distribute-rgt-neg-out44.7%
fma-define44.7%
hypot-define86.8%
*-commutative86.8%
Simplified86.8%
Taylor expanded in y.im around 0 89.5%
unpow289.5%
unpow289.5%
hypot-undefine89.5%
Simplified89.5%
*-commutative89.5%
expm1-log1p-u52.6%
expm1-undefine52.6%
*-commutative52.6%
Applied egg-rr52.6%
expm1-define52.6%
Simplified52.6%
expm1-log1p-u89.5%
add-sqr-sqrt52.6%
sqrt-unprod97.4%
pow297.4%
Applied egg-rr97.4%
unpow297.4%
rem-sqrt-square97.4%
Simplified97.4%
if -7.39999999999999982e96 < y.re < 8.5e13Initial program 44.0%
exp-diff43.3%
exp-to-pow43.3%
hypot-define43.3%
*-commutative43.3%
exp-prod42.7%
fma-define42.7%
hypot-define82.9%
*-commutative82.9%
Simplified82.9%
if 8.5e13 < y.re Initial program 21.3%
Taylor expanded in y.re around 0 33.3%
*-commutative33.3%
unpow233.3%
unpow233.3%
hypot-undefine74.7%
Simplified74.7%
Final simplification82.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= y.re 2.8e+16)
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(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 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 2.8e+16) {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} 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))) * 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 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 2.8e+16) tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); 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))) * 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 2.8e+16], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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[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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 2.8 \cdot 10^{+16}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_0, 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 \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < 2.8e16Initial program 44.2%
cancel-sign-sub-inv44.2%
fma-define44.2%
hypot-define44.2%
distribute-lft-neg-in44.2%
distribute-rgt-neg-out44.2%
fma-define44.2%
hypot-define84.7%
*-commutative84.7%
Simplified84.7%
if 2.8e16 < y.re Initial program 21.3%
Taylor expanded in y.re around 0 33.3%
*-commutative33.3%
unpow233.3%
unpow233.3%
hypot-undefine74.7%
Simplified74.7%
Final simplification81.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (log (hypot x.im x.re)))
(t_2
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_1 y.re))))))))
(if (<= y.re -2.5e-15)
t_2
(if (<= y.re 3e-71)
(*
(cos (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(exp (* (- y.im) (pow (cbrt (atan2 x.im x.re)) 3.0))))
(if (<= y.re 1.5e+16)
t_2
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(cos (* y.im t_1))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_1 / y_46_re)))));
double tmp;
if (y_46_re <= -2.5e-15) {
tmp = t_2;
} else if (y_46_re <= 3e-71) {
tmp = cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp((-y_46_im * pow(cbrt(atan2(x_46_im, x_46_re)), 3.0)));
} else if (y_46_re <= 1.5e+16) {
tmp = t_2;
} 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))) * cos((y_46_im * t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(t_1 / y_46_re)))))) tmp = 0.0 if (y_46_re <= -2.5e-15) tmp = t_2; elseif (y_46_re <= 3e-71) tmp = Float64(cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(Float64(-y_46_im) * (cbrt(atan(x_46_im, x_46_re)) ^ 3.0)))); elseif (y_46_re <= 1.5e+16) tmp = t_2; 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))) * cos(Float64(y_46_im * t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(t$95$1 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.5e-15], t$95$2, If[LessEqual[y$46$re, 3e-71], N[(N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.5e+16], t$95$2, 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[Cos[N[(y$46$im * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{t\_1}{y.re}\right)\right)\\
\mathbf{if}\;y.re \leq -2.5 \cdot 10^{-15}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{-71}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{\left(-y.im\right) \cdot {\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}}\\
\mathbf{elif}\;y.re \leq 1.5 \cdot 10^{+16}:\\
\;\;\;\;t\_2\\
\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 \cos \left(y.im \cdot t\_1\right)\\
\end{array}
\end{array}
if y.re < -2.5e-15 or 3.0000000000000001e-71 < y.re < 1.5e16Initial 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-define85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y.re around inf 47.7%
+-commutative47.7%
associate-/l*48.9%
unpow248.9%
unpow248.9%
hypot-undefine87.7%
Simplified87.7%
if -2.5e-15 < y.re < 3.0000000000000001e-71Initial program 41.4%
cancel-sign-sub-inv41.4%
fma-define41.4%
hypot-define41.4%
distribute-lft-neg-in41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in y.re around 0 84.3%
neg-mul-184.3%
distribute-rgt-neg-in84.3%
Simplified84.3%
add-cube-cbrt84.3%
pow384.3%
Applied egg-rr84.3%
if 1.5e16 < y.re Initial program 21.3%
Taylor expanded in y.re around 0 33.3%
*-commutative33.3%
unpow233.3%
unpow233.3%
hypot-undefine74.7%
Simplified74.7%
Final simplification82.6%
(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))))
(if (<= y.re -8.5e-9)
(* (fabs (cos t_0)) (pow (hypot x.im x.re) y.re))
(if (<= y.re 3e-71)
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (- y.im) (pow (cbrt (atan2 x.im x.re)) 3.0))))
(if (<= y.re 3e+15)
(*
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))
(cos (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_1 y.re))))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(cos (* y.im t_1))))))))
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 tmp;
if (y_46_re <= -8.5e-9) {
tmp = fabs(cos(t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 3e-71) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((-y_46_im * pow(cbrt(atan2(x_46_im, x_46_re)), 3.0)));
} else if (y_46_re <= 3e+15) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re))) * cos((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_1 / y_46_re)))));
} 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))) * cos((y_46_im * t_1));
}
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)) tmp = 0.0 if (y_46_re <= -8.5e-9) tmp = Float64(abs(cos(t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 3e-71) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(Float64(-y_46_im) * (cbrt(atan(x_46_im, x_46_re)) ^ 3.0)))); elseif (y_46_re <= 3e+15) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) * cos(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(t_1 / y_46_re)))))); 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))) * cos(Float64(y_46_im * t_1))); 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]}, If[LessEqual[y$46$re, -8.5e-9], 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], If[LessEqual[y$46$re, 3e-71], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3e+15], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(t$95$1 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[Cos[N[(y$46$im * t$95$1), $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)\\
\mathbf{if}\;y.re \leq -8.5 \cdot 10^{-9}:\\
\;\;\;\;\left|\cos t\_0\right| \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{-71}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\left(-y.im\right) \cdot {\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}}\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{+15}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{t\_1}{y.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 \cos \left(y.im \cdot t\_1\right)\\
\end{array}
\end{array}
if y.re < -8.5e-9Initial program 41.6%
cancel-sign-sub-inv41.6%
fma-define41.6%
hypot-define41.6%
distribute-lft-neg-in41.6%
distribute-rgt-neg-out41.6%
fma-define41.6%
hypot-define88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in y.im around 0 83.4%
unpow283.4%
unpow283.4%
hypot-undefine85.0%
Simplified85.0%
*-commutative85.0%
expm1-log1p-u56.7%
expm1-undefine56.7%
*-commutative56.7%
Applied egg-rr56.7%
expm1-define56.7%
Simplified56.7%
expm1-log1p-u85.0%
add-sqr-sqrt53.4%
sqrt-unprod88.4%
pow288.4%
Applied egg-rr88.4%
unpow288.4%
rem-sqrt-square88.4%
Simplified88.4%
if -8.5e-9 < y.re < 3.0000000000000001e-71Initial program 43.1%
cancel-sign-sub-inv43.1%
fma-define43.1%
hypot-define43.1%
distribute-lft-neg-in43.1%
distribute-rgt-neg-out43.1%
fma-define43.1%
hypot-define84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in y.re around 0 84.6%
neg-mul-184.6%
distribute-rgt-neg-in84.6%
Simplified84.6%
add-cube-cbrt84.6%
pow384.6%
Applied egg-rr84.6%
if 3.0000000000000001e-71 < y.re < 3e15Initial program 59.8%
exp-diff59.8%
exp-to-pow59.8%
hypot-define59.8%
*-commutative59.8%
exp-prod58.9%
fma-define58.9%
hypot-define70.8%
*-commutative70.8%
Simplified70.8%
Taylor expanded in y.re around inf 58.9%
+-commutative59.8%
associate-/l*65.6%
unpow265.6%
unpow265.6%
hypot-undefine83.3%
Simplified82.5%
if 3e15 < y.re Initial program 21.3%
Taylor expanded in y.re around 0 33.3%
*-commutative33.3%
unpow233.3%
unpow233.3%
hypot-undefine74.7%
Simplified74.7%
Final simplification82.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -1e-7)
(* (fabs (cos t_0)) (pow (hypot x.im x.re) y.re))
(if (<= y.re 9e-26)
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (- y.im) (pow (cbrt (atan2 x.im x.re)) 3.0))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -1e-7) {
tmp = fabs(cos(t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 9e-26) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((-y_46_im * pow(cbrt(atan2(x_46_im, x_46_re)), 3.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))) * 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(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -1e-7) tmp = Float64(abs(cos(t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 9e-26) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(Float64(-y_46_im) * (cbrt(atan(x_46_im, x_46_re)) ^ 3.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))) * 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1e-7], 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], If[LessEqual[y$46$re, 9e-26], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $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[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 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{-7}:\\
\;\;\;\;\left|\cos t\_0\right| \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 9 \cdot 10^{-26}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\left(-y.im\right) \cdot {\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}}\\
\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 \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -9.9999999999999995e-8Initial program 41.6%
cancel-sign-sub-inv41.6%
fma-define41.6%
hypot-define41.6%
distribute-lft-neg-in41.6%
distribute-rgt-neg-out41.6%
fma-define41.6%
hypot-define88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in y.im around 0 83.4%
unpow283.4%
unpow283.4%
hypot-undefine85.0%
Simplified85.0%
*-commutative85.0%
expm1-log1p-u56.7%
expm1-undefine56.7%
*-commutative56.7%
Applied egg-rr56.7%
expm1-define56.7%
Simplified56.7%
expm1-log1p-u85.0%
add-sqr-sqrt53.4%
sqrt-unprod88.4%
pow288.4%
Applied egg-rr88.4%
unpow288.4%
rem-sqrt-square88.4%
Simplified88.4%
if -9.9999999999999995e-8 < y.re < 8.9999999999999998e-26Initial 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-define82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in y.re around 0 82.1%
neg-mul-182.1%
distribute-rgt-neg-in82.1%
Simplified82.1%
add-cube-cbrt82.1%
pow382.1%
Applied egg-rr82.1%
if 8.9999999999999998e-26 < y.re Initial program 28.2%
Taylor expanded in y.re around 0 36.7%
*-commutative36.7%
unpow236.7%
unpow236.7%
hypot-undefine73.3%
Simplified73.3%
Final simplification80.6%
(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 -8e-9)
(* (fabs (cos (* y.re (atan2 x.im x.re)))) (pow (hypot x.im x.re) y.re))
(if (<= y.re 9e-26)
(* 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 <= -8e-9) {
tmp = fabs(cos((y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 9e-26) {
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 <= -8e-9) {
tmp = Math.abs(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 if (y_46_re <= 9e-26) {
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;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -8e-9: tmp = math.fabs(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) elif y_46_re <= 9e-26: 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 <= -8e-9) 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)); elseif (y_46_re <= 9e-26) 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
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -8e-9) tmp = abs(cos((y_46_re * atan2(x_46_im, x_46_re)))) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 9e-26) 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; 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$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -8e-9], 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], If[LessEqual[y$46$re, 9e-26], 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 -8 \cdot 10^{-9}:\\
\;\;\;\;\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}\\
\mathbf{elif}\;y.re \leq 9 \cdot 10^{-26}:\\
\;\;\;\;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 < -8.0000000000000005e-9Initial program 41.6%
cancel-sign-sub-inv41.6%
fma-define41.6%
hypot-define41.6%
distribute-lft-neg-in41.6%
distribute-rgt-neg-out41.6%
fma-define41.6%
hypot-define88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in y.im around 0 83.4%
unpow283.4%
unpow283.4%
hypot-undefine85.0%
Simplified85.0%
*-commutative85.0%
expm1-log1p-u56.7%
expm1-undefine56.7%
*-commutative56.7%
Applied egg-rr56.7%
expm1-define56.7%
Simplified56.7%
expm1-log1p-u85.0%
add-sqr-sqrt53.4%
sqrt-unprod88.4%
pow288.4%
Applied egg-rr88.4%
unpow288.4%
rem-sqrt-square88.4%
Simplified88.4%
if -8.0000000000000005e-9 < y.re < 8.9999999999999998e-26Initial 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-define82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in y.re around 0 42.2%
*-commutative42.2%
unpow242.2%
unpow242.2%
hypot-undefine82.1%
neg-mul-182.1%
distribute-rgt-neg-in82.1%
Simplified82.1%
if 8.9999999999999998e-26 < y.re Initial program 28.2%
Taylor expanded in y.re around 0 36.7%
*-commutative36.7%
unpow236.7%
unpow236.7%
hypot-undefine73.3%
Simplified73.3%
Final simplification80.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -4.5e-7) (not (<= y.re 0.000205)))
(* (fabs (cos t_0)) (pow (hypot x.im x.re) y.re))
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -4.5e-7) || !(y_46_re <= 0.000205)) {
tmp = fabs(cos(t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((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 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -4.5e-7) || !(y_46_re <= 0.000205)) tmp = Float64(abs(cos(t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-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]}, If[Or[LessEqual[y$46$re, -4.5e-7], N[Not[LessEqual[y$46$re, 0.000205]], $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], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-7} \lor \neg \left(y.re \leq 0.000205\right):\\
\;\;\;\;\left|\cos t\_0\right| \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -4.4999999999999998e-7 or 2.05e-4 < y.re Initial program 31.6%
cancel-sign-sub-inv31.6%
fma-define31.6%
hypot-define31.6%
distribute-lft-neg-in31.6%
distribute-rgt-neg-out31.6%
fma-define31.6%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.im around 0 64.2%
unpow264.2%
unpow264.2%
hypot-undefine64.8%
Simplified64.8%
*-commutative64.8%
expm1-log1p-u41.1%
expm1-undefine42.5%
*-commutative42.5%
Applied egg-rr42.5%
expm1-define41.1%
Simplified41.1%
expm1-log1p-u64.8%
add-sqr-sqrt41.8%
sqrt-unprod77.1%
pow277.1%
Applied egg-rr77.1%
unpow277.1%
rem-sqrt-square77.1%
Simplified77.1%
if -4.4999999999999998e-7 < y.re < 2.05e-4Initial program 44.4%
cancel-sign-sub-inv44.4%
fma-define44.4%
hypot-define44.4%
distribute-lft-neg-in44.4%
distribute-rgt-neg-out44.4%
fma-define44.4%
hypot-define82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in y.re around 0 81.6%
neg-mul-181.6%
distribute-rgt-neg-in81.6%
Simplified81.6%
Final simplification79.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.2e-7) (not (<= y.re 8.2e-5)))
(* (fabs (cos (* y.re (atan2 x.im x.re)))) (pow (hypot x.im x.re) y.re))
(*
(cos (* y.im (log (hypot x.im x.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 <= -1.2e-7) || !(y_46_re <= 8.2e-5)) {
tmp = fabs(cos((y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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 <= -1.2e-7) || !(y_46_re <= 8.2e-5)) {
tmp = Math.abs(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.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));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.2e-7) or not (y_46_re <= 8.2e-5): tmp = math.fabs(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.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)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.2e-7) || !(y_46_re <= 8.2e-5)) 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)); else 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)))); 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 <= -1.2e-7) || ~((y_46_re <= 8.2e-5))) tmp = abs(cos((y_46_re * atan2(x_46_im, x_46_re)))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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, -1.2e-7], N[Not[LessEqual[y$46$re, 8.2e-5]], $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], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.2 \cdot 10^{-7} \lor \neg \left(y.re \leq 8.2 \cdot 10^{-5}\right):\\
\;\;\;\;\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}\\
\mathbf{else}:\\
\;\;\;\;\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)}\\
\end{array}
\end{array}
if y.re < -1.19999999999999989e-7 or 8.20000000000000009e-5 < y.re Initial program 31.6%
cancel-sign-sub-inv31.6%
fma-define31.6%
hypot-define31.6%
distribute-lft-neg-in31.6%
distribute-rgt-neg-out31.6%
fma-define31.6%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.im around 0 64.2%
unpow264.2%
unpow264.2%
hypot-undefine64.8%
Simplified64.8%
*-commutative64.8%
expm1-log1p-u41.1%
expm1-undefine42.5%
*-commutative42.5%
Applied egg-rr42.5%
expm1-define41.1%
Simplified41.1%
expm1-log1p-u64.8%
add-sqr-sqrt41.8%
sqrt-unprod77.1%
pow277.1%
Applied egg-rr77.1%
unpow277.1%
rem-sqrt-square77.1%
Simplified77.1%
if -1.19999999999999989e-7 < y.re < 8.20000000000000009e-5Initial program 44.4%
cancel-sign-sub-inv44.4%
fma-define44.4%
hypot-define44.4%
distribute-lft-neg-in44.4%
distribute-rgt-neg-out44.4%
fma-define44.4%
hypot-define82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in y.re around 0 43.7%
*-commutative43.7%
unpow243.7%
unpow243.7%
hypot-undefine81.6%
neg-mul-181.6%
distribute-rgt-neg-in81.6%
Simplified81.6%
Final simplification79.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (or (<= y.re -2.4e-9) (not (<= y.re 0.000205)))
(* (fabs t_0) (pow (hypot x.im x.re) y.re))
(* t_0 (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 <= -2.4e-9) || !(y_46_re <= 0.000205)) {
tmp = fabs(t_0) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * 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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_re <= -2.4e-9) || !(y_46_re <= 0.000205)) {
tmp = Math.abs(t_0) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * 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 <= -2.4e-9) or not (y_46_re <= 0.000205): tmp = math.fabs(t_0) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * 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 <= -2.4e-9) || !(y_46_re <= 0.000205)) tmp = Float64(abs(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * 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 <= -2.4e-9) || ~((y_46_re <= 0.000205))) tmp = abs(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0 * 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[Or[LessEqual[y$46$re, -2.4e-9], N[Not[LessEqual[y$46$re, 0.000205]], $MachinePrecision]], N[(N[Abs[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $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 -2.4 \cdot 10^{-9} \lor \neg \left(y.re \leq 0.000205\right):\\
\;\;\;\;\left|t\_0\right| \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -2.4e-9 or 2.05e-4 < y.re Initial program 31.6%
cancel-sign-sub-inv31.6%
fma-define31.6%
hypot-define31.6%
distribute-lft-neg-in31.6%
distribute-rgt-neg-out31.6%
fma-define31.6%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.im around 0 64.2%
unpow264.2%
unpow264.2%
hypot-undefine64.8%
Simplified64.8%
*-commutative64.8%
expm1-log1p-u41.1%
expm1-undefine42.5%
*-commutative42.5%
Applied egg-rr42.5%
expm1-define41.1%
Simplified41.1%
expm1-log1p-u64.8%
add-sqr-sqrt41.8%
sqrt-unprod77.1%
pow277.1%
Applied egg-rr77.1%
unpow277.1%
rem-sqrt-square77.1%
Simplified77.1%
if -2.4e-9 < y.re < 2.05e-4Initial program 44.4%
cancel-sign-sub-inv44.4%
fma-define44.4%
hypot-define44.4%
distribute-lft-neg-in44.4%
distribute-rgt-neg-out44.4%
fma-define44.4%
hypot-define82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in y.re around 0 81.6%
neg-mul-181.6%
distribute-rgt-neg-in81.6%
Simplified81.6%
Taylor expanded in y.re around inf 32.5%
+-commutative33.3%
associate-/l*34.3%
unpow234.3%
unpow234.3%
hypot-undefine64.5%
Simplified63.7%
Taylor expanded in y.re around inf 79.6%
Final simplification78.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 -5e-7)
(* t_0 (pow (hypot x.im x.re) y.re))
(if (<= y.re 2.1e+15)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(+ 1.0 (log (pow (hypot x.re x.im) y.re)))))))
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 <= -5e-7) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 2.1e+15) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 1.0 + log(pow(hypot(x_46_re, x_46_im), y_46_re));
}
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 tmp;
if (y_46_re <= -5e-7) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 2.1e+15) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 1.0 + Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
}
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 <= -5e-7: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_re <= 2.1e+15: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = 1.0 + math.log(math.pow(math.hypot(x_46_re, x_46_im), y_46_re)) 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 <= -5e-7) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 2.1e+15) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re))); 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 <= -5e-7) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 2.1e+15) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re)); 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, -5e-7], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.1e+15], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $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 -5 \cdot 10^{-7}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < -4.99999999999999977e-7Initial program 41.6%
cancel-sign-sub-inv41.6%
fma-define41.6%
hypot-define41.6%
distribute-lft-neg-in41.6%
distribute-rgt-neg-out41.6%
fma-define41.6%
hypot-define88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in y.im around 0 83.4%
unpow283.4%
unpow283.4%
hypot-undefine85.0%
Simplified85.0%
if -4.99999999999999977e-7 < y.re < 2.1e15Initial program 45.5%
cancel-sign-sub-inv45.5%
fma-define45.5%
hypot-define45.5%
distribute-lft-neg-in45.5%
distribute-rgt-neg-out45.5%
fma-define45.5%
hypot-define82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in y.re around 0 79.2%
neg-mul-179.2%
distribute-rgt-neg-in79.2%
Simplified79.2%
Taylor expanded in y.re around inf 31.7%
+-commutative34.7%
associate-/l*35.6%
unpow235.6%
unpow235.6%
hypot-undefine65.6%
Simplified61.8%
Taylor expanded in y.re around inf 77.3%
if 2.1e15 < y.re Initial program 21.3%
cancel-sign-sub-inv21.3%
fma-define21.3%
hypot-define21.3%
distribute-lft-neg-in21.3%
distribute-rgt-neg-out21.3%
fma-define21.3%
hypot-define57.3%
*-commutative57.3%
Simplified57.3%
Taylor expanded in y.im around 0 46.8%
unpow246.8%
unpow246.8%
hypot-undefine46.8%
Simplified46.8%
*-commutative46.8%
expm1-log1p-u26.8%
expm1-undefine29.4%
*-commutative29.4%
Applied egg-rr29.4%
expm1-define26.8%
Simplified26.8%
Taylor expanded in y.re around 0 35.2%
+-commutative35.2%
unpow235.2%
unpow235.2%
hypot-undefine3.6%
Simplified3.6%
*-commutative3.6%
add-log-exp56.3%
exp-to-pow56.3%
Applied egg-rr56.3%
Final simplification73.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 2.4e+16) (* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)) (+ 1.0 (log (pow (hypot x.re x.im) 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_re <= 2.4e+16) {
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 = 1.0 + log(pow(hypot(x_46_re, x_46_im), y_46_re));
}
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 <= 2.4e+16) {
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 = 1.0 + Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= 2.4e+16: 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 = 1.0 + math.log(math.pow(math.hypot(x_46_re, x_46_im), 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_re <= 2.4e+16) 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 = Float64(1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re))); 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 <= 2.4e+16) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 2.4e+16], 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[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 2.4 \cdot 10^{+16}:\\
\;\;\;\;\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}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < 2.4e16Initial program 44.2%
cancel-sign-sub-inv44.2%
fma-define44.2%
hypot-define44.2%
distribute-lft-neg-in44.2%
distribute-rgt-neg-out44.2%
fma-define44.2%
hypot-define84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in y.im around 0 52.0%
unpow252.0%
unpow252.0%
hypot-undefine60.2%
Simplified60.2%
if 2.4e16 < y.re Initial program 21.3%
cancel-sign-sub-inv21.3%
fma-define21.3%
hypot-define21.3%
distribute-lft-neg-in21.3%
distribute-rgt-neg-out21.3%
fma-define21.3%
hypot-define57.3%
*-commutative57.3%
Simplified57.3%
Taylor expanded in y.im around 0 46.8%
unpow246.8%
unpow246.8%
hypot-undefine46.8%
Simplified46.8%
*-commutative46.8%
expm1-log1p-u26.8%
expm1-undefine29.4%
*-commutative29.4%
Applied egg-rr29.4%
expm1-define26.8%
Simplified26.8%
Taylor expanded in y.re around 0 35.2%
+-commutative35.2%
unpow235.2%
unpow235.2%
hypot-undefine3.6%
Simplified3.6%
*-commutative3.6%
add-log-exp56.3%
exp-to-pow56.3%
Applied egg-rr56.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -24500000.0) (* (cos (* y.re (atan2 x.im x.re))) (pow x.re y.re)) (+ 1.0 (log (pow (hypot x.re x.im) 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_re <= -24500000.0) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_re, y_46_re);
} else {
tmp = 1.0 + log(pow(hypot(x_46_re, x_46_im), y_46_re));
}
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 <= -24500000.0) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_re, y_46_re);
} else {
tmp = 1.0 + Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -24500000.0: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_re, y_46_re) else: tmp = 1.0 + math.log(math.pow(math.hypot(x_46_re, x_46_im), 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_re <= -24500000.0) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_re ^ y_46_re)); else tmp = Float64(1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re))); 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 <= -24500000.0) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_re ^ y_46_re); else tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -24500000.0], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -24500000:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < -2.45e7Initial program 42.9%
cancel-sign-sub-inv42.9%
fma-define42.9%
hypot-define42.9%
distribute-lft-neg-in42.9%
distribute-rgt-neg-out42.9%
fma-define42.9%
hypot-define89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in y.im around 0 85.7%
unpow285.7%
unpow285.7%
hypot-undefine85.7%
Simplified85.7%
Taylor expanded in x.im around 0 64.6%
if -2.45e7 < y.re Initial program 36.0%
cancel-sign-sub-inv36.0%
fma-define36.0%
hypot-define36.0%
distribute-lft-neg-in36.0%
distribute-rgt-neg-out36.0%
fma-define36.0%
hypot-define73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y.im around 0 40.6%
unpow240.6%
unpow240.6%
hypot-undefine48.0%
Simplified48.0%
*-commutative48.0%
expm1-log1p-u39.5%
expm1-undefine40.5%
*-commutative40.5%
Applied egg-rr40.5%
expm1-define39.5%
Simplified39.5%
Taylor expanded in y.re around 0 32.6%
+-commutative32.6%
unpow232.6%
unpow232.6%
hypot-undefine28.6%
Simplified28.6%
*-commutative28.6%
add-log-exp48.9%
exp-to-pow48.9%
Applied egg-rr48.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -40000000000000.0) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (+ 1.0 (log (pow (hypot x.re x.im) 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_re <= -40000000000000.0) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + log(pow(hypot(x_46_re, x_46_im), y_46_re));
}
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 <= -40000000000000.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 = 1.0 + Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -40000000000000.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 = 1.0 + math.log(math.pow(math.hypot(x_46_re, x_46_im), 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_re <= -40000000000000.0) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = Float64(1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re))); 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 <= -40000000000000.0) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -40000000000000.0], 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[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -40000000000000:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < -4e13Initial 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-define89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y.im around 0 85.5%
unpow285.5%
unpow285.5%
hypot-undefine85.5%
Simplified85.5%
Taylor expanded in x.re around 0 51.5%
if -4e13 < y.re Initial program 35.8%
cancel-sign-sub-inv35.8%
fma-define35.8%
hypot-define35.8%
distribute-lft-neg-in35.8%
distribute-rgt-neg-out35.8%
fma-define35.8%
hypot-define73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in y.im around 0 40.9%
unpow240.9%
unpow240.9%
hypot-undefine48.2%
Simplified48.2%
*-commutative48.2%
expm1-log1p-u39.8%
expm1-undefine40.8%
*-commutative40.8%
Applied egg-rr40.8%
expm1-define39.8%
Simplified39.8%
Taylor expanded in y.re around 0 32.5%
+-commutative32.5%
unpow232.5%
unpow232.5%
hypot-undefine28.5%
Simplified28.5%
*-commutative28.5%
add-log-exp48.6%
exp-to-pow48.6%
Applied egg-rr48.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (log (pow (hypot x.re x.im) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + log(pow(hypot(x_46_re, x_46_im), y_46_re));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + math.log(math.pow(math.hypot(x_46_re, x_46_im), y_46_re))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)
\end{array}
Initial program 37.5%
cancel-sign-sub-inv37.5%
fma-define37.5%
hypot-define37.5%
distribute-lft-neg-in37.5%
distribute-rgt-neg-out37.5%
fma-define37.5%
hypot-define76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in y.im around 0 50.5%
unpow250.5%
unpow250.5%
hypot-undefine56.2%
Simplified56.2%
*-commutative56.2%
expm1-log1p-u43.3%
expm1-undefine44.1%
*-commutative44.1%
Applied egg-rr44.1%
expm1-define43.3%
Simplified43.3%
Taylor expanded in y.re around 0 25.9%
+-commutative25.9%
unpow225.9%
unpow225.9%
hypot-undefine22.9%
Simplified22.9%
*-commutative22.9%
add-log-exp40.4%
exp-to-pow40.4%
Applied egg-rr40.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 5e+119) (+ 1.0 (* y.re (log (hypot x.re x.im)))) (+ 1.0 (* y.re (log1p (+ (hypot x.re x.im) -1.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 5e+119) {
tmp = 1.0 + (y_46_re * log(hypot(x_46_re, x_46_im)));
} else {
tmp = 1.0 + (y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0)));
}
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_im <= 5e+119) {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_re, x_46_im)));
} else {
tmp = 1.0 + (y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= 5e+119: tmp = 1.0 + (y_46_re * math.log(math.hypot(x_46_re, x_46_im))) else: tmp = 1.0 + (y_46_re * math.log1p((math.hypot(x_46_re, x_46_im) + -1.0))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= 5e+119) tmp = Float64(1.0 + Float64(y_46_re * log(hypot(x_46_re, x_46_im)))); else tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, 5e+119], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 5 \cdot 10^{+119}:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right)\\
\end{array}
\end{array}
if y.im < 4.9999999999999999e119Initial program 37.6%
cancel-sign-sub-inv37.6%
fma-define37.6%
hypot-define37.6%
distribute-lft-neg-in37.6%
distribute-rgt-neg-out37.6%
fma-define37.6%
hypot-define78.1%
*-commutative78.1%
Simplified78.1%
Taylor expanded in y.im around 0 56.2%
unpow256.2%
unpow256.2%
hypot-undefine63.0%
Simplified63.0%
*-commutative63.0%
expm1-log1p-u47.4%
expm1-undefine47.9%
*-commutative47.9%
Applied egg-rr47.9%
expm1-define47.4%
Simplified47.4%
Taylor expanded in y.re around 0 28.7%
+-commutative28.7%
unpow228.7%
unpow228.7%
hypot-undefine26.4%
Simplified26.4%
if 4.9999999999999999e119 < y.im Initial program 36.9%
cancel-sign-sub-inv36.9%
fma-define36.9%
hypot-define36.9%
distribute-lft-neg-in36.9%
distribute-rgt-neg-out36.9%
fma-define36.9%
hypot-define68.5%
*-commutative68.5%
Simplified68.5%
Taylor expanded in y.im around 0 17.4%
unpow217.4%
unpow217.4%
hypot-undefine17.5%
Simplified17.5%
*-commutative17.5%
expm1-log1p-u20.0%
expm1-undefine22.7%
*-commutative22.7%
Applied egg-rr22.7%
expm1-define20.0%
Simplified20.0%
Taylor expanded in y.re around 0 10.2%
+-commutative10.2%
unpow210.2%
unpow210.2%
hypot-undefine2.8%
Simplified2.8%
log1p-expm1-u17.9%
expm1-undefine17.9%
add-exp-log17.9%
Applied egg-rr17.9%
Final simplification25.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (* y.re (log (hypot x.re x.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + (y_46_re * log(hypot(x_46_re, x_46_im)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + (y_46_re * Math.log(Math.hypot(x_46_re, x_46_im)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + (y_46_re * math.log(math.hypot(x_46_re, x_46_im)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + Float64(y_46_re * log(hypot(x_46_re, x_46_im)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + (y_46_re * log(hypot(x_46_re, x_46_im))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)
\end{array}
Initial program 37.5%
cancel-sign-sub-inv37.5%
fma-define37.5%
hypot-define37.5%
distribute-lft-neg-in37.5%
distribute-rgt-neg-out37.5%
fma-define37.5%
hypot-define76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in y.im around 0 50.5%
unpow250.5%
unpow250.5%
hypot-undefine56.2%
Simplified56.2%
*-commutative56.2%
expm1-log1p-u43.3%
expm1-undefine44.1%
*-commutative44.1%
Applied egg-rr44.1%
expm1-define43.3%
Simplified43.3%
Taylor expanded in y.re around 0 25.9%
+-commutative25.9%
unpow225.9%
unpow225.9%
hypot-undefine22.9%
Simplified22.9%
(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 37.5%
cancel-sign-sub-inv37.5%
fma-define37.5%
hypot-define37.5%
distribute-lft-neg-in37.5%
distribute-rgt-neg-out37.5%
fma-define37.5%
hypot-define76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in y.im around 0 50.5%
unpow250.5%
unpow250.5%
hypot-undefine56.2%
Simplified56.2%
Taylor expanded in y.re around 0 22.4%
herbie shell --seed 2024191
(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)))))