
(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 15 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.re))
(t_1 (log (hypot x.re x.im)))
(t_2 (* y.im (- (atan2 x.im x.re))))
(t_3 (exp (fma t_1 y.re t_2)))
(t_4 (cos t_0)))
(if (<= y.im -4.3e+70)
(* (exp t_2) t_4)
(if (<= y.im -5e-35)
(*
t_3
(cos
(*
y.re
(+ (atan2 x.im x.re) (* y.im (/ (log (hypot x.im x.re)) y.re))))))
(if (<= y.im 4.5e-18)
(fabs (* t_4 (pow (hypot x.im x.re) y.re)))
(* t_3 (cos (fma t_1 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 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = y_46_im * -atan2(x_46_im, x_46_re);
double t_3 = exp(fma(t_1, y_46_re, t_2));
double t_4 = cos(t_0);
double tmp;
if (y_46_im <= -4.3e+70) {
tmp = exp(t_2) * t_4;
} else if (y_46_im <= -5e-35) {
tmp = t_3 * cos((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (log(hypot(x_46_im, x_46_re)) / y_46_re)))));
} else if (y_46_im <= 4.5e-18) {
tmp = fabs((t_4 * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else {
tmp = t_3 * cos(fma(t_1, y_46_im, t_0));
}
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_re) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))) t_3 = exp(fma(t_1, y_46_re, t_2)) t_4 = cos(t_0) tmp = 0.0 if (y_46_im <= -4.3e+70) tmp = Float64(exp(t_2) * t_4); elseif (y_46_im <= -5e-35) tmp = Float64(t_3 * cos(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) / y_46_re)))))); elseif (y_46_im <= 4.5e-18) tmp = abs(Float64(t_4 * (hypot(x_46_im, x_46_re) ^ y_46_re))); else tmp = Float64(t_3 * cos(fma(t_1, 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(t$95$1 * y$46$re + t$95$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$im, -4.3e+70], N[(N[Exp[t$95$2], $MachinePrecision] * t$95$4), $MachinePrecision], If[LessEqual[y$46$im, -5e-35], N[(t$95$3 * N[Cos[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.5e-18], N[Abs[N[(t$95$4 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$3 * N[Cos[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_3 := e^{\mathsf{fma}\left(t\_1, y.re, t\_2\right)}\\
t_4 := \cos t\_0\\
\mathbf{if}\;y.im \leq -4.3 \cdot 10^{+70}:\\
\;\;\;\;e^{t\_2} \cdot t\_4\\
\mathbf{elif}\;y.im \leq -5 \cdot 10^{-35}:\\
\;\;\;\;t\_3 \cdot \cos \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.re}\right)\right)\\
\mathbf{elif}\;y.im \leq 4.5 \cdot 10^{-18}:\\
\;\;\;\;\left|t\_4 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \cos \left(\mathsf{fma}\left(t\_1, y.im, t\_0\right)\right)\\
\end{array}
\end{array}
if y.im < -4.3000000000000001e70Initial program 40.8%
Taylor expanded in y.im around 0 77.7%
Taylor expanded in y.re around 0 79.7%
mul-1-neg79.7%
distribute-rgt-neg-out79.7%
Simplified79.7%
if -4.3000000000000001e70 < y.im < -4.99999999999999964e-35Initial program 49.9%
cancel-sign-sub-inv49.9%
fma-define49.9%
hypot-define49.9%
distribute-lft-neg-in49.9%
distribute-rgt-neg-out49.9%
fma-define49.9%
hypot-define86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in y.re around inf 49.9%
+-commutative49.9%
associate-/l*49.9%
unpow249.9%
unpow249.9%
hypot-undefine90.8%
Simplified90.8%
if -4.99999999999999964e-35 < y.im < 4.49999999999999994e-18Initial program 48.8%
cancel-sign-sub-inv48.8%
fma-define48.8%
hypot-define48.8%
distribute-lft-neg-in48.8%
distribute-rgt-neg-out48.8%
fma-define48.8%
hypot-define88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in y.im around 0 69.1%
unpow269.1%
unpow269.1%
hypot-undefine88.2%
Simplified88.2%
add-cbrt-cube88.2%
pow1/394.4%
pow394.4%
hypot-undefine75.4%
+-commutative75.4%
hypot-define94.4%
Applied egg-rr94.4%
unpow1/388.2%
rem-cbrt-cube88.2%
add-sqr-sqrt85.8%
sqrt-unprod94.5%
pow294.5%
Applied egg-rr94.5%
unpow294.5%
rem-sqrt-square94.5%
hypot-undefine75.4%
unpow275.4%
unpow275.4%
+-commutative75.4%
unpow275.4%
unpow275.4%
hypot-define94.5%
Simplified94.5%
if 4.49999999999999994e-18 < y.im Initial program 48.6%
cancel-sign-sub-inv48.6%
fma-define48.6%
hypot-define48.6%
distribute-lft-neg-in48.6%
distribute-rgt-neg-out48.6%
fma-define48.6%
hypot-define76.2%
*-commutative76.2%
Simplified76.2%
Final simplification87.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (- (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 t_0))
(cos (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_1 y.re))))))))
(if (<= y.re -1.45e-18)
t_2
(if (<= y.re 3.95e-87)
(* (exp t_0) (cos (* (atan2 x.im x.re) y.re)))
(if (<= y.re 2.55e+82)
t_2
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
(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_im * -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, t_0)) * 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 <= -1.45e-18) {
tmp = t_2;
} else if (y_46_re <= 3.95e-87) {
tmp = exp(t_0) * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 2.55e+82) {
tmp = t_2;
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * 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_im * Float64(-atan(x_46_im, x_46_re))) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, t_0)) * 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 <= -1.45e-18) tmp = t_2; elseif (y_46_re <= 3.95e-87) tmp = Float64(exp(t_0) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 2.55e+82) 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(y_46_im * atan(x_46_im, x_46_re)))) * 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$im * (-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[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + t$95$0), $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, -1.45e-18], t$95$2, If[LessEqual[y$46$re, 3.95e-87], N[(N[Exp[t$95$0], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.55e+82], 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\\
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, t\_0\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 -1.45 \cdot 10^{-18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 3.95 \cdot 10^{-87}:\\
\;\;\;\;e^{t\_0} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 2.55 \cdot 10^{+82}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(y.im \cdot t\_1\right)\\
\end{array}
\end{array}
if y.re < -1.45e-18 or 3.95000000000000016e-87 < y.re < 2.5500000000000001e82Initial program 47.5%
cancel-sign-sub-inv47.5%
fma-define47.5%
hypot-define47.5%
distribute-lft-neg-in47.5%
distribute-rgt-neg-out47.5%
fma-define47.5%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.re around inf 48.4%
+-commutative48.4%
associate-/l*48.4%
unpow248.4%
unpow248.4%
hypot-undefine83.4%
Simplified83.4%
if -1.45e-18 < y.re < 3.95000000000000016e-87Initial program 51.6%
Taylor expanded in y.im around 0 62.9%
Taylor expanded in y.re around 0 91.2%
mul-1-neg91.2%
distribute-rgt-neg-out91.2%
Simplified91.2%
if 2.5500000000000001e82 < y.re Initial program 37.8%
Taylor expanded in y.re around 0 42.2%
*-commutative42.2%
unpow242.2%
unpow242.2%
hypot-undefine80.0%
Simplified80.0%
Final simplification85.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))))
(if (<= y.re -5.1e+14)
(* (cos (* (atan2 x.im x.re) y.re)) t_1)
(if (<= y.re 800000000000.0)
(*
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))
(cos (* y.im (+ t_0 (* y.re (/ (atan2 x.im x.re) y.im))))))
(* t_1 (cos (* 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 = log(hypot(x_46_im, x_46_re));
double t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -5.1e+14) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_1;
} else if (y_46_re <= 800000000000.0) {
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_im * (t_0 + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
} else {
tmp = t_1 * cos((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.log(Math.hypot(x_46_im, x_46_re));
double t_1 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -5.1e+14) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * t_1;
} else if (y_46_re <= 800000000000.0) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re))) * Math.cos((y_46_im * (t_0 + (y_46_re * (Math.atan2(x_46_im, x_46_re) / y_46_im)))));
} else {
tmp = t_1 * Math.cos((y_46_im * t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_im, x_46_re)) t_1 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -5.1e+14: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_1 elif y_46_re <= 800000000000.0: tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) * math.cos((y_46_im * (t_0 + (y_46_re * (math.atan2(x_46_im, x_46_re) / y_46_im))))) else: tmp = t_1 * math.cos((y_46_im * t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -5.1e+14) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * t_1); elseif (y_46_re <= 800000000000.0) 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_im * Float64(t_0 + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); else tmp = Float64(t_1 * cos(Float64(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 = log(hypot(x_46_im, x_46_re)); t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -5.1e+14) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_1; elseif (y_46_re <= 800000000000.0) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re))) * cos((y_46_im * (t_0 + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im))))); else tmp = t_1 * cos((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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -5.1e+14], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 800000000000.0], 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$im * N[(t$95$0 + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Cos[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -5.1 \cdot 10^{+14}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 800000000000:\\
\;\;\;\;\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.im \cdot \left(t\_0 + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \cos \left(y.im \cdot t\_0\right)\\
\end{array}
\end{array}
if y.re < -5.1e14Initial program 46.0%
Taylor expanded in y.im around 0 81.1%
if -5.1e14 < y.re < 8e11Initial program 50.1%
exp-diff50.1%
exp-to-pow50.1%
hypot-define50.1%
*-commutative50.1%
exp-prod50.1%
fma-define50.1%
hypot-define87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in y.im around inf 50.1%
unpow250.1%
unpow250.1%
hypot-undefine87.3%
associate-/l*87.3%
Simplified87.3%
if 8e11 < y.re Initial program 42.6%
Taylor expanded in y.re around 0 47.5%
*-commutative47.5%
unpow247.5%
unpow247.5%
hypot-undefine78.7%
Simplified78.7%
Final simplification83.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (atan2 x.im x.re))) (t_1 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.im -55000000.0)
(* (exp (* y.im t_0)) t_1)
(if (<= y.im 0.0034)
(fabs (* t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.im 2e+115)
(*
t_1
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))
(* (cos (* y.im (log (hypot x.im x.re)))) (pow (exp 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 = -atan2(x_46_im, x_46_re);
double t_1 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= -55000000.0) {
tmp = exp((y_46_im * t_0)) * t_1;
} else if (y_46_im <= 0.0034) {
tmp = fabs((t_1 * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else if (y_46_im <= 2e+115) {
tmp = t_1 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(exp(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.atan2(x_46_im, x_46_re);
double t_1 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= -55000000.0) {
tmp = Math.exp((y_46_im * t_0)) * t_1;
} else if (y_46_im <= 0.0034) {
tmp = Math.abs((t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)));
} else if (y_46_im <= 2e+115) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.pow(Math.exp(y_46_im), t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = -math.atan2(x_46_im, x_46_re) t_1 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_im <= -55000000.0: tmp = math.exp((y_46_im * t_0)) * t_1 elif y_46_im <= 0.0034: tmp = math.fabs((t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re))) elif y_46_im <= 2e+115: tmp = t_1 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.pow(math.exp(y_46_im), t_0) 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)) t_1 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_im <= -55000000.0) tmp = Float64(exp(Float64(y_46_im * t_0)) * t_1); elseif (y_46_im <= 0.0034) tmp = abs(Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re))); elseif (y_46_im <= 2e+115) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re))))); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (exp(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 = -atan2(x_46_im, x_46_re); t_1 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_im <= -55000000.0) tmp = exp((y_46_im * t_0)) * t_1; elseif (y_46_im <= 0.0034) tmp = abs((t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re))); elseif (y_46_im <= 2e+115) tmp = t_1 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * (exp(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[ArcTan[x$46$im / x$46$re], $MachinePrecision])}, Block[{t$95$1 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -55000000.0], N[(N[Exp[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 0.0034], N[Abs[N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$im, 2e+115], N[(t$95$1 * 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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[Power[N[Exp[y$46$im], $MachinePrecision], t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.im \leq -55000000:\\
\;\;\;\;e^{y.im \cdot t\_0} \cdot t\_1\\
\mathbf{elif}\;y.im \leq 0.0034:\\
\;\;\;\;\left|t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right|\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{+115}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(e^{y.im}\right)}^{t\_0}\\
\end{array}
\end{array}
if y.im < -5.5e7Initial program 39.3%
Taylor expanded in y.im around 0 72.3%
Taylor expanded in y.re around 0 75.6%
mul-1-neg75.6%
distribute-rgt-neg-out75.6%
Simplified75.6%
if -5.5e7 < y.im < 0.00339999999999999981Initial program 50.7%
cancel-sign-sub-inv50.7%
fma-define50.7%
hypot-define50.7%
distribute-lft-neg-in50.7%
distribute-rgt-neg-out50.7%
fma-define50.7%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.im around 0 70.1%
unpow270.1%
unpow270.1%
hypot-undefine87.6%
Simplified87.6%
add-cbrt-cube87.6%
pow1/393.3%
pow393.3%
hypot-undefine75.8%
+-commutative75.8%
hypot-define93.3%
Applied egg-rr93.3%
unpow1/387.6%
rem-cbrt-cube87.6%
add-sqr-sqrt84.7%
sqrt-unprod93.3%
pow293.3%
Applied egg-rr93.3%
unpow293.3%
rem-sqrt-square93.3%
hypot-undefine75.9%
unpow275.9%
unpow275.9%
+-commutative75.9%
unpow275.9%
unpow275.9%
hypot-define93.3%
Simplified93.3%
if 0.00339999999999999981 < y.im < 2e115Initial program 55.1%
Taylor expanded in y.im around 0 71.2%
if 2e115 < y.im Initial program 43.4%
cancel-sign-sub-inv43.4%
fma-define43.4%
hypot-define43.4%
distribute-lft-neg-in43.4%
distribute-rgt-neg-out43.4%
fma-define43.4%
hypot-define74.8%
*-commutative74.8%
Simplified74.8%
Taylor expanded in y.re around 0 40.5%
*-commutative40.5%
unpow240.5%
unpow240.5%
hypot-undefine74.9%
neg-mul-174.9%
distribute-rgt-neg-in74.9%
mul-1-neg74.9%
exp-prod74.9%
mul-1-neg74.9%
Simplified74.9%
Final simplification84.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* y.im (- (atan2 x.im x.re)))))
(t_1 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.im -61000000.0)
(* t_0 t_1)
(if (<= y.im 7.6e-5)
(fabs (* t_1 (pow (hypot x.im x.re) y.re)))
(* 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 = exp((y_46_im * -atan2(x_46_im, x_46_re)));
double t_1 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= -61000000.0) {
tmp = t_0 * t_1;
} else if (y_46_im <= 7.6e-5) {
tmp = fabs((t_1 * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else {
tmp = t_0 * cos((y_46_im * log(hypot(x_46_im, x_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.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= -61000000.0) {
tmp = t_0 * t_1;
} else if (y_46_im <= 7.6e-5) {
tmp = Math.abs((t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)));
} else {
tmp = t_0 * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) t_1 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_im <= -61000000.0: tmp = t_0 * t_1 elif y_46_im <= 7.6e-5: tmp = math.fabs((t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re))) else: tmp = t_0 * math.cos((y_46_im * math.log(math.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 = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) t_1 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_im <= -61000000.0) tmp = Float64(t_0 * t_1); elseif (y_46_im <= 7.6e-5) tmp = abs(Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re))); else tmp = Float64(t_0 * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((y_46_im * -atan2(x_46_im, x_46_re))); t_1 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_im <= -61000000.0) tmp = t_0 * t_1; elseif (y_46_im <= 7.6e-5) tmp = abs((t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re))); else tmp = t_0 * cos((y_46_im * log(hypot(x_46_im, x_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[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -61000000.0], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 7.6e-5], N[Abs[N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(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]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_1 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.im \leq -61000000:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.im \leq 7.6 \cdot 10^{-5}:\\
\;\;\;\;\left|t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right|\\
\mathbf{else}:\\
\;\;\;\;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.im < -6.1e7Initial program 39.3%
Taylor expanded in y.im around 0 72.3%
Taylor expanded in y.re around 0 75.6%
mul-1-neg75.6%
distribute-rgt-neg-out75.6%
Simplified75.6%
if -6.1e7 < y.im < 7.6000000000000004e-5Initial program 51.0%
cancel-sign-sub-inv51.0%
fma-define51.0%
hypot-define51.0%
distribute-lft-neg-in51.0%
distribute-rgt-neg-out51.0%
fma-define51.0%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.im around 0 70.6%
unpow270.6%
unpow270.6%
hypot-undefine88.1%
Simplified88.1%
add-cbrt-cube88.0%
pow1/393.8%
pow393.8%
hypot-undefine76.3%
+-commutative76.3%
hypot-define93.8%
Applied egg-rr93.8%
unpow1/388.0%
rem-cbrt-cube88.1%
add-sqr-sqrt85.2%
sqrt-unprod93.8%
pow293.8%
Applied egg-rr93.8%
unpow293.8%
rem-sqrt-square93.8%
hypot-undefine76.4%
unpow276.4%
unpow276.4%
+-commutative76.4%
unpow276.4%
unpow276.4%
hypot-define93.8%
Simplified93.8%
if 7.6000000000000004e-5 < y.im Initial program 46.8%
cancel-sign-sub-inv46.8%
fma-define46.8%
hypot-define46.8%
distribute-lft-neg-in46.8%
distribute-rgt-neg-out46.8%
fma-define46.8%
hypot-define75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in y.re around 0 36.2%
*-commutative36.2%
unpow236.2%
unpow236.2%
hypot-undefine64.9%
neg-mul-164.9%
distribute-rgt-neg-in64.9%
Simplified64.9%
Final simplification83.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (or (<= y.im -57000000.0) (not (<= y.im 1650.0)))
(* (exp (* y.im (- (atan2 x.im x.re)))) t_0)
(fabs (* 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 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_im <= -57000000.0) || !(y_46_im <= 1650.0)) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = fabs((t_0 * pow(hypot(x_46_im, x_46_re), 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((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_im <= -57000000.0) || !(y_46_im <= 1650.0)) {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = Math.abs((t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if (y_46_im <= -57000000.0) or not (y_46_im <= 1650.0): tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) * t_0 else: tmp = math.fabs((t_0 * math.pow(math.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 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if ((y_46_im <= -57000000.0) || !(y_46_im <= 1650.0)) tmp = Float64(exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) * t_0); else tmp = abs(Float64(t_0 * (hypot(x_46_im, x_46_re) ^ 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((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if ((y_46_im <= -57000000.0) || ~((y_46_im <= 1650.0))) tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * t_0; else tmp = abs((t_0 * (hypot(x_46_im, x_46_re) ^ 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -57000000.0], N[Not[LessEqual[y$46$im, 1650.0]], $MachinePrecision]], N[(N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[Abs[N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.im \leq -57000000 \lor \neg \left(y.im \leq 1650\right):\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right|\\
\end{array}
\end{array}
if y.im < -5.7e7 or 1650 < y.im Initial program 43.3%
Taylor expanded in y.im around 0 67.0%
Taylor expanded in y.re around 0 69.5%
mul-1-neg69.5%
distribute-rgt-neg-out69.5%
Simplified69.5%
if -5.7e7 < y.im < 1650Initial program 50.7%
cancel-sign-sub-inv50.7%
fma-define50.7%
hypot-define50.7%
distribute-lft-neg-in50.7%
distribute-rgt-neg-out50.7%
fma-define50.7%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.im around 0 70.1%
unpow270.1%
unpow270.1%
hypot-undefine87.6%
Simplified87.6%
add-cbrt-cube87.6%
pow1/393.3%
pow393.3%
hypot-undefine75.8%
+-commutative75.8%
hypot-define93.3%
Applied egg-rr93.3%
unpow1/387.6%
rem-cbrt-cube87.6%
add-sqr-sqrt84.7%
sqrt-unprod93.3%
pow293.3%
Applied egg-rr93.3%
unpow293.3%
rem-sqrt-square93.3%
hypot-undefine75.9%
unpow275.9%
unpow275.9%
+-commutative75.9%
unpow275.9%
unpow275.9%
hypot-define93.3%
Simplified93.3%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (or (<= y.im -55000000.0) (not (<= y.im 1.06e+75)))
(* (exp (* y.im (- (atan2 x.im x.re)))) t_0)
(* 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 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_im <= -55000000.0) || !(y_46_im <= 1.06e+75)) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), 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((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_im <= -55000000.0) || !(y_46_im <= 1.06e+75)) {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if (y_46_im <= -55000000.0) or not (y_46_im <= 1.06e+75): tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) * t_0 else: tmp = t_0 * math.pow(math.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 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if ((y_46_im <= -55000000.0) || !(y_46_im <= 1.06e+75)) tmp = Float64(exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) * t_0); else tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ 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((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if ((y_46_im <= -55000000.0) || ~((y_46_im <= 1.06e+75))) tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * t_0; else tmp = t_0 * (hypot(x_46_im, x_46_re) ^ 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -55000000.0], N[Not[LessEqual[y$46$im, 1.06e+75]], $MachinePrecision]], N[(N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * 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 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.im \leq -55000000 \lor \neg \left(y.im \leq 1.06 \cdot 10^{+75}\right):\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -5.5e7 or 1.06e75 < y.im Initial program 42.1%
Taylor expanded in y.im around 0 66.4%
Taylor expanded in y.re around 0 71.0%
mul-1-neg71.0%
distribute-rgt-neg-out71.0%
Simplified71.0%
if -5.5e7 < y.im < 1.06e75Initial program 51.0%
cancel-sign-sub-inv51.0%
fma-define51.0%
hypot-define51.0%
distribute-lft-neg-in51.0%
distribute-rgt-neg-out51.0%
fma-define51.0%
hypot-define87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in y.im around 0 69.1%
unpow269.1%
unpow269.1%
hypot-undefine85.3%
Simplified85.3%
Final simplification79.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 1.25e+116) (* (cos (* (atan2 x.im x.re) y.re)) (pow (hypot x.im x.re) y.re)) (* (exp (* y.im (- (atan2 x.im x.re)))) (cos (* y.im (log x.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 1.25e+116) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * cos((y_46_im * log(x_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_im <= 1.25e+116) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))) * Math.cos((y_46_im * Math.log(x_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= 1.25e+116: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) * math.cos((y_46_im * math.log(x_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= 1.25e+116) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) * cos(Float64(y_46_im * log(x_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_im <= 1.25e+116) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * cos((y_46_im * log(x_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, 1.25e+116], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 1.25 \cdot 10^{+116}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \cos \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if y.im < 1.25000000000000006e116Initial program 48.2%
cancel-sign-sub-inv48.2%
fma-define48.2%
hypot-define48.2%
distribute-lft-neg-in48.2%
distribute-rgt-neg-out48.2%
fma-define48.2%
hypot-define82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in y.im around 0 59.2%
unpow259.2%
unpow259.2%
hypot-undefine68.0%
Simplified68.0%
if 1.25000000000000006e116 < y.im Initial 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-define74.1%
*-commutative74.1%
Simplified74.1%
Taylor expanded in y.re around inf 35.8%
+-commutative35.8%
associate-/l*38.7%
unpow238.7%
unpow238.7%
hypot-undefine53.4%
Simplified53.4%
Taylor expanded in x.re around 0 32.4%
+-commutative32.4%
associate-/l*32.4%
Simplified32.4%
Taylor expanded in y.re around 0 32.4%
neg-mul-132.4%
distribute-rgt-neg-in32.4%
Simplified32.4%
Taylor expanded in y.re around 0 52.9%
*-commutative52.9%
Simplified52.9%
Final simplification66.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= y.im 2.9e+134)
(* (cos t_0) (pow (hypot x.im x.re) y.re))
(* -0.5 (* (pow t_0 2.0) (pow 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 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_im <= 2.9e+134) {
tmp = cos(t_0) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = -0.5 * (pow(t_0, 2.0) * pow(x_46_re, 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.atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_im <= 2.9e+134) {
tmp = Math.cos(t_0) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = -0.5 * (Math.pow(t_0, 2.0) * Math.pow(x_46_re, y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re tmp = 0 if y_46_im <= 2.9e+134: tmp = math.cos(t_0) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = -0.5 * (math.pow(t_0, 2.0) * math.pow(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(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_im <= 2.9e+134) tmp = Float64(cos(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(-0.5 * Float64((t_0 ^ 2.0) * (x_46_re ^ 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 = atan2(x_46_im, x_46_re) * y_46_re; tmp = 0.0; if (y_46_im <= 2.9e+134) tmp = cos(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = -0.5 * ((t_0 ^ 2.0) * (x_46_re ^ 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$im, 2.9e+134], N[(N[Cos[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.im \leq 2.9 \cdot 10^{+134}:\\
\;\;\;\;\cos t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left({t\_0}^{2} \cdot {x.re}^{y.re}\right)\\
\end{array}
\end{array}
if y.im < 2.90000000000000012e134Initial program 47.9%
cancel-sign-sub-inv47.9%
fma-define47.9%
hypot-define47.9%
distribute-lft-neg-in47.9%
distribute-rgt-neg-out47.9%
fma-define47.9%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in y.im around 0 58.6%
unpow258.6%
unpow258.6%
hypot-undefine66.8%
Simplified66.8%
if 2.90000000000000012e134 < y.im Initial 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-define75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in y.im around 0 26.2%
unpow226.2%
unpow226.2%
hypot-undefine19.4%
Simplified19.4%
Taylor expanded in y.re around 0 19.4%
*-commutative19.4%
Simplified19.4%
Taylor expanded in y.re around inf 36.3%
Taylor expanded in x.im around 0 47.0%
associate-*r*47.0%
unpow247.0%
unpow247.0%
swap-sqr47.0%
unpow247.0%
Simplified47.0%
Final simplification64.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))) (t_1 (* t_0 (pow x.im y.re))))
(if (<= y.re -2.15e-10)
t_1
(if (<= y.re 0.055)
(+ 1.0 (* y.re (log (hypot x.re x.im))))
(if (<= y.re 3.8e+89) t_1 (* t_0 (pow 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 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = t_0 * pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -2.15e-10) {
tmp = t_1;
} else if (y_46_re <= 0.055) {
tmp = 1.0 + (y_46_re * log(hypot(x_46_re, x_46_im)));
} else if (y_46_re <= 3.8e+89) {
tmp = t_1;
} else {
tmp = t_0 * pow(x_46_re, 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((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = t_0 * Math.pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -2.15e-10) {
tmp = t_1;
} else if (y_46_re <= 0.055) {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_re, x_46_im)));
} else if (y_46_re <= 3.8e+89) {
tmp = t_1;
} else {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) t_1 = t_0 * math.pow(x_46_im, y_46_re) tmp = 0 if y_46_re <= -2.15e-10: tmp = t_1 elif y_46_re <= 0.055: tmp = 1.0 + (y_46_re * math.log(math.hypot(x_46_re, x_46_im))) elif y_46_re <= 3.8e+89: tmp = t_1 else: tmp = t_0 * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_1 = Float64(t_0 * (x_46_im ^ y_46_re)) tmp = 0.0 if (y_46_re <= -2.15e-10) tmp = t_1; elseif (y_46_re <= 0.055) tmp = Float64(1.0 + Float64(y_46_re * log(hypot(x_46_re, x_46_im)))); elseif (y_46_re <= 3.8e+89) tmp = t_1; else tmp = Float64(t_0 * (x_46_re ^ 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((atan2(x_46_im, x_46_re) * y_46_re)); t_1 = t_0 * (x_46_im ^ y_46_re); tmp = 0.0; if (y_46_re <= -2.15e-10) tmp = t_1; elseif (y_46_re <= 0.055) tmp = 1.0 + (y_46_re * log(hypot(x_46_re, x_46_im))); elseif (y_46_re <= 3.8e+89) tmp = t_1; else tmp = t_0 * (x_46_re ^ 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.15e-10], t$95$1, If[LessEqual[y$46$re, 0.055], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.8e+89], t$95$1, N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := t\_0 \cdot {x.im}^{y.re}\\
\mathbf{if}\;y.re \leq -2.15 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 0.055:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{elif}\;y.re \leq 3.8 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.15000000000000007e-10 or 0.0550000000000000003 < y.re < 3.80000000000000023e89Initial program 46.8%
cancel-sign-sub-inv46.8%
fma-define46.8%
hypot-define46.8%
distribute-lft-neg-in46.8%
distribute-rgt-neg-out46.8%
fma-define46.8%
hypot-define79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in y.im around 0 71.6%
unpow271.6%
unpow271.6%
hypot-undefine72.6%
Simplified72.6%
Taylor expanded in x.re around 0 59.0%
if -2.15000000000000007e-10 < y.re < 0.0550000000000000003Initial program 50.6%
cancel-sign-sub-inv50.6%
fma-define50.6%
hypot-define50.6%
distribute-lft-neg-in50.6%
distribute-rgt-neg-out50.6%
fma-define50.6%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.im around 0 40.8%
unpow240.8%
unpow240.8%
hypot-undefine54.1%
Simplified54.1%
Taylor expanded in y.re around 0 39.7%
+-commutative39.7%
unpow239.7%
unpow239.7%
hypot-undefine53.8%
Simplified53.8%
if 3.80000000000000023e89 < y.re Initial program 39.5%
cancel-sign-sub-inv39.5%
fma-define39.5%
hypot-define39.5%
distribute-lft-neg-in39.5%
distribute-rgt-neg-out39.5%
fma-define39.5%
hypot-define67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in y.im around 0 58.3%
unpow258.3%
unpow258.3%
hypot-undefine58.3%
Simplified58.3%
Taylor expanded in x.im around 0 58.5%
Final simplification56.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.15e-10) (not (<= y.re 0.095))) (* (cos (* (atan2 x.im x.re) y.re)) (pow x.im y.re)) (+ 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) {
double tmp;
if ((y_46_re <= -2.15e-10) || !(y_46_re <= 0.095)) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + (y_46_re * log(hypot(x_46_re, x_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 <= -2.15e-10) || !(y_46_re <= 0.095)) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_re, x_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -2.15e-10) or not (y_46_re <= 0.095): tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.pow(x_46_im, y_46_re) else: tmp = 1.0 + (y_46_re * math.log(math.hypot(x_46_re, x_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 <= -2.15e-10) || !(y_46_re <= 0.095)) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (x_46_im ^ y_46_re)); else tmp = Float64(1.0 + Float64(y_46_re * log(hypot(x_46_re, x_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 <= -2.15e-10) || ~((y_46_re <= 0.095))) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * (x_46_im ^ y_46_re); else tmp = 1.0 + (y_46_re * log(hypot(x_46_re, x_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, -2.15e-10], N[Not[LessEqual[y$46$re, 0.095]], $MachinePrecision]], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.15 \cdot 10^{-10} \lor \neg \left(y.re \leq 0.095\right):\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\end{array}
\end{array}
if y.re < -2.15000000000000007e-10 or 0.095000000000000001 < y.re Initial program 44.5%
cancel-sign-sub-inv44.5%
fma-define44.5%
hypot-define44.5%
distribute-lft-neg-in44.5%
distribute-rgt-neg-out44.5%
fma-define44.5%
hypot-define75.9%
*-commutative75.9%
Simplified75.9%
Taylor expanded in y.im around 0 67.4%
unpow267.4%
unpow267.4%
hypot-undefine68.1%
Simplified68.1%
Taylor expanded in x.re around 0 53.8%
if -2.15000000000000007e-10 < y.re < 0.095000000000000001Initial program 50.6%
cancel-sign-sub-inv50.6%
fma-define50.6%
hypot-define50.6%
distribute-lft-neg-in50.6%
distribute-rgt-neg-out50.6%
fma-define50.6%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.im around 0 40.8%
unpow240.8%
unpow240.8%
hypot-undefine54.1%
Simplified54.1%
Taylor expanded in y.re around 0 39.7%
+-commutative39.7%
unpow239.7%
unpow239.7%
hypot-undefine53.8%
Simplified53.8%
Final simplification53.8%
(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 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-define80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in y.im around 0 55.0%
unpow255.0%
unpow255.0%
hypot-undefine61.6%
Simplified61.6%
Taylor expanded in y.re around 0 26.4%
+-commutative26.4%
unpow226.4%
unpow226.4%
hypot-undefine26.7%
Simplified26.7%
*-commutative26.7%
hypot-undefine26.4%
unpow226.4%
unpow226.4%
+-commutative26.4%
unpow226.4%
unpow226.4%
hypot-undefine26.7%
add-log-exp39.5%
pow-to-exp39.5%
Applied egg-rr39.5%
hypot-undefine32.6%
unpow232.6%
unpow232.6%
+-commutative32.6%
unpow232.6%
unpow232.6%
hypot-undefine39.5%
Simplified39.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -1.8e+43) (+ 1.0 (* y.re (log1p (+ (hypot x.re x.im) -1.0)))) (+ 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) {
double tmp;
if (y_46_re <= -1.8e+43) {
tmp = 1.0 + (y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0)));
} else {
tmp = 1.0 + (y_46_re * log(hypot(x_46_re, x_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.8e+43) {
tmp = 1.0 + (y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0)));
} else {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_re, x_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.8e+43: tmp = 1.0 + (y_46_re * math.log1p((math.hypot(x_46_re, x_46_im) + -1.0))) else: tmp = 1.0 + (y_46_re * math.log(math.hypot(x_46_re, x_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.8e+43) tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0)))); else tmp = Float64(1.0 + Float64(y_46_re * log(hypot(x_46_re, x_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.8e+43], 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], 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}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{+43}:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\end{array}
\end{array}
if y.re < -1.80000000000000005e43Initial program 46.4%
cancel-sign-sub-inv46.4%
fma-define46.4%
hypot-define46.4%
distribute-lft-neg-in46.4%
distribute-rgt-neg-out46.4%
fma-define46.4%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.im around 0 75.2%
unpow275.2%
unpow275.2%
hypot-undefine75.2%
Simplified75.2%
Taylor expanded in y.re around 0 7.1%
+-commutative7.1%
unpow27.1%
unpow27.1%
hypot-undefine2.1%
Simplified2.1%
hypot-define7.1%
+-commutative7.1%
hypot-undefine2.1%
log1p-expm1-u14.0%
expm1-undefine14.0%
add-exp-log14.0%
hypot-undefine13.9%
+-commutative13.9%
hypot-define14.0%
Applied egg-rr14.0%
if -1.80000000000000005e43 < y.re Initial program 47.6%
cancel-sign-sub-inv47.6%
fma-define47.6%
hypot-define47.6%
distribute-lft-neg-in47.6%
distribute-rgt-neg-out47.6%
fma-define47.6%
hypot-define81.1%
*-commutative81.1%
Simplified81.1%
Taylor expanded in y.im around 0 49.4%
unpow249.4%
unpow249.4%
hypot-undefine57.8%
Simplified57.8%
Taylor expanded in y.re around 0 31.8%
+-commutative31.8%
unpow231.8%
unpow231.8%
hypot-undefine33.6%
Simplified33.6%
Final simplification29.3%
(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 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-define80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in y.im around 0 55.0%
unpow255.0%
unpow255.0%
hypot-undefine61.6%
Simplified61.6%
Taylor expanded in y.re around 0 26.4%
+-commutative26.4%
unpow226.4%
unpow226.4%
hypot-undefine26.7%
Simplified26.7%
(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 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-define80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in y.im around 0 55.0%
unpow255.0%
unpow255.0%
hypot-undefine61.6%
Simplified61.6%
Taylor expanded in y.re around 0 26.3%
herbie shell --seed 2024147
(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)))))