
(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 13 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 (log (hypot x.re x.im)))
(t_1
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos
(*
y.re
(+
(atan2 x.im x.re)
(* y.im (/ (log (hypot x.im x.re)) y.re))))))))
(if (<= y.re -2e-41)
t_1
(if (<= y.re 2.5e-55)
(*
(cos (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(/ 1.0 (exp (* (atan2 x.im x.re) y.im))))
(if (<= y.re 3.7e+201) t_1 (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 = log(hypot(x_46_re, x_46_im));
double t_1 = 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 * (log(hypot(x_46_im, x_46_re)) / y_46_re)))));
double tmp;
if (y_46_re <= -2e-41) {
tmp = t_1;
} else if (y_46_re <= 2.5e-55) {
tmp = cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * (1.0 / exp((atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 3.7e+201) {
tmp = t_1;
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = 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(log(hypot(x_46_im, x_46_re)) / y_46_re)))))) tmp = 0.0 if (y_46_re <= -2e-41) tmp = t_1; elseif (y_46_re <= 2.5e-55) tmp = Float64(cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * Float64(1.0 / exp(Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_re <= 3.7e+201) tmp = t_1; else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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[(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$re, -2e-41], t$95$1, If[LessEqual[y$46$re, 2.5e-55], 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[(1.0 / N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.7e+201], t$95$1, N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := 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{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.re}\right)\right)\\
\mathbf{if}\;y.re \leq -2 \cdot 10^{-41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-55}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \frac{1}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{+201}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.00000000000000001e-41 or 2.5000000000000001e-55 < y.re < 3.6999999999999999e201Initial program 34.7%
cancel-sign-sub-inv34.7%
fma-define34.7%
hypot-define34.7%
distribute-lft-neg-in34.7%
distribute-rgt-neg-out34.7%
fma-define34.7%
hypot-define77.3%
*-commutative77.3%
Simplified77.3%
Taylor expanded in y.re around inf 34.7%
+-commutative34.7%
associate-/l*37.3%
unpow237.3%
unpow237.3%
hypot-undefine82.2%
Simplified82.2%
if -2.00000000000000001e-41 < y.re < 2.5000000000000001e-55Initial program 33.7%
exp-diff33.7%
exp-to-pow33.7%
hypot-define33.7%
*-commutative33.7%
exp-prod33.7%
fma-define33.7%
hypot-define86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in y.re around 0 86.3%
if 3.6999999999999999e201 < y.re Initial 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-define55.6%
*-commutative55.6%
Simplified55.6%
Taylor expanded in y.im around 0 59.3%
unpow259.3%
unpow259.3%
hypot-undefine59.3%
Simplified59.3%
Taylor expanded in y.re around 0 77.8%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= y.re 8.5e-55)
(* t_1 (cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(if (<= y.re 2e+203)
(*
t_1
(cos
(*
y.re
(+ (atan2 x.im x.re) (* y.im (/ (log (hypot x.im x.re)) y.re))))))
(pow (hypot x.im x.re) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_re <= 8.5e-55) {
tmp = t_1 * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 2e+203) {
tmp = t_1 * 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 {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (y_46_re <= 8.5e-55) tmp = Float64(t_1 * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 2e+203) tmp = Float64(t_1 * 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)))))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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]}, If[LessEqual[y$46$re, 8.5e-55], N[(t$95$1 * 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], If[LessEqual[y$46$re, 2e+203], N[(t$95$1 * 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], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;y.re \leq 8.5 \cdot 10^{-55}:\\
\;\;\;\;t\_1 \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{+203}:\\
\;\;\;\;t\_1 \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{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < 8.49999999999999968e-55Initial program 33.2%
cancel-sign-sub-inv33.2%
fma-define33.2%
hypot-define33.2%
distribute-lft-neg-in33.2%
distribute-rgt-neg-out33.2%
fma-define33.2%
hypot-define84.8%
*-commutative84.8%
Simplified84.8%
if 8.49999999999999968e-55 < y.re < 2e203Initial program 38.0%
cancel-sign-sub-inv38.0%
fma-define38.0%
hypot-define38.0%
distribute-lft-neg-in38.0%
distribute-rgt-neg-out38.0%
fma-define38.0%
hypot-define70.3%
*-commutative70.3%
Simplified70.3%
Taylor expanded in y.re around inf 38.0%
+-commutative38.0%
associate-/l*42.0%
unpow242.0%
unpow242.0%
hypot-undefine80.0%
Simplified80.0%
if 2e203 < y.re Initial 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-define55.6%
*-commutative55.6%
Simplified55.6%
Taylor expanded in y.im around 0 59.3%
unpow259.3%
unpow259.3%
hypot-undefine59.3%
Simplified59.3%
Taylor expanded in y.re around 0 77.8%
Final simplification83.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)) (t_1 (* (atan2 x.im x.re) y.im)))
(if (<= y.re -1.15e+93)
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_1))
(if (<= y.re 3.5e+92)
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(cos
(*
y.im
(+ (log (hypot x.im x.re)) (* y.re (/ (atan2 x.im x.re) y.im))))))
(if (<= y.re 2e+215) (/ t_0 t_1) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (y_46_re <= -1.15e+93) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_1);
} else if (y_46_re <= 3.5e+92) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((y_46_im * (log(hypot(x_46_im, x_46_re)) + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
} else if (y_46_re <= 2e+215) {
tmp = t_0 / t_1;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (y_46_re <= -1.15e+93) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_1)); elseif (y_46_re <= 3.5e+92) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); elseif (y_46_re <= 2e+215) tmp = Float64(t_0 / t_1); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, -1.15e+93], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.5e+92], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2e+215], N[(t$95$0 / t$95$1), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.re \leq -1.15 \cdot 10^{+93}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_1}\\
\mathbf{elif}\;y.re \leq 3.5 \cdot 10^{+92}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{+215}:\\
\;\;\;\;\frac{t\_0}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.1500000000000001e93Initial program 30.6%
exp-diff16.3%
exp-to-pow16.3%
hypot-define16.3%
*-commutative16.3%
exp-prod16.3%
fma-define16.3%
hypot-define61.2%
*-commutative61.2%
Simplified61.2%
Taylor expanded in y.im around 0 79.7%
Taylor expanded in y.im around inf 26.6%
unpow226.6%
unpow226.6%
hypot-undefine75.6%
Simplified75.6%
Taylor expanded in y.im around 0 83.8%
if -1.1500000000000001e93 < y.re < 3.49999999999999986e92Initial program 35.1%
cancel-sign-sub-inv35.1%
fma-define35.1%
hypot-define35.1%
distribute-lft-neg-in35.1%
distribute-rgt-neg-out35.1%
fma-define35.1%
hypot-define83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in y.im around inf 35.1%
unpow235.1%
unpow235.1%
hypot-undefine83.5%
associate-/l*83.5%
Simplified83.5%
if 3.49999999999999986e92 < y.re < 1.99999999999999981e215Initial program 33.3%
exp-diff29.2%
exp-to-pow29.2%
hypot-define29.2%
*-commutative29.2%
exp-prod25.0%
fma-define25.0%
hypot-define45.8%
*-commutative45.8%
Simplified45.8%
Taylor expanded in y.im around 0 54.4%
Taylor expanded in y.im around inf 25.1%
unpow225.1%
unpow225.1%
hypot-undefine58.5%
Simplified58.5%
Taylor expanded in y.im around 0 58.5%
Taylor expanded in y.im around inf 71.0%
unpow271.0%
unpow271.0%
hypot-undefine71.0%
Simplified71.0%
if 1.99999999999999981e215 < y.re Initial program 48.0%
cancel-sign-sub-inv48.0%
fma-define48.0%
hypot-define48.0%
distribute-lft-neg-in48.0%
distribute-rgt-neg-out48.0%
fma-define48.0%
hypot-define60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in y.im around 0 64.0%
unpow264.0%
unpow264.0%
hypot-undefine64.0%
Simplified64.0%
Taylor expanded in y.re around 0 84.0%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (* (atan2 x.im x.re) y.im)))
(if (<= y.re -2.45e-41)
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_1))
(if (<= y.re 8e-28)
(* (cos (fma (log (hypot x.re x.im)) y.im t_0)) (/ 1.0 (exp t_1)))
(if (<= y.re 1.8e+121)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))
(cos t_0))
(pow (hypot x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (y_46_re <= -2.45e-41) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_1);
} else if (y_46_re <= 8e-28) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (1.0 / exp(t_1));
} else if (y_46_re <= 1.8e+121) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * cos(t_0);
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (y_46_re <= -2.45e-41) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_1)); elseif (y_46_re <= 8e-28) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * Float64(1.0 / exp(t_1))); elseif (y_46_re <= 1.8e+121) 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_1)) * cos(t_0)); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, -2.45e-41], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8e-28], 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[(1.0 / N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.8e+121], 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$1), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.re \leq -2.45 \cdot 10^{-41}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_1}\\
\mathbf{elif}\;y.re \leq 8 \cdot 10^{-28}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot \frac{1}{e^{t\_1}}\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{+121}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_1} \cdot \cos t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.44999999999999977e-41Initial program 32.4%
exp-diff20.6%
exp-to-pow20.6%
hypot-define20.6%
*-commutative20.6%
exp-prod20.6%
fma-define20.6%
hypot-define60.3%
*-commutative60.3%
Simplified60.3%
Taylor expanded in y.im around 0 76.7%
Taylor expanded in y.im around inf 29.5%
unpow229.5%
unpow229.5%
hypot-undefine73.8%
Simplified73.8%
Taylor expanded in y.im around 0 78.2%
if -2.44999999999999977e-41 < y.re < 7.99999999999999977e-28Initial program 33.4%
exp-diff33.4%
exp-to-pow33.4%
hypot-define33.4%
*-commutative33.4%
exp-prod33.4%
fma-define33.4%
hypot-define85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y.re around 0 85.8%
if 7.99999999999999977e-28 < y.re < 1.79999999999999991e121Initial program 42.9%
Taylor expanded in y.im around 0 75.3%
if 1.79999999999999991e121 < y.re Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in y.im around 0 53.9%
unpow253.9%
unpow253.9%
hypot-undefine53.9%
Simplified53.9%
Taylor expanded in y.re around 0 74.4%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= y.re -2.45e-41)
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_0))
(if (<= y.re 8e-28)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 5e+120)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(cos (* y.re (atan2 x.im x.re))))
(pow (hypot x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (y_46_re <= -2.45e-41) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0);
} else if (y_46_re <= 8e-28) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 5e+120) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = 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.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (y_46_re <= -2.45e-41) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0);
} else if (y_46_re <= 8e-28) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 5e+120) {
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_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = 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.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if y_46_re <= -2.45e-41: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0) elif y_46_re <= 8e-28: 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)) elif y_46_re <= 5e+120: 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_re * math.atan2(x_46_im, x_46_re))) else: tmp = 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 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (y_46_re <= -2.45e-41) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_0)); elseif (y_46_re <= 8e-28) 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)))); elseif (y_46_re <= 5e+120) 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_re * atan(x_46_im, x_46_re)))); else tmp = 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 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (y_46_re <= -2.45e-41) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + t_0); elseif (y_46_re <= 8e-28) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); elseif (y_46_re <= 5e+120) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re))); else tmp = 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, -2.45e-41], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8e-28], 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], If[LessEqual[y$46$re, 5e+120], 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$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]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.re \leq -2.45 \cdot 10^{-41}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_0}\\
\mathbf{elif}\;y.re \leq 8 \cdot 10^{-28}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{+120}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.44999999999999977e-41Initial program 32.4%
exp-diff20.6%
exp-to-pow20.6%
hypot-define20.6%
*-commutative20.6%
exp-prod20.6%
fma-define20.6%
hypot-define60.3%
*-commutative60.3%
Simplified60.3%
Taylor expanded in y.im around 0 76.7%
Taylor expanded in y.im around inf 29.5%
unpow229.5%
unpow229.5%
hypot-undefine73.8%
Simplified73.8%
Taylor expanded in y.im around 0 78.2%
if -2.44999999999999977e-41 < y.re < 7.99999999999999977e-28Initial program 33.4%
cancel-sign-sub-inv33.4%
fma-define33.4%
hypot-define33.4%
distribute-lft-neg-in33.4%
distribute-rgt-neg-out33.4%
fma-define33.4%
hypot-define85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in y.re around 0 33.4%
unpow233.4%
unpow233.4%
hypot-undefine85.8%
neg-mul-185.8%
distribute-lft-neg-in85.8%
Simplified85.8%
if 7.99999999999999977e-28 < y.re < 5.00000000000000019e120Initial program 42.9%
Taylor expanded in y.im around 0 75.3%
if 5.00000000000000019e120 < y.re Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in y.im around 0 53.9%
unpow253.9%
unpow253.9%
hypot-undefine53.9%
Simplified53.9%
Taylor expanded in y.re around 0 74.4%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -7.4e-13)
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im)))
(if (<= y.re 0.00036)
(exp (* (atan2 x.im x.re) (- y.im)))
(pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -7.4e-13) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im));
} else if (y_46_re <= 0.00036) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 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 tmp;
if (y_46_re <= -7.4e-13) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im));
} else if (y_46_re <= 0.00036) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 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): tmp = 0 if y_46_re <= -7.4e-13: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im)) elif y_46_re <= 0.00036: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = 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) tmp = 0.0 if (y_46_re <= -7.4e-13) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im))); elseif (y_46_re <= 0.00036) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = 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) tmp = 0.0; if (y_46_re <= -7.4e-13) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im)); elseif (y_46_re <= 0.00036) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = 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_] := If[LessEqual[y$46$re, -7.4e-13], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.00036], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -7.4 \cdot 10^{-13}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;y.re \leq 0.00036:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -7.39999999999999977e-13Initial program 32.3%
exp-diff20.0%
exp-to-pow20.0%
hypot-define20.0%
*-commutative20.0%
exp-prod20.0%
fma-define20.0%
hypot-define61.5%
*-commutative61.5%
Simplified61.5%
Taylor expanded in y.im around 0 78.7%
Taylor expanded in y.im around inf 29.3%
unpow229.3%
unpow229.3%
hypot-undefine75.6%
Simplified75.6%
Taylor expanded in y.im around 0 80.2%
if -7.39999999999999977e-13 < y.re < 3.60000000000000023e-4Initial program 34.1%
cancel-sign-sub-inv34.1%
fma-define34.1%
hypot-define34.1%
distribute-lft-neg-in34.1%
distribute-rgt-neg-out34.1%
fma-define34.1%
hypot-define83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in y.re around 0 34.0%
unpow234.0%
unpow234.0%
hypot-undefine82.9%
neg-mul-182.9%
distribute-lft-neg-in82.9%
Simplified82.9%
Taylor expanded in y.im around 0 83.2%
if 3.60000000000000023e-4 < y.re Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define63.9%
*-commutative63.9%
Simplified63.9%
Taylor expanded in y.im around 0 60.8%
unpow260.8%
unpow260.8%
hypot-undefine62.4%
Simplified62.4%
Taylor expanded in y.re around 0 69.0%
Final simplification79.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -0.00082)
(pow (+ x.re (* 0.5 (/ (* x.im x.im) x.re))) y.re)
(if (<= y.re 0.00036)
(exp (* (atan2 x.im x.re) (- y.im)))
(pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -0.00082) {
tmp = pow((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))), y_46_re);
} else if (y_46_re <= 0.00036) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 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 tmp;
if (y_46_re <= -0.00082) {
tmp = Math.pow((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))), y_46_re);
} else if (y_46_re <= 0.00036) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 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): tmp = 0 if y_46_re <= -0.00082: tmp = math.pow((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))), y_46_re) elif y_46_re <= 0.00036: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = 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) tmp = 0.0 if (y_46_re <= -0.00082) tmp = Float64(x_46_re + Float64(0.5 * Float64(Float64(x_46_im * x_46_im) / x_46_re))) ^ y_46_re; elseif (y_46_re <= 0.00036) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = 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) tmp = 0.0; if (y_46_re <= -0.00082) tmp = (x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))) ^ y_46_re; elseif (y_46_re <= 0.00036) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = 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_] := If[LessEqual[y$46$re, -0.00082], N[Power[N[(x$46$re + N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 0.00036], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00082:\\
\;\;\;\;{\left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 0.00036:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -8.1999999999999998e-4Initial program 32.3%
cancel-sign-sub-inv32.3%
fma-define32.3%
hypot-define32.3%
distribute-lft-neg-in32.3%
distribute-rgt-neg-out32.3%
fma-define32.3%
hypot-define84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in y.im around 0 74.1%
unpow274.1%
unpow274.1%
hypot-undefine75.6%
Simplified75.6%
Taylor expanded in y.re around 0 74.0%
Taylor expanded in x.im around 0 74.1%
unpow274.1%
Applied egg-rr74.1%
if -8.1999999999999998e-4 < y.re < 3.60000000000000023e-4Initial program 34.1%
cancel-sign-sub-inv34.1%
fma-define34.1%
hypot-define34.1%
distribute-lft-neg-in34.1%
distribute-rgt-neg-out34.1%
fma-define34.1%
hypot-define83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in y.re around 0 34.0%
unpow234.0%
unpow234.0%
hypot-undefine82.9%
neg-mul-182.9%
distribute-lft-neg-in82.9%
Simplified82.9%
Taylor expanded in y.im around 0 83.2%
if 3.60000000000000023e-4 < y.re Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define63.9%
*-commutative63.9%
Simplified63.9%
Taylor expanded in y.im around 0 60.8%
unpow260.8%
unpow260.8%
hypot-undefine62.4%
Simplified62.4%
Taylor expanded in y.re around 0 69.0%
Final simplification77.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -790.0) (pow (+ x.re (* 0.5 (/ (* x.im x.im) x.re))) y.re) (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -790.0) {
tmp = pow((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))), y_46_re);
} else {
tmp = 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 tmp;
if (y_46_im <= -790.0) {
tmp = Math.pow((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))), y_46_re);
} else {
tmp = 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): tmp = 0 if y_46_im <= -790.0: tmp = math.pow((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))), y_46_re) else: tmp = 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) tmp = 0.0 if (y_46_im <= -790.0) tmp = Float64(x_46_re + Float64(0.5 * Float64(Float64(x_46_im * x_46_im) / x_46_re))) ^ y_46_re; else tmp = 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) tmp = 0.0; if (y_46_im <= -790.0) tmp = (x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))) ^ y_46_re; else tmp = 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_] := If[LessEqual[y$46$im, -790.0], N[Power[N[(x$46$re + N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -790:\\
\;\;\;\;{\left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -790Initial program 33.1%
cancel-sign-sub-inv33.1%
fma-define33.1%
hypot-define33.1%
distribute-lft-neg-in33.1%
distribute-rgt-neg-out33.1%
fma-define33.1%
hypot-define74.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in y.im around 0 38.4%
unpow238.4%
unpow238.4%
hypot-undefine28.4%
Simplified28.4%
Taylor expanded in y.re around 0 29.9%
Taylor expanded in x.im around 0 36.9%
unpow236.9%
Applied egg-rr36.9%
if -790 < y.im 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-define80.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in y.im around 0 55.5%
unpow255.5%
unpow255.5%
hypot-undefine69.9%
Simplified69.9%
Taylor expanded in y.re around 0 70.9%
Final simplification62.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.5e-54) (not (<= y.re 6.2e-16))) (pow (+ x.re (* 0.5 (/ (* x.im x.im) x.re))) y.re) (/ 1.0 (+ 1.0 (* (atan2 x.im x.re) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.5e-54) || !(y_46_re <= 6.2e-16)) {
tmp = pow((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))), y_46_re);
} else {
tmp = 1.0 / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-3.5d-54)) .or. (.not. (y_46re <= 6.2d-16))) then
tmp = (x_46re + (0.5d0 * ((x_46im * x_46im) / x_46re))) ** y_46re
else
tmp = 1.0d0 / (1.0d0 + (atan2(x_46im, x_46re) * y_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.5e-54) || !(y_46_re <= 6.2e-16)) {
tmp = Math.pow((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))), y_46_re);
} else {
tmp = 1.0 / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -3.5e-54) or not (y_46_re <= 6.2e-16): tmp = math.pow((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))), y_46_re) else: tmp = 1.0 / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -3.5e-54) || !(y_46_re <= 6.2e-16)) tmp = Float64(x_46_re + Float64(0.5 * Float64(Float64(x_46_im * x_46_im) / x_46_re))) ^ y_46_re; else tmp = Float64(1.0 / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -3.5e-54) || ~((y_46_re <= 6.2e-16))) tmp = (x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))) ^ y_46_re; else tmp = 1.0 / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3.5e-54], N[Not[LessEqual[y$46$re, 6.2e-16]], $MachinePrecision]], N[Power[N[(x$46$re + N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision], N[(1.0 / N[(1.0 + 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 -3.5 \cdot 10^{-54} \lor \neg \left(y.re \leq 6.2 \cdot 10^{-16}\right):\\
\;\;\;\;{\left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if y.re < -3.49999999999999982e-54 or 6.2000000000000002e-16 < y.re Initial program 36.6%
cancel-sign-sub-inv36.6%
fma-define36.6%
hypot-define36.6%
distribute-lft-neg-in36.6%
distribute-rgt-neg-out36.6%
fma-define36.6%
hypot-define73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in y.im around 0 66.0%
unpow266.0%
unpow266.0%
hypot-undefine66.8%
Simplified66.8%
Taylor expanded in y.re around 0 69.0%
Taylor expanded in x.im around 0 67.6%
unpow267.6%
Applied egg-rr67.6%
if -3.49999999999999982e-54 < y.re < 6.2000000000000002e-16Initial program 33.9%
exp-diff33.9%
exp-to-pow33.9%
hypot-define33.9%
*-commutative33.9%
exp-prod33.9%
fma-define33.9%
hypot-define84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in y.im around 0 53.6%
Taylor expanded in y.im around inf 25.2%
unpow225.2%
unpow225.2%
hypot-undefine53.6%
Simplified53.6%
Taylor expanded in y.im around 0 52.4%
Taylor expanded in y.re around 0 52.4%
Final simplification60.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -2.1e+16) (pow (- x.re) y.re) (if (<= x.re 0.78) (pow x.im y.re) (pow x.re y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -2.1e+16) {
tmp = pow(-x_46_re, y_46_re);
} else if (x_46_re <= 0.78) {
tmp = pow(x_46_im, y_46_re);
} else {
tmp = pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46re <= (-2.1d+16)) then
tmp = -x_46re ** y_46re
else if (x_46re <= 0.78d0) then
tmp = x_46im ** y_46re
else
tmp = x_46re ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -2.1e+16) {
tmp = Math.pow(-x_46_re, y_46_re);
} else if (x_46_re <= 0.78) {
tmp = Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -2.1e+16: tmp = math.pow(-x_46_re, y_46_re) elif x_46_re <= 0.78: tmp = math.pow(x_46_im, y_46_re) else: tmp = math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -2.1e+16) tmp = Float64(-x_46_re) ^ y_46_re; elseif (x_46_re <= 0.78) tmp = x_46_im ^ y_46_re; else tmp = 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) tmp = 0.0; if (x_46_re <= -2.1e+16) tmp = -x_46_re ^ y_46_re; elseif (x_46_re <= 0.78) tmp = x_46_im ^ y_46_re; else tmp = x_46_re ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -2.1e+16], N[Power[(-x$46$re), y$46$re], $MachinePrecision], If[LessEqual[x$46$re, 0.78], N[Power[x$46$im, y$46$re], $MachinePrecision], N[Power[x$46$re, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2.1 \cdot 10^{+16}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 0.78:\\
\;\;\;\;{x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -2.1e16Initial program 32.7%
cancel-sign-sub-inv32.7%
fma-define32.7%
hypot-define32.7%
distribute-lft-neg-in32.7%
distribute-rgt-neg-out32.7%
fma-define32.7%
hypot-define89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in y.im around 0 55.1%
unpow255.1%
unpow255.1%
hypot-undefine61.1%
Simplified61.1%
Taylor expanded in y.re around 0 63.1%
Taylor expanded in x.re around -inf 63.1%
mul-1-neg63.1%
Simplified63.1%
if -2.1e16 < x.re < 0.78000000000000003Initial program 40.9%
cancel-sign-sub-inv40.9%
fma-define40.9%
hypot-define40.9%
distribute-lft-neg-in40.9%
distribute-rgt-neg-out40.9%
fma-define40.9%
hypot-define74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in y.im around 0 49.4%
unpow249.4%
unpow249.4%
hypot-undefine53.1%
Simplified53.1%
Taylor expanded in y.re around 0 55.4%
Taylor expanded in x.re around 0 48.4%
if 0.78000000000000003 < x.re Initial program 27.2%
cancel-sign-sub-inv27.2%
fma-define27.2%
hypot-define27.2%
distribute-lft-neg-in27.2%
distribute-rgt-neg-out27.2%
fma-define27.2%
hypot-define80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in y.im around 0 51.9%
unpow251.9%
unpow251.9%
hypot-undefine69.6%
Simplified69.6%
Taylor expanded in y.re around 0 68.3%
Taylor expanded in x.im around 0 68.3%
Final simplification57.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -2.05e-52) (pow (- x.im) y.re) (if (<= x.im 0.85) (pow x.re y.re) (pow 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 (x_46_im <= -2.05e-52) {
tmp = pow(-x_46_im, y_46_re);
} else if (x_46_im <= 0.85) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46im <= (-2.05d-52)) then
tmp = -x_46im ** y_46re
else if (x_46im <= 0.85d0) then
tmp = x_46re ** y_46re
else
tmp = x_46im ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -2.05e-52) {
tmp = Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 0.85) {
tmp = Math.pow(x_46_re, y_46_re);
} else {
tmp = Math.pow(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 x_46_im <= -2.05e-52: tmp = math.pow(-x_46_im, y_46_re) elif x_46_im <= 0.85: tmp = math.pow(x_46_re, y_46_re) else: tmp = math.pow(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 (x_46_im <= -2.05e-52) tmp = Float64(-x_46_im) ^ y_46_re; elseif (x_46_im <= 0.85) tmp = x_46_re ^ y_46_re; else tmp = 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 (x_46_im <= -2.05e-52) tmp = -x_46_im ^ y_46_re; elseif (x_46_im <= 0.85) tmp = x_46_re ^ y_46_re; else tmp = 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[x$46$im, -2.05e-52], N[Power[(-x$46$im), y$46$re], $MachinePrecision], If[LessEqual[x$46$im, 0.85], N[Power[x$46$re, y$46$re], $MachinePrecision], N[Power[x$46$im, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2.05 \cdot 10^{-52}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 0.85:\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -2.04999999999999994e-52Initial program 22.1%
cancel-sign-sub-inv22.1%
fma-define22.1%
hypot-define22.1%
distribute-lft-neg-in22.1%
distribute-rgt-neg-out22.1%
fma-define22.1%
hypot-define75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in y.im around 0 48.6%
unpow248.6%
unpow248.6%
hypot-undefine56.3%
Simplified56.3%
Taylor expanded in y.re around 0 61.4%
Taylor expanded in x.im around -inf 58.9%
mul-1-neg58.9%
Simplified58.9%
if -2.04999999999999994e-52 < x.im < 0.849999999999999978Initial program 52.1%
cancel-sign-sub-inv52.1%
fma-define52.1%
hypot-define52.1%
distribute-lft-neg-in52.1%
distribute-rgt-neg-out52.1%
fma-define52.1%
hypot-define79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in y.im around 0 54.9%
unpow254.9%
unpow254.9%
hypot-undefine60.5%
Simplified60.5%
Taylor expanded in y.re around 0 59.7%
Taylor expanded in x.im around 0 50.2%
if 0.849999999999999978 < x.im Initial program 21.5%
cancel-sign-sub-inv21.5%
fma-define21.5%
hypot-define21.5%
distribute-lft-neg-in21.5%
distribute-rgt-neg-out21.5%
fma-define21.5%
hypot-define81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y.im around 0 47.9%
unpow247.9%
unpow247.9%
hypot-undefine61.5%
Simplified61.5%
Taylor expanded in y.re around 0 61.5%
Taylor expanded in x.re around 0 61.5%
Final simplification55.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re 0.29) (pow x.im y.re) (pow x.re y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 0.29) {
tmp = pow(x_46_im, y_46_re);
} else {
tmp = pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46re <= 0.29d0) then
tmp = x_46im ** y_46re
else
tmp = x_46re ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 0.29) {
tmp = Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= 0.29: tmp = math.pow(x_46_im, y_46_re) else: tmp = math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= 0.29) tmp = x_46_im ^ y_46_re; else tmp = 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) tmp = 0.0; if (x_46_re <= 0.29) tmp = x_46_im ^ y_46_re; else tmp = x_46_re ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, 0.29], N[Power[x$46$im, y$46$re], $MachinePrecision], N[Power[x$46$re, y$46$re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 0.29:\\
\;\;\;\;{x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < 0.28999999999999998Initial program 38.7%
cancel-sign-sub-inv38.7%
fma-define38.7%
hypot-define38.7%
distribute-lft-neg-in38.7%
distribute-rgt-neg-out38.7%
fma-define38.7%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in y.im around 0 51.0%
unpow251.0%
unpow251.0%
hypot-undefine55.3%
Simplified55.3%
Taylor expanded in y.re around 0 57.5%
Taylor expanded in x.re around 0 44.0%
if 0.28999999999999998 < x.re Initial program 27.2%
cancel-sign-sub-inv27.2%
fma-define27.2%
hypot-define27.2%
distribute-lft-neg-in27.2%
distribute-rgt-neg-out27.2%
fma-define27.2%
hypot-define80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in y.im around 0 51.9%
unpow251.9%
unpow251.9%
hypot-undefine69.6%
Simplified69.6%
Taylor expanded in y.re around 0 68.3%
Taylor expanded in x.im around 0 68.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow x.im y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(x_46_im, 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
code = x_46im ** y_46re
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(x_46_im, y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(x_46_im, y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return x_46_im ^ y_46_re end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im ^ y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[x$46$im, y$46$re], $MachinePrecision]
\begin{array}{l}
\\
{x.im}^{y.re}
\end{array}
Initial program 35.3%
cancel-sign-sub-inv35.3%
fma-define35.3%
hypot-define35.3%
distribute-lft-neg-in35.3%
distribute-rgt-neg-out35.3%
fma-define35.3%
hypot-define78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in y.im around 0 51.2%
unpow251.2%
unpow251.2%
hypot-undefine59.5%
Simplified59.5%
Taylor expanded in y.re around 0 60.7%
Taylor expanded in x.re around 0 39.8%
herbie shell --seed 2024123
(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)))))