
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1)))
(t_3 (+ 1.0 t_1)))
(if (<= y.re -5e-14)
(/ (pow (hypot x.re x.im) y.re) t_3)
(if (<= y.re 3.6e-33)
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 1e+46)
(* (+ 1.0 (* -0.5 (pow t_0 2.0))) t_2)
(if (<= y.re 2.45e+209)
t_2
(if (<= y.re 5e+283)
(* (/ (pow x.im y.re) t_3) (cos t_0))
(*
(cos (* y.im (log (hypot 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
double t_3 = 1.0 + t_1;
double tmp;
if (y_46_re <= -5e-14) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / t_3;
} else if (y_46_re <= 3.6e-33) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1e+46) {
tmp = (1.0 + (-0.5 * pow(t_0, 2.0))) * t_2;
} else if (y_46_re <= 2.45e+209) {
tmp = t_2;
} else if (y_46_re <= 5e+283) {
tmp = (pow(x_46_im, y_46_re) / t_3) * cos(t_0);
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) 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) t_2 = 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)) t_3 = Float64(1.0 + t_1) tmp = 0.0 if (y_46_re <= -5e-14) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / t_3); elseif (y_46_re <= 3.6e-33) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 1e+46) tmp = Float64(Float64(1.0 + Float64(-0.5 * (t_0 ^ 2.0))) * t_2); elseif (y_46_re <= 2.45e+209) tmp = t_2; elseif (y_46_re <= 5e+283) tmp = Float64(Float64((x_46_im ^ y_46_re) / t_3) * cos(t_0)); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(1.0 + t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -5e-14], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 3.6e-33], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1e+46], N[(N[(1.0 + N[(-0.5 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 2.45e+209], t$95$2, If[LessEqual[y$46$re, 5e+283], N[(N[(N[Power[x$46$im, y$46$re], $MachinePrecision] / t$95$3), $MachinePrecision] * N[Cos[t$95$0], $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[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_1}\\
t_3 := 1 + t\_1\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t\_3}\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{-33}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 10^{+46}:\\
\;\;\;\;\left(1 + -0.5 \cdot {t\_0}^{2}\right) \cdot t\_2\\
\mathbf{elif}\;y.re \leq 2.45 \cdot 10^{+209}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{+283}:\\
\;\;\;\;\frac{{x.im}^{y.re}}{t\_3} \cdot \cos t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14Initial program 39.4%
exp-diff35.2%
exp-to-pow35.2%
hypot-define35.2%
*-commutative35.2%
exp-prod35.2%
fma-define35.2%
hypot-define73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y.re around inf 35.2%
+-commutative35.2%
associate-/l*35.2%
unpow235.2%
unpow235.2%
hypot-undefine73.2%
Simplified73.2%
Taylor expanded in y.im around 0 73.2%
Taylor expanded in y.im around 0 83.2%
Taylor expanded in y.re around 0 84.6%
if -5.0000000000000002e-14 < y.re < 3.60000000000000034e-33Initial program 40.4%
exp-diff40.4%
exp-to-pow40.4%
hypot-define40.4%
*-commutative40.4%
exp-prod40.1%
fma-define40.1%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in y.re around 0 82.0%
rec-exp82.0%
distribute-rgt-neg-in82.0%
Simplified82.0%
if 3.60000000000000034e-33 < y.re < 9.9999999999999999e45Initial program 53.4%
Taylor expanded in y.im around 0 67.9%
Taylor expanded in y.re around 0 81.3%
unpow281.3%
unpow281.3%
swap-sqr81.3%
unpow281.3%
Simplified81.3%
if 9.9999999999999999e45 < y.re < 2.4499999999999999e209Initial program 40.6%
Taylor expanded in y.im around 0 59.4%
Taylor expanded in y.re around 0 87.5%
if 2.4499999999999999e209 < y.re < 5.0000000000000004e283Initial program 60.0%
exp-diff46.7%
exp-to-pow46.7%
hypot-define46.7%
*-commutative46.7%
exp-prod46.7%
fma-define46.7%
hypot-define46.7%
*-commutative46.7%
Simplified46.7%
Taylor expanded in y.re around inf 46.7%
+-commutative46.7%
associate-/l*46.7%
unpow246.7%
unpow246.7%
hypot-undefine46.7%
Simplified46.7%
Taylor expanded in y.im around 0 46.7%
Taylor expanded in y.im around 0 80.1%
Taylor expanded in x.re around 0 86.9%
if 5.0000000000000004e283 < y.re Initial program 25.0%
exp-diff25.0%
exp-to-pow25.0%
hypot-define25.0%
*-commutative25.0%
exp-prod25.0%
fma-define25.0%
hypot-define37.5%
*-commutative37.5%
Simplified37.5%
Taylor expanded in y.re around inf 25.0%
+-commutative25.0%
associate-/l*25.0%
unpow225.0%
unpow225.0%
hypot-undefine37.5%
Simplified37.5%
Taylor expanded in y.re around 0 25.0%
unpow225.0%
unpow225.0%
hypot-undefine37.5%
Simplified37.5%
Taylor expanded in y.im around 0 75.0%
unpow275.0%
unpow275.0%
hypot-undefine75.0%
Simplified75.0%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))) (t_1 (log (hypot x.re x.im))))
(if (<= y.re -3.2e-85)
(*
(exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_0 y.re))))))
(if (<= y.re 1.2e+14)
(*
(cos (fma t_1 y.im (* y.re (atan2 x.im x.re))))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re))))
(*
(cos (* y.im t_0))
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -3.2e-85) {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re)))));
} else if (y_46_re <= 1.2e+14) {
tmp = cos(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = cos((y_46_im * t_0)) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
}
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 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -3.2e-85) tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(t_0 / y_46_re)))))); elseif (y_46_re <= 1.2e+14) tmp = Float64(cos(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); else tmp = Float64(cos(Float64(y_46_im * t_0)) * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.2e-85], N[(N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(t$95$0 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.2e+14], N[(N[Cos[N[(t$95$1 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -3.2 \cdot 10^{-85}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{t\_0}{y.re}\right)\right)\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{+14}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t\_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot t\_0\right) \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if y.re < -3.20000000000000027e-85Initial program 40.0%
fmm-def40.0%
hypot-define40.0%
distribute-rgt-neg-out40.0%
fma-define40.0%
hypot-define85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in y.re around inf 40.0%
+-commutative36.3%
associate-/l*36.3%
unpow236.3%
unpow236.3%
hypot-undefine72.8%
Simplified85.8%
if -3.20000000000000027e-85 < y.re < 1.2e14Initial program 41.2%
exp-diff40.4%
exp-to-pow40.4%
hypot-define40.4%
*-commutative40.4%
exp-prod40.1%
fma-define40.1%
hypot-define80.5%
*-commutative80.5%
Simplified80.5%
if 1.2e14 < y.re Initial program 44.3%
Taylor expanded in y.re around 0 49.2%
unpow249.2%
unpow249.2%
hypot-undefine77.1%
Simplified77.1%
Final simplification81.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= x.im 3e+260)
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(/ (pow (hypot x.re x.im) y.re) (+ 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 t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if (x_46_im <= 3e+260) {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (x_46_im <= 3e+260) tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, 3e+260], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[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]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;x.im \leq 3 \cdot 10^{+260}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if x.im < 2.9999999999999998e260Initial program 43.6%
fmm-def43.6%
hypot-define43.6%
distribute-rgt-neg-out43.6%
fma-define44.0%
hypot-define80.9%
*-commutative80.9%
Simplified80.9%
if 2.9999999999999998e260 < x.im Initial program 0.0%
exp-diff0.0%
exp-to-pow0.0%
hypot-define0.0%
*-commutative0.0%
exp-prod0.0%
fma-define0.0%
hypot-define50.0%
*-commutative50.0%
Simplified50.0%
Taylor expanded in y.re around inf 0.0%
+-commutative0.0%
associate-/l*0.0%
unpow20.0%
unpow20.0%
hypot-undefine50.0%
Simplified50.0%
Taylor expanded in y.im around 0 50.0%
Taylor expanded in y.im around 0 50.3%
Taylor expanded in y.re around 0 83.7%
Final simplification81.0%
(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))
(t_2 (log (hypot x.re x.im)))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1)))
(t_4 (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re -1.02e-110)
(*
(exp (fma t_2 y.re t_4))
(cos
(*
y.re
(+ (atan2 x.im x.re) (* y.im (/ (log (hypot x.im x.re)) y.re))))))
(if (<= y.re 3.6e-33)
(* (cos (fma t_2 y.im t_0)) (exp t_4))
(if (<= y.re 1e+48)
(* (+ 1.0 (* -0.5 (pow t_0 2.0))) t_3)
(if (<= y.re 2.45e+209)
t_3
(* (/ (pow x.im y.re) (+ 1.0 t_1)) (cos t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = log(hypot(x_46_re, x_46_im));
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
double t_4 = atan2(x_46_im, x_46_re) * -y_46_im;
double tmp;
if (y_46_re <= -1.02e-110) {
tmp = exp(fma(t_2, y_46_re, t_4)) * 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_re <= 3.6e-33) {
tmp = cos(fma(t_2, y_46_im, t_0)) * exp(t_4);
} else if (y_46_re <= 1e+48) {
tmp = (1.0 + (-0.5 * pow(t_0, 2.0))) * t_3;
} else if (y_46_re <= 2.45e+209) {
tmp = t_3;
} else {
tmp = (pow(x_46_im, y_46_re) / (1.0 + t_1)) * cos(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = log(hypot(x_46_re, x_46_im)) t_3 = 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)) t_4 = Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) tmp = 0.0 if (y_46_re <= -1.02e-110) tmp = Float64(exp(fma(t_2, y_46_re, t_4)) * 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_re <= 3.6e-33) tmp = Float64(cos(fma(t_2, y_46_im, t_0)) * exp(t_4)); elseif (y_46_re <= 1e+48) tmp = Float64(Float64(1.0 + Float64(-0.5 * (t_0 ^ 2.0))) * t_3); elseif (y_46_re <= 2.45e+209) tmp = t_3; else tmp = Float64(Float64((x_46_im ^ y_46_re) / Float64(1.0 + t_1)) * cos(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = 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]}, Block[{t$95$4 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$re, -1.02e-110], N[(N[Exp[N[(t$95$2 * y$46$re + t$95$4), $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, 3.6e-33], N[(N[Cos[N[(t$95$2 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[t$95$4], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1e+48], N[(N[(1.0 + N[(-0.5 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 2.45e+209], t$95$3, N[(N[(N[Power[x$46$im, y$46$re], $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $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\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_1}\\
t_4 := \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\\
\mathbf{if}\;y.re \leq -1.02 \cdot 10^{-110}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_2, y.re, t\_4\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{elif}\;y.re \leq 3.6 \cdot 10^{-33}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t\_2, y.im, t\_0\right)\right) \cdot e^{t\_4}\\
\mathbf{elif}\;y.re \leq 10^{+48}:\\
\;\;\;\;\left(1 + -0.5 \cdot {t\_0}^{2}\right) \cdot t\_3\\
\mathbf{elif}\;y.re \leq 2.45 \cdot 10^{+209}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{{x.im}^{y.re}}{1 + t\_1} \cdot \cos t\_0\\
\end{array}
\end{array}
if y.re < -1.02000000000000006e-110Initial program 37.6%
fmm-def37.6%
hypot-define37.6%
distribute-rgt-neg-out37.6%
fma-define37.6%
hypot-define85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in y.re around inf 37.6%
+-commutative34.1%
associate-/l*34.1%
unpow234.1%
unpow234.1%
hypot-undefine73.5%
Simplified85.7%
if -1.02000000000000006e-110 < y.re < 3.60000000000000034e-33Initial program 42.0%
exp-diff42.0%
exp-to-pow42.0%
hypot-define42.0%
*-commutative42.0%
exp-prod41.7%
fma-define41.7%
hypot-define82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in y.re around 0 82.8%
rec-exp82.8%
distribute-rgt-neg-in82.8%
Simplified82.8%
if 3.60000000000000034e-33 < y.re < 1.00000000000000004e48Initial program 53.4%
Taylor expanded in y.im around 0 67.9%
Taylor expanded in y.re around 0 81.3%
unpow281.3%
unpow281.3%
swap-sqr81.3%
unpow281.3%
Simplified81.3%
if 1.00000000000000004e48 < y.re < 2.4499999999999999e209Initial program 40.6%
Taylor expanded in y.im around 0 59.4%
Taylor expanded in y.re around 0 87.5%
if 2.4499999999999999e209 < y.re Initial program 47.8%
exp-diff39.1%
exp-to-pow39.1%
hypot-define39.1%
*-commutative39.1%
exp-prod39.1%
fma-define39.1%
hypot-define43.5%
*-commutative43.5%
Simplified43.5%
Taylor expanded in y.re around inf 39.1%
+-commutative39.1%
associate-/l*39.1%
unpow239.1%
unpow239.1%
hypot-undefine43.5%
Simplified43.5%
Taylor expanded in y.im around 0 43.5%
Taylor expanded in y.im around 0 65.3%
Taylor expanded in x.re around 0 69.7%
Final simplification83.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (* (atan2 x.im x.re) y.im))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2))))
(if (<= y.re -5e-14)
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_2))
(if (<= y.re 3.6e-33)
(*
(cos (fma (log (hypot x.re x.im)) y.im t_1))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 1.2e+46)
(* (+ 1.0 (* -0.5 (pow t_1 2.0))) t_3)
(if (<= y.re 1.55e+156)
(exp (* y.re t_0))
(* (cos (* y.im t_0)) t_3)))))))
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 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double tmp;
if (y_46_re <= -5e-14) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_2);
} else if (y_46_re <= 3.6e-33) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1.2e+46) {
tmp = (1.0 + (-0.5 * pow(t_1, 2.0))) * t_3;
} else if (y_46_re <= 1.55e+156) {
tmp = exp((y_46_re * t_0));
} else {
tmp = cos((y_46_im * t_0)) * t_3;
}
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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_2)) tmp = 0.0 if (y_46_re <= -5e-14) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_2)); elseif (y_46_re <= 3.6e-33) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 1.2e+46) tmp = Float64(Float64(1.0 + Float64(-0.5 * (t_1 ^ 2.0))) * t_3); elseif (y_46_re <= 1.55e+156) tmp = exp(Float64(y_46_re * t_0)); else tmp = Float64(cos(Float64(y_46_im * t_0)) * t_3); 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = 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$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -5e-14], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.6e-33], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $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, 1.2e+46], N[(N[(1.0 + N[(-0.5 * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 1.55e+156], N[Exp[N[(y$46$re * t$95$0), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_2}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_2}\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{-33}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{+46}:\\
\;\;\;\;\left(1 + -0.5 \cdot {t\_1}^{2}\right) \cdot t\_3\\
\mathbf{elif}\;y.re \leq 1.55 \cdot 10^{+156}:\\
\;\;\;\;e^{y.re \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot t\_0\right) \cdot t\_3\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14Initial program 39.4%
exp-diff35.2%
exp-to-pow35.2%
hypot-define35.2%
*-commutative35.2%
exp-prod35.2%
fma-define35.2%
hypot-define73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y.re around inf 35.2%
+-commutative35.2%
associate-/l*35.2%
unpow235.2%
unpow235.2%
hypot-undefine73.2%
Simplified73.2%
Taylor expanded in y.im around 0 73.2%
Taylor expanded in y.im around 0 83.2%
Taylor expanded in y.re around 0 84.6%
if -5.0000000000000002e-14 < y.re < 3.60000000000000034e-33Initial program 40.4%
exp-diff40.4%
exp-to-pow40.4%
hypot-define40.4%
*-commutative40.4%
exp-prod40.1%
fma-define40.1%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in y.re around 0 82.0%
rec-exp82.0%
distribute-rgt-neg-in82.0%
Simplified82.0%
if 3.60000000000000034e-33 < y.re < 1.20000000000000004e46Initial program 53.4%
Taylor expanded in y.im around 0 67.9%
Taylor expanded in y.re around 0 81.3%
unpow281.3%
unpow281.3%
swap-sqr81.3%
unpow281.3%
Simplified81.3%
if 1.20000000000000004e46 < y.re < 1.5500000000000001e156Initial program 28.6%
Taylor expanded in y.im around 0 52.5%
Taylor expanded in y.re around 0 85.8%
Taylor expanded in y.re around inf 85.9%
unpow285.9%
unpow285.9%
hypot-undefine85.9%
Simplified85.9%
if 1.5500000000000001e156 < y.re Initial program 52.9%
Taylor expanded in y.re around 0 58.8%
unpow258.8%
unpow258.8%
hypot-undefine76.5%
Simplified76.5%
Final simplification82.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (cos (* y.im (log (hypot x.im x.re)))))
(t_2 (* (atan2 x.im x.re) y.im))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2)))
(t_4 (+ 1.0 t_2)))
(if (<= y.re -5e-14)
(/ (pow (hypot x.re x.im) y.re) t_4)
(if (<= y.re 3.6e-33)
(* t_1 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 1e+46)
(* (+ 1.0 (* -0.5 (pow t_0 2.0))) t_3)
(if (<= y.re 5.2e+209)
t_3
(if (<= y.re 4.8e+283)
(* (/ (pow x.im y.re) t_4) (cos t_0))
(* 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double t_4 = 1.0 + t_2;
double tmp;
if (y_46_re <= -5e-14) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / t_4;
} else if (y_46_re <= 3.6e-33) {
tmp = t_1 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1e+46) {
tmp = (1.0 + (-0.5 * pow(t_0, 2.0))) * t_3;
} else if (y_46_re <= 5.2e+209) {
tmp = t_3;
} else if (y_46_re <= 4.8e+283) {
tmp = (pow(x_46_im, y_46_re) / t_4) * cos(t_0);
} else {
tmp = t_1 * 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_2 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double t_4 = 1.0 + t_2;
double tmp;
if (y_46_re <= -5e-14) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / t_4;
} else if (y_46_re <= 3.6e-33) {
tmp = t_1 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1e+46) {
tmp = (1.0 + (-0.5 * Math.pow(t_0, 2.0))) * t_3;
} else if (y_46_re <= 5.2e+209) {
tmp = t_3;
} else if (y_46_re <= 4.8e+283) {
tmp = (Math.pow(x_46_im, y_46_re) / t_4) * Math.cos(t_0);
} else {
tmp = t_1 * 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 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_2 = math.atan2(x_46_im, x_46_re) * y_46_im t_3 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)) t_4 = 1.0 + t_2 tmp = 0 if y_46_re <= -5e-14: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / t_4 elif y_46_re <= 3.6e-33: tmp = t_1 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif y_46_re <= 1e+46: tmp = (1.0 + (-0.5 * math.pow(t_0, 2.0))) * t_3 elif y_46_re <= 5.2e+209: tmp = t_3 elif y_46_re <= 4.8e+283: tmp = (math.pow(x_46_im, y_46_re) / t_4) * math.cos(t_0) else: tmp = t_1 * 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(y_46_re * atan(x_46_im, x_46_re)) t_1 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_2)) t_4 = Float64(1.0 + t_2) tmp = 0.0 if (y_46_re <= -5e-14) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / t_4); elseif (y_46_re <= 3.6e-33) tmp = Float64(t_1 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 1e+46) tmp = Float64(Float64(1.0 + Float64(-0.5 * (t_0 ^ 2.0))) * t_3); elseif (y_46_re <= 5.2e+209) tmp = t_3; elseif (y_46_re <= 4.8e+283) tmp = Float64(Float64((x_46_im ^ y_46_re) / t_4) * cos(t_0)); else tmp = Float64(t_1 * (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 = y_46_re * atan2(x_46_im, x_46_re); t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); t_2 = atan2(x_46_im, x_46_re) * y_46_im; t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)); t_4 = 1.0 + t_2; tmp = 0.0; if (y_46_re <= -5e-14) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) / t_4; elseif (y_46_re <= 3.6e-33) tmp = t_1 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); elseif (y_46_re <= 1e+46) tmp = (1.0 + (-0.5 * (t_0 ^ 2.0))) * t_3; elseif (y_46_re <= 5.2e+209) tmp = t_3; elseif (y_46_re <= 4.8e+283) tmp = ((x_46_im ^ y_46_re) / t_4) * cos(t_0); else tmp = t_1 * (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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = 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$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(1.0 + t$95$2), $MachinePrecision]}, If[LessEqual[y$46$re, -5e-14], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[y$46$re, 3.6e-33], N[(t$95$1 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1e+46], N[(N[(1.0 + N[(-0.5 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 5.2e+209], t$95$3, If[LessEqual[y$46$re, 4.8e+283], N[(N[(N[Power[x$46$im, y$46$re], $MachinePrecision] / t$95$4), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_2}\\
t_4 := 1 + t\_2\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t\_4}\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{-33}:\\
\;\;\;\;t\_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 10^{+46}:\\
\;\;\;\;\left(1 + -0.5 \cdot {t\_0}^{2}\right) \cdot t\_3\\
\mathbf{elif}\;y.re \leq 5.2 \cdot 10^{+209}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq 4.8 \cdot 10^{+283}:\\
\;\;\;\;\frac{{x.im}^{y.re}}{t\_4} \cdot \cos t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14Initial program 39.4%
exp-diff35.2%
exp-to-pow35.2%
hypot-define35.2%
*-commutative35.2%
exp-prod35.2%
fma-define35.2%
hypot-define73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y.re around inf 35.2%
+-commutative35.2%
associate-/l*35.2%
unpow235.2%
unpow235.2%
hypot-undefine73.2%
Simplified73.2%
Taylor expanded in y.im around 0 73.2%
Taylor expanded in y.im around 0 83.2%
Taylor expanded in y.re around 0 84.6%
if -5.0000000000000002e-14 < y.re < 3.60000000000000034e-33Initial program 40.4%
exp-diff40.4%
exp-to-pow40.4%
hypot-define40.4%
*-commutative40.4%
exp-prod40.1%
fma-define40.1%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in y.re around inf 31.4%
+-commutative31.4%
associate-/l*31.4%
unpow231.4%
unpow231.4%
hypot-undefine62.2%
Simplified62.2%
Taylor expanded in y.re around 0 40.1%
unpow240.1%
unpow240.1%
hypot-undefine81.6%
Simplified81.6%
Taylor expanded in y.re around 0 82.0%
rec-exp82.0%
distribute-rgt-neg-in82.0%
Simplified82.0%
if 3.60000000000000034e-33 < y.re < 9.9999999999999999e45Initial program 53.4%
Taylor expanded in y.im around 0 67.9%
Taylor expanded in y.re around 0 81.3%
unpow281.3%
unpow281.3%
swap-sqr81.3%
unpow281.3%
Simplified81.3%
if 9.9999999999999999e45 < y.re < 5.2000000000000001e209Initial program 40.6%
Taylor expanded in y.im around 0 59.4%
Taylor expanded in y.re around 0 87.5%
if 5.2000000000000001e209 < y.re < 4.79999999999999995e283Initial program 60.0%
exp-diff46.7%
exp-to-pow46.7%
hypot-define46.7%
*-commutative46.7%
exp-prod46.7%
fma-define46.7%
hypot-define46.7%
*-commutative46.7%
Simplified46.7%
Taylor expanded in y.re around inf 46.7%
+-commutative46.7%
associate-/l*46.7%
unpow246.7%
unpow246.7%
hypot-undefine46.7%
Simplified46.7%
Taylor expanded in y.im around 0 46.7%
Taylor expanded in y.im around 0 80.1%
Taylor expanded in x.re around 0 86.9%
if 4.79999999999999995e283 < y.re Initial program 25.0%
exp-diff25.0%
exp-to-pow25.0%
hypot-define25.0%
*-commutative25.0%
exp-prod25.0%
fma-define25.0%
hypot-define37.5%
*-commutative37.5%
Simplified37.5%
Taylor expanded in y.re around inf 25.0%
+-commutative25.0%
associate-/l*25.0%
unpow225.0%
unpow225.0%
hypot-undefine37.5%
Simplified37.5%
Taylor expanded in y.re around 0 25.0%
unpow225.0%
unpow225.0%
hypot-undefine37.5%
Simplified37.5%
Taylor expanded in y.im around 0 75.0%
unpow275.0%
unpow275.0%
hypot-undefine75.0%
Simplified75.0%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re)))))
(t_1 (cos (* y.re (atan2 x.im x.re))))
(t_2 (* (atan2 x.im x.re) y.im))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2)))
(t_4 (+ 1.0 t_2))
(t_5 (/ (pow (hypot x.re x.im) y.re) t_4)))
(if (<= y.re -5e-14)
t_5
(if (<= y.re 3.6e-33)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 7.5e+21)
(* t_3 t_1)
(if (<= y.re 3e+49)
t_5
(if (<= y.re 2.4e+208)
t_3
(if (<= y.re 5.9e+283)
(* (/ (pow x.im y.re) t_4) t_1)
(* 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((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double t_4 = 1.0 + t_2;
double t_5 = pow(hypot(x_46_re, x_46_im), y_46_re) / t_4;
double tmp;
if (y_46_re <= -5e-14) {
tmp = t_5;
} else if (y_46_re <= 3.6e-33) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 7.5e+21) {
tmp = t_3 * t_1;
} else if (y_46_re <= 3e+49) {
tmp = t_5;
} else if (y_46_re <= 2.4e+208) {
tmp = t_3;
} else if (y_46_re <= 5.9e+283) {
tmp = (pow(x_46_im, y_46_re) / t_4) * t_1;
} 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((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_1 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double t_4 = 1.0 + t_2;
double t_5 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / t_4;
double tmp;
if (y_46_re <= -5e-14) {
tmp = t_5;
} else if (y_46_re <= 3.6e-33) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 7.5e+21) {
tmp = t_3 * t_1;
} else if (y_46_re <= 3e+49) {
tmp = t_5;
} else if (y_46_re <= 2.4e+208) {
tmp = t_3;
} else if (y_46_re <= 5.9e+283) {
tmp = (Math.pow(x_46_im, y_46_re) / t_4) * t_1;
} 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((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_1 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) t_2 = math.atan2(x_46_im, x_46_re) * y_46_im t_3 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)) t_4 = 1.0 + t_2 t_5 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / t_4 tmp = 0 if y_46_re <= -5e-14: tmp = t_5 elif y_46_re <= 3.6e-33: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif y_46_re <= 7.5e+21: tmp = t_3 * t_1 elif y_46_re <= 3e+49: tmp = t_5 elif y_46_re <= 2.4e+208: tmp = t_3 elif y_46_re <= 5.9e+283: tmp = (math.pow(x_46_im, y_46_re) / t_4) * t_1 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(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_2)) t_4 = Float64(1.0 + t_2) t_5 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / t_4) tmp = 0.0 if (y_46_re <= -5e-14) tmp = t_5; elseif (y_46_re <= 3.6e-33) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 7.5e+21) tmp = Float64(t_3 * t_1); elseif (y_46_re <= 3e+49) tmp = t_5; elseif (y_46_re <= 2.4e+208) tmp = t_3; elseif (y_46_re <= 5.9e+283) tmp = Float64(Float64((x_46_im ^ y_46_re) / t_4) * t_1); 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((y_46_im * log(hypot(x_46_im, x_46_re)))); t_1 = cos((y_46_re * atan2(x_46_im, x_46_re))); t_2 = atan2(x_46_im, x_46_re) * y_46_im; t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)); t_4 = 1.0 + t_2; t_5 = (hypot(x_46_re, x_46_im) ^ y_46_re) / t_4; tmp = 0.0; if (y_46_re <= -5e-14) tmp = t_5; elseif (y_46_re <= 3.6e-33) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); elseif (y_46_re <= 7.5e+21) tmp = t_3 * t_1; elseif (y_46_re <= 3e+49) tmp = t_5; elseif (y_46_re <= 2.4e+208) tmp = t_3; elseif (y_46_re <= 5.9e+283) tmp = ((x_46_im ^ y_46_re) / t_4) * t_1; 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[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = 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$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(1.0 + t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / t$95$4), $MachinePrecision]}, If[LessEqual[y$46$re, -5e-14], t$95$5, If[LessEqual[y$46$re, 3.6e-33], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.5e+21], N[(t$95$3 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 3e+49], t$95$5, If[LessEqual[y$46$re, 2.4e+208], t$95$3, If[LessEqual[y$46$re, 5.9e+283], N[(N[(N[Power[x$46$im, y$46$re], $MachinePrecision] / t$95$4), $MachinePrecision] * t$95$1), $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(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_2}\\
t_4 := 1 + t\_2\\
t_5 := \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t\_4}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-14}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{-33}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 7.5 \cdot 10^{+21}:\\
\;\;\;\;t\_3 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{+49}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;y.re \leq 2.4 \cdot 10^{+208}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq 5.9 \cdot 10^{+283}:\\
\;\;\;\;\frac{{x.im}^{y.re}}{t\_4} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14 or 7.5e21 < y.re < 3.0000000000000002e49Initial program 40.0%
exp-diff36.0%
exp-to-pow36.0%
hypot-define36.0%
*-commutative36.0%
exp-prod36.0%
fma-define36.0%
hypot-define73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in y.re around inf 36.0%
+-commutative36.0%
associate-/l*36.0%
unpow236.0%
unpow236.0%
hypot-undefine73.3%
Simplified73.3%
Taylor expanded in y.im around 0 72.0%
Taylor expanded in y.im around 0 84.1%
Taylor expanded in y.re around 0 85.5%
if -5.0000000000000002e-14 < y.re < 3.60000000000000034e-33Initial program 40.4%
exp-diff40.4%
exp-to-pow40.4%
hypot-define40.4%
*-commutative40.4%
exp-prod40.1%
fma-define40.1%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in y.re around inf 31.4%
+-commutative31.4%
associate-/l*31.4%
unpow231.4%
unpow231.4%
hypot-undefine62.2%
Simplified62.2%
Taylor expanded in y.re around 0 40.1%
unpow240.1%
unpow240.1%
hypot-undefine81.6%
Simplified81.6%
Taylor expanded in y.re around 0 82.0%
rec-exp82.0%
distribute-rgt-neg-in82.0%
Simplified82.0%
if 3.60000000000000034e-33 < y.re < 7.5e21Initial program 54.7%
Taylor expanded in y.im around 0 74.5%
if 3.0000000000000002e49 < y.re < 2.39999999999999987e208Initial program 40.6%
Taylor expanded in y.im around 0 59.4%
Taylor expanded in y.re around 0 87.5%
if 2.39999999999999987e208 < y.re < 5.8999999999999999e283Initial program 60.0%
exp-diff46.7%
exp-to-pow46.7%
hypot-define46.7%
*-commutative46.7%
exp-prod46.7%
fma-define46.7%
hypot-define46.7%
*-commutative46.7%
Simplified46.7%
Taylor expanded in y.re around inf 46.7%
+-commutative46.7%
associate-/l*46.7%
unpow246.7%
unpow246.7%
hypot-undefine46.7%
Simplified46.7%
Taylor expanded in y.im around 0 46.7%
Taylor expanded in y.im around 0 80.1%
Taylor expanded in x.re around 0 86.9%
if 5.8999999999999999e283 < y.re Initial program 25.0%
exp-diff25.0%
exp-to-pow25.0%
hypot-define25.0%
*-commutative25.0%
exp-prod25.0%
fma-define25.0%
hypot-define37.5%
*-commutative37.5%
Simplified37.5%
Taylor expanded in y.re around inf 25.0%
+-commutative25.0%
associate-/l*25.0%
unpow225.0%
unpow225.0%
hypot-undefine37.5%
Simplified37.5%
Taylor expanded in y.re around 0 25.0%
unpow225.0%
unpow225.0%
hypot-undefine37.5%
Simplified37.5%
Taylor expanded in y.im around 0 75.0%
unpow275.0%
unpow275.0%
hypot-undefine75.0%
Simplified75.0%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re))))
(t_1 (pow (hypot x.im x.re) y.re))
(t_2 (cos (* y.im (log (hypot x.im x.re)))))
(t_3 (* (atan2 x.im x.re) y.im))
(t_4 (+ 1.0 t_3))
(t_5 (/ (pow (hypot x.re x.im) y.re) t_4)))
(if (<= y.re -5e-14)
t_5
(if (<= y.re 1700000.0)
(* t_2 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 2e+28)
(* t_0 t_1)
(if (<= y.re 1e+46)
t_5
(if (<= y.re 4.1e+209)
(exp
(- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_3))
(if (<= y.re 4.8e+283)
(* (/ (pow x.im y.re) t_4) t_0)
(* t_2 t_1)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_2 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_3 = atan2(x_46_im, x_46_re) * y_46_im;
double t_4 = 1.0 + t_3;
double t_5 = pow(hypot(x_46_re, x_46_im), y_46_re) / t_4;
double tmp;
if (y_46_re <= -5e-14) {
tmp = t_5;
} else if (y_46_re <= 1700000.0) {
tmp = t_2 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 2e+28) {
tmp = t_0 * t_1;
} else if (y_46_re <= 1e+46) {
tmp = t_5;
} else if (y_46_re <= 4.1e+209) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_3));
} else if (y_46_re <= 4.8e+283) {
tmp = (pow(x_46_im, y_46_re) / t_4) * t_0;
} else {
tmp = t_2 * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_2 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_3 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_4 = 1.0 + t_3;
double t_5 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / t_4;
double tmp;
if (y_46_re <= -5e-14) {
tmp = t_5;
} else if (y_46_re <= 1700000.0) {
tmp = t_2 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 2e+28) {
tmp = t_0 * t_1;
} else if (y_46_re <= 1e+46) {
tmp = t_5;
} else if (y_46_re <= 4.1e+209) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_3));
} else if (y_46_re <= 4.8e+283) {
tmp = (Math.pow(x_46_im, y_46_re) / t_4) * t_0;
} else {
tmp = t_2 * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_2 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_3 = math.atan2(x_46_im, x_46_re) * y_46_im t_4 = 1.0 + t_3 t_5 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / t_4 tmp = 0 if y_46_re <= -5e-14: tmp = t_5 elif y_46_re <= 1700000.0: tmp = t_2 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif y_46_re <= 2e+28: tmp = t_0 * t_1 elif y_46_re <= 1e+46: tmp = t_5 elif y_46_re <= 4.1e+209: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_3)) elif y_46_re <= 4.8e+283: tmp = (math.pow(x_46_im, y_46_re) / t_4) * t_0 else: tmp = t_2 * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re t_2 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_3 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_4 = Float64(1.0 + t_3) t_5 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / t_4) tmp = 0.0 if (y_46_re <= -5e-14) tmp = t_5; elseif (y_46_re <= 1700000.0) tmp = Float64(t_2 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 2e+28) tmp = Float64(t_0 * t_1); elseif (y_46_re <= 1e+46) tmp = t_5; elseif (y_46_re <= 4.1e+209) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_3)); elseif (y_46_re <= 4.8e+283) tmp = Float64(Float64((x_46_im ^ y_46_re) / t_4) * t_0); else tmp = Float64(t_2 * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; t_2 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); t_3 = atan2(x_46_im, x_46_re) * y_46_im; t_4 = 1.0 + t_3; t_5 = (hypot(x_46_re, x_46_im) ^ y_46_re) / t_4; tmp = 0.0; if (y_46_re <= -5e-14) tmp = t_5; elseif (y_46_re <= 1700000.0) tmp = t_2 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); elseif (y_46_re <= 2e+28) tmp = t_0 * t_1; elseif (y_46_re <= 1e+46) tmp = t_5; elseif (y_46_re <= 4.1e+209) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_3)); elseif (y_46_re <= 4.8e+283) tmp = ((x_46_im ^ y_46_re) / t_4) * t_0; else tmp = t_2 * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$4 = N[(1.0 + t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / t$95$4), $MachinePrecision]}, If[LessEqual[y$46$re, -5e-14], t$95$5, If[LessEqual[y$46$re, 1700000.0], N[(t$95$2 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2e+28], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1e+46], t$95$5, If[LessEqual[y$46$re, 4.1e+209], 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$3), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 4.8e+283], N[(N[(N[Power[x$46$im, y$46$re], $MachinePrecision] / t$95$4), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$2 * t$95$1), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_2 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_3 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_4 := 1 + t\_3\\
t_5 := \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t\_4}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-14}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;y.re \leq 1700000:\\
\;\;\;\;t\_2 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{+28}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 10^{+46}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;y.re \leq 4.1 \cdot 10^{+209}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_3}\\
\mathbf{elif}\;y.re \leq 4.8 \cdot 10^{+283}:\\
\;\;\;\;\frac{{x.im}^{y.re}}{t\_4} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot t\_1\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14 or 1.99999999999999992e28 < y.re < 9.9999999999999999e45Initial program 39.7%
exp-diff35.6%
exp-to-pow35.6%
hypot-define35.6%
*-commutative35.6%
exp-prod35.6%
fma-define35.6%
hypot-define72.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in y.re around inf 35.6%
+-commutative35.6%
associate-/l*35.6%
unpow235.6%
unpow235.6%
hypot-undefine72.6%
Simplified72.6%
Taylor expanded in y.im around 0 71.2%
Taylor expanded in y.im around 0 83.7%
Taylor expanded in y.re around 0 85.1%
if -5.0000000000000002e-14 < y.re < 1.7e6Initial program 40.9%
exp-diff40.0%
exp-to-pow40.0%
hypot-define40.0%
*-commutative40.0%
exp-prod39.8%
fma-define39.8%
hypot-define79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y.re around inf 31.5%
+-commutative31.5%
associate-/l*31.5%
unpow231.5%
unpow231.5%
hypot-undefine61.6%
Simplified61.6%
Taylor expanded in y.re around 0 39.8%
unpow239.8%
unpow239.8%
hypot-undefine79.2%
Simplified79.2%
Taylor expanded in y.re around 0 80.4%
rec-exp80.4%
distribute-rgt-neg-in80.4%
Simplified80.4%
if 1.7e6 < y.re < 1.99999999999999992e28Initial program 57.1%
exp-diff57.1%
exp-to-pow57.1%
hypot-define57.1%
*-commutative57.1%
exp-prod57.1%
fma-define57.1%
hypot-define85.7%
*-commutative85.7%
Simplified85.7%
Taylor expanded in y.re around inf 57.1%
+-commutative57.1%
associate-/l*57.1%
unpow257.1%
unpow257.1%
hypot-undefine100.0%
Simplified100.0%
Taylor expanded in y.im around 0 100.0%
Taylor expanded in y.im around 0 100.0%
unpow257.1%
unpow257.1%
hypot-undefine57.1%
Simplified100.0%
if 9.9999999999999999e45 < y.re < 4.10000000000000015e209Initial program 40.6%
Taylor expanded in y.im around 0 59.4%
Taylor expanded in y.re around 0 87.5%
if 4.10000000000000015e209 < y.re < 4.79999999999999995e283Initial program 60.0%
exp-diff46.7%
exp-to-pow46.7%
hypot-define46.7%
*-commutative46.7%
exp-prod46.7%
fma-define46.7%
hypot-define46.7%
*-commutative46.7%
Simplified46.7%
Taylor expanded in y.re around inf 46.7%
+-commutative46.7%
associate-/l*46.7%
unpow246.7%
unpow246.7%
hypot-undefine46.7%
Simplified46.7%
Taylor expanded in y.im around 0 46.7%
Taylor expanded in y.im around 0 80.1%
Taylor expanded in x.re around 0 86.9%
if 4.79999999999999995e283 < y.re Initial program 25.0%
exp-diff25.0%
exp-to-pow25.0%
hypot-define25.0%
*-commutative25.0%
exp-prod25.0%
fma-define25.0%
hypot-define37.5%
*-commutative37.5%
Simplified37.5%
Taylor expanded in y.re around inf 25.0%
+-commutative25.0%
associate-/l*25.0%
unpow225.0%
unpow225.0%
hypot-undefine37.5%
Simplified37.5%
Taylor expanded in y.re around 0 25.0%
unpow225.0%
unpow225.0%
hypot-undefine37.5%
Simplified37.5%
Taylor expanded in y.im around 0 75.0%
unpow275.0%
unpow275.0%
hypot-undefine75.0%
Simplified75.0%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re))))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2 (+ 1.0 t_1)))
(if (<= y.re -2.2e-14)
(/ (pow (hypot x.re x.im) y.re) t_2)
(if (<= y.re 1.8e+14)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 1.08e+209)
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))
(if (<= y.re 6.5e+283)
(* (/ (pow x.im y.re) t_2) t_0)
(*
(cos (* y.im (log (hypot 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 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = 1.0 + t_1;
double tmp;
if (y_46_re <= -2.2e-14) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / t_2;
} else if (y_46_re <= 1.8e+14) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1.08e+209) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else if (y_46_re <= 6.5e+283) {
tmp = (pow(x_46_im, y_46_re) / t_2) * t_0;
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = 1.0 + t_1;
double tmp;
if (y_46_re <= -2.2e-14) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / t_2;
} else if (y_46_re <= 1.8e+14) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1.08e+209) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else if (y_46_re <= 6.5e+283) {
tmp = (Math.pow(x_46_im, y_46_re) / t_2) * t_0;
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * 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((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.atan2(x_46_im, x_46_re) * y_46_im t_2 = 1.0 + t_1 tmp = 0 if y_46_re <= -2.2e-14: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / t_2 elif y_46_re <= 1.8e+14: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif y_46_re <= 1.08e+209: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) elif y_46_re <= 6.5e+283: tmp = (math.pow(x_46_im, y_46_re) / t_2) * t_0 else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * 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(y_46_re * atan(x_46_im, x_46_re))) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = Float64(1.0 + t_1) tmp = 0.0 if (y_46_re <= -2.2e-14) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / t_2); elseif (y_46_re <= 1.8e+14) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 1.08e+209) tmp = 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)); elseif (y_46_re <= 6.5e+283) tmp = Float64(Float64((x_46_im ^ y_46_re) / t_2) * t_0); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (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((y_46_re * atan2(x_46_im, x_46_re))); t_1 = atan2(x_46_im, x_46_re) * y_46_im; t_2 = 1.0 + t_1; tmp = 0.0; if (y_46_re <= -2.2e-14) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) / t_2; elseif (y_46_re <= 1.8e+14) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); elseif (y_46_re <= 1.08e+209) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)); elseif (y_46_re <= 6.5e+283) tmp = ((x_46_im ^ y_46_re) / t_2) * t_0; else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * (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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -2.2e-14], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 1.8e+14], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.08e+209], 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], If[LessEqual[y$46$re, 6.5e+283], N[(N[(N[Power[x$46$im, y$46$re], $MachinePrecision] / t$95$2), $MachinePrecision] * t$95$0), $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[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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := 1 + t\_1\\
\mathbf{if}\;y.re \leq -2.2 \cdot 10^{-14}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t\_2}\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{+14}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 1.08 \cdot 10^{+209}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_1}\\
\mathbf{elif}\;y.re \leq 6.5 \cdot 10^{+283}:\\
\;\;\;\;\frac{{x.im}^{y.re}}{t\_2} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.2000000000000001e-14Initial program 39.4%
exp-diff35.2%
exp-to-pow35.2%
hypot-define35.2%
*-commutative35.2%
exp-prod35.2%
fma-define35.2%
hypot-define73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y.re around inf 35.2%
+-commutative35.2%
associate-/l*35.2%
unpow235.2%
unpow235.2%
hypot-undefine73.2%
Simplified73.2%
Taylor expanded in y.im around 0 73.2%
Taylor expanded in y.im around 0 83.2%
Taylor expanded in y.re around 0 84.6%
if -2.2000000000000001e-14 < y.re < 1.8e14Initial program 41.1%
exp-diff40.3%
exp-to-pow40.3%
hypot-define40.3%
*-commutative40.3%
exp-prod40.1%
fma-define40.1%
hypot-define79.0%
*-commutative79.0%
Simplified79.0%
Taylor expanded in y.re around inf 32.1%
+-commutative32.1%
associate-/l*32.1%
unpow232.1%
unpow232.1%
hypot-undefine62.8%
Simplified62.8%
Taylor expanded in y.im around 0 74.1%
Taylor expanded in y.re around 0 73.6%
rec-exp78.7%
distribute-rgt-neg-in78.7%
Simplified73.6%
if 1.8e14 < y.re < 1.08e209Initial program 43.2%
Taylor expanded in y.im around 0 59.5%
Taylor expanded in y.re around 0 83.8%
if 1.08e209 < y.re < 6.4999999999999996e283Initial program 60.0%
exp-diff46.7%
exp-to-pow46.7%
hypot-define46.7%
*-commutative46.7%
exp-prod46.7%
fma-define46.7%
hypot-define46.7%
*-commutative46.7%
Simplified46.7%
Taylor expanded in y.re around inf 46.7%
+-commutative46.7%
associate-/l*46.7%
unpow246.7%
unpow246.7%
hypot-undefine46.7%
Simplified46.7%
Taylor expanded in y.im around 0 46.7%
Taylor expanded in y.im around 0 80.1%
Taylor expanded in x.re around 0 86.9%
if 6.4999999999999996e283 < y.re Initial program 25.0%
exp-diff25.0%
exp-to-pow25.0%
hypot-define25.0%
*-commutative25.0%
exp-prod25.0%
fma-define25.0%
hypot-define37.5%
*-commutative37.5%
Simplified37.5%
Taylor expanded in y.re around inf 25.0%
+-commutative25.0%
associate-/l*25.0%
unpow225.0%
unpow225.0%
hypot-undefine37.5%
Simplified37.5%
Taylor expanded in y.re around 0 25.0%
unpow225.0%
unpow225.0%
hypot-undefine37.5%
Simplified37.5%
Taylor expanded in y.im around 0 75.0%
unpow275.0%
unpow275.0%
hypot-undefine75.0%
Simplified75.0%
Final simplification79.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re))))
(t_1 (+ 1.0 (* (atan2 x.im x.re) y.im))))
(if (<= y.re -5e-14)
(/ (pow (hypot x.re x.im) y.re) t_1)
(if (<= y.re 3e+15)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(if (or (<= y.re 4.8e+209) (not (<= y.re 6e+283)))
(exp (* y.re (log (hypot x.im x.re))))
(* (/ (pow x.im y.re) 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 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = 1.0 + (atan2(x_46_im, x_46_re) * y_46_im);
double tmp;
if (y_46_re <= -5e-14) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / t_1;
} else if (y_46_re <= 3e+15) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if ((y_46_re <= 4.8e+209) || !(y_46_re <= 6e+283)) {
tmp = exp((y_46_re * log(hypot(x_46_im, x_46_re))));
} else {
tmp = (pow(x_46_im, y_46_re) / t_1) * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = 1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im);
double tmp;
if (y_46_re <= -5e-14) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / t_1;
} else if (y_46_re <= 3e+15) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if ((y_46_re <= 4.8e+209) || !(y_46_re <= 6e+283)) {
tmp = Math.exp((y_46_re * Math.log(Math.hypot(x_46_im, x_46_re))));
} else {
tmp = (Math.pow(x_46_im, y_46_re) / t_1) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = 1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im) tmp = 0 if y_46_re <= -5e-14: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / t_1 elif y_46_re <= 3e+15: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif (y_46_re <= 4.8e+209) or not (y_46_re <= 6e+283): tmp = math.exp((y_46_re * math.log(math.hypot(x_46_im, x_46_re)))) else: tmp = (math.pow(x_46_im, y_46_re) / t_1) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im)) tmp = 0.0 if (y_46_re <= -5e-14) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / t_1); elseif (y_46_re <= 3e+15) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif ((y_46_re <= 4.8e+209) || !(y_46_re <= 6e+283)) tmp = exp(Float64(y_46_re * log(hypot(x_46_im, x_46_re)))); else tmp = Float64(Float64((x_46_im ^ y_46_re) / t_1) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); t_1 = 1.0 + (atan2(x_46_im, x_46_re) * y_46_im); tmp = 0.0; if (y_46_re <= -5e-14) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) / t_1; elseif (y_46_re <= 3e+15) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); elseif ((y_46_re <= 4.8e+209) || ~((y_46_re <= 6e+283))) tmp = exp((y_46_re * log(hypot(x_46_im, x_46_re)))); else tmp = ((x_46_im ^ y_46_re) / t_1) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5e-14], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 3e+15], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$re, 4.8e+209], N[Not[LessEqual[y$46$re, 6e+283]], $MachinePrecision]], N[Exp[N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Power[x$46$im, y$46$re], $MachinePrecision] / t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := 1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t\_1}\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{+15}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 4.8 \cdot 10^{+209} \lor \neg \left(y.re \leq 6 \cdot 10^{+283}\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{{x.im}^{y.re}}{t\_1} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14Initial program 39.4%
exp-diff35.2%
exp-to-pow35.2%
hypot-define35.2%
*-commutative35.2%
exp-prod35.2%
fma-define35.2%
hypot-define73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y.re around inf 35.2%
+-commutative35.2%
associate-/l*35.2%
unpow235.2%
unpow235.2%
hypot-undefine73.2%
Simplified73.2%
Taylor expanded in y.im around 0 73.2%
Taylor expanded in y.im around 0 83.2%
Taylor expanded in y.re around 0 84.6%
if -5.0000000000000002e-14 < y.re < 3e15Initial program 41.1%
exp-diff40.3%
exp-to-pow40.3%
hypot-define40.3%
*-commutative40.3%
exp-prod40.1%
fma-define40.1%
hypot-define79.0%
*-commutative79.0%
Simplified79.0%
Taylor expanded in y.re around inf 32.1%
+-commutative32.1%
associate-/l*32.1%
unpow232.1%
unpow232.1%
hypot-undefine62.8%
Simplified62.8%
Taylor expanded in y.im around 0 74.1%
Taylor expanded in y.re around 0 73.6%
rec-exp78.7%
distribute-rgt-neg-in78.7%
Simplified73.6%
if 3e15 < y.re < 4.79999999999999991e209 or 6.0000000000000001e283 < y.re Initial program 40.0%
Taylor expanded in y.im around 0 57.8%
Taylor expanded in y.re around 0 80.0%
Taylor expanded in y.re around inf 77.9%
unpow277.9%
unpow277.9%
hypot-undefine77.9%
Simplified77.9%
if 4.79999999999999991e209 < y.re < 6.0000000000000001e283Initial program 60.0%
exp-diff46.7%
exp-to-pow46.7%
hypot-define46.7%
*-commutative46.7%
exp-prod46.7%
fma-define46.7%
hypot-define46.7%
*-commutative46.7%
Simplified46.7%
Taylor expanded in y.re around inf 46.7%
+-commutative46.7%
associate-/l*46.7%
unpow246.7%
unpow246.7%
hypot-undefine46.7%
Simplified46.7%
Taylor expanded in y.im around 0 46.7%
Taylor expanded in y.im around 0 80.1%
Taylor expanded in x.re around 0 86.9%
Final simplification78.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re))))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2 (+ 1.0 t_1)))
(if (<= y.re -4.6e-14)
(/ (pow (hypot x.re x.im) y.re) t_2)
(if (<= y.re 1.8e+14)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 5.2e+209)
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))
(if (<= y.re 4.8e+283)
(* (/ (pow x.im y.re) t_2) t_0)
(exp (* y.re (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 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = 1.0 + t_1;
double tmp;
if (y_46_re <= -4.6e-14) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / t_2;
} else if (y_46_re <= 1.8e+14) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 5.2e+209) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else if (y_46_re <= 4.8e+283) {
tmp = (pow(x_46_im, y_46_re) / t_2) * t_0;
} else {
tmp = exp((y_46_re * 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.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = 1.0 + t_1;
double tmp;
if (y_46_re <= -4.6e-14) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / t_2;
} else if (y_46_re <= 1.8e+14) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 5.2e+209) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else if (y_46_re <= 4.8e+283) {
tmp = (Math.pow(x_46_im, y_46_re) / t_2) * t_0;
} else {
tmp = Math.exp((y_46_re * 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.cos((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.atan2(x_46_im, x_46_re) * y_46_im t_2 = 1.0 + t_1 tmp = 0 if y_46_re <= -4.6e-14: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / t_2 elif y_46_re <= 1.8e+14: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif y_46_re <= 5.2e+209: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) elif y_46_re <= 4.8e+283: tmp = (math.pow(x_46_im, y_46_re) / t_2) * t_0 else: tmp = math.exp((y_46_re * 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 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = Float64(1.0 + t_1) tmp = 0.0 if (y_46_re <= -4.6e-14) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / t_2); elseif (y_46_re <= 1.8e+14) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 5.2e+209) tmp = 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)); elseif (y_46_re <= 4.8e+283) tmp = Float64(Float64((x_46_im ^ y_46_re) / t_2) * t_0); else tmp = exp(Float64(y_46_re * 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 = cos((y_46_re * atan2(x_46_im, x_46_re))); t_1 = atan2(x_46_im, x_46_re) * y_46_im; t_2 = 1.0 + t_1; tmp = 0.0; if (y_46_re <= -4.6e-14) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) / t_2; elseif (y_46_re <= 1.8e+14) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); elseif (y_46_re <= 5.2e+209) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)); elseif (y_46_re <= 4.8e+283) tmp = ((x_46_im ^ y_46_re) / t_2) * t_0; else tmp = exp((y_46_re * 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[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -4.6e-14], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 1.8e+14], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.2e+209], 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], If[LessEqual[y$46$re, 4.8e+283], N[(N[(N[Power[x$46$im, y$46$re], $MachinePrecision] / t$95$2), $MachinePrecision] * t$95$0), $MachinePrecision], N[Exp[N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := 1 + t\_1\\
\mathbf{if}\;y.re \leq -4.6 \cdot 10^{-14}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t\_2}\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{+14}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 5.2 \cdot 10^{+209}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_1}\\
\mathbf{elif}\;y.re \leq 4.8 \cdot 10^{+283}:\\
\;\;\;\;\frac{{x.im}^{y.re}}{t\_2} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\\
\end{array}
\end{array}
if y.re < -4.59999999999999996e-14Initial program 39.4%
exp-diff35.2%
exp-to-pow35.2%
hypot-define35.2%
*-commutative35.2%
exp-prod35.2%
fma-define35.2%
hypot-define73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y.re around inf 35.2%
+-commutative35.2%
associate-/l*35.2%
unpow235.2%
unpow235.2%
hypot-undefine73.2%
Simplified73.2%
Taylor expanded in y.im around 0 73.2%
Taylor expanded in y.im around 0 83.2%
Taylor expanded in y.re around 0 84.6%
if -4.59999999999999996e-14 < y.re < 1.8e14Initial program 41.1%
exp-diff40.3%
exp-to-pow40.3%
hypot-define40.3%
*-commutative40.3%
exp-prod40.1%
fma-define40.1%
hypot-define79.0%
*-commutative79.0%
Simplified79.0%
Taylor expanded in y.re around inf 32.1%
+-commutative32.1%
associate-/l*32.1%
unpow232.1%
unpow232.1%
hypot-undefine62.8%
Simplified62.8%
Taylor expanded in y.im around 0 74.1%
Taylor expanded in y.re around 0 73.6%
rec-exp78.7%
distribute-rgt-neg-in78.7%
Simplified73.6%
if 1.8e14 < y.re < 5.2000000000000001e209Initial program 43.2%
Taylor expanded in y.im around 0 59.5%
Taylor expanded in y.re around 0 83.8%
if 5.2000000000000001e209 < y.re < 4.79999999999999995e283Initial program 60.0%
exp-diff46.7%
exp-to-pow46.7%
hypot-define46.7%
*-commutative46.7%
exp-prod46.7%
fma-define46.7%
hypot-define46.7%
*-commutative46.7%
Simplified46.7%
Taylor expanded in y.re around inf 46.7%
+-commutative46.7%
associate-/l*46.7%
unpow246.7%
unpow246.7%
hypot-undefine46.7%
Simplified46.7%
Taylor expanded in y.im around 0 46.7%
Taylor expanded in y.im around 0 80.1%
Taylor expanded in x.re around 0 86.9%
if 4.79999999999999995e283 < y.re Initial program 25.0%
Taylor expanded in y.im around 0 50.0%
Taylor expanded in y.re around 0 62.5%
Taylor expanded in y.re around inf 62.5%
unpow262.5%
unpow262.5%
hypot-undefine62.5%
Simplified62.5%
Final simplification78.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -5e-14)
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im)))
(if (<= y.re 8e+16)
(* (cos (* y.re (atan2 x.im x.re))) (exp (* (atan2 x.im x.re) (- y.im))))
(exp (* y.re (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 tmp;
if (y_46_re <= -5e-14) {
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 <= 8e+16) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = exp((y_46_re * 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 tmp;
if (y_46_re <= -5e-14) {
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 <= 8e+16) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.exp((y_46_re * 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): tmp = 0 if y_46_re <= -5e-14: 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 <= 8e+16: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.exp((y_46_re * 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) tmp = 0.0 if (y_46_re <= -5e-14) 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 <= 8e+16) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = exp(Float64(y_46_re * 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) tmp = 0.0; if (y_46_re <= -5e-14) 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 <= 8e+16) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = exp((y_46_re * 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_] := If[LessEqual[y$46$re, -5e-14], 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, 8e+16], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\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 8 \cdot 10^{+16}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14Initial program 39.4%
exp-diff35.2%
exp-to-pow35.2%
hypot-define35.2%
*-commutative35.2%
exp-prod35.2%
fma-define35.2%
hypot-define73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y.re around inf 35.2%
+-commutative35.2%
associate-/l*35.2%
unpow235.2%
unpow235.2%
hypot-undefine73.2%
Simplified73.2%
Taylor expanded in y.im around 0 73.2%
Taylor expanded in y.im around 0 83.2%
Taylor expanded in y.re around 0 84.6%
if -5.0000000000000002e-14 < y.re < 8e16Initial program 41.1%
exp-diff40.3%
exp-to-pow40.3%
hypot-define40.3%
*-commutative40.3%
exp-prod40.1%
fma-define40.1%
hypot-define79.0%
*-commutative79.0%
Simplified79.0%
Taylor expanded in y.re around inf 32.1%
+-commutative32.1%
associate-/l*32.1%
unpow232.1%
unpow232.1%
hypot-undefine62.8%
Simplified62.8%
Taylor expanded in y.im around 0 74.1%
Taylor expanded in y.re around 0 73.6%
rec-exp78.7%
distribute-rgt-neg-in78.7%
Simplified73.6%
if 8e16 < y.re Initial program 45.0%
Taylor expanded in y.im around 0 60.1%
Taylor expanded in y.re around 0 75.1%
Taylor expanded in y.re around inf 73.4%
unpow273.4%
unpow273.4%
hypot-undefine73.4%
Simplified73.4%
Final simplification76.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -9.6e-15)
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im)))
(if (<= y.re 86000000000000.0)
(exp (* (atan2 x.im x.re) (- y.im)))
(exp (* y.re (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 tmp;
if (y_46_re <= -9.6e-15) {
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 <= 86000000000000.0) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = exp((y_46_re * 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 tmp;
if (y_46_re <= -9.6e-15) {
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 <= 86000000000000.0) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.exp((y_46_re * 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): tmp = 0 if y_46_re <= -9.6e-15: 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 <= 86000000000000.0: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.exp((y_46_re * 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) tmp = 0.0 if (y_46_re <= -9.6e-15) 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 <= 86000000000000.0) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = exp(Float64(y_46_re * 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) tmp = 0.0; if (y_46_re <= -9.6e-15) 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 <= 86000000000000.0) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = exp((y_46_re * 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_] := If[LessEqual[y$46$re, -9.6e-15], 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, 86000000000000.0], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[Exp[N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -9.6 \cdot 10^{-15}:\\
\;\;\;\;\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 86000000000000:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\\
\end{array}
\end{array}
if y.re < -9.5999999999999998e-15Initial program 39.4%
exp-diff35.2%
exp-to-pow35.2%
hypot-define35.2%
*-commutative35.2%
exp-prod35.2%
fma-define35.2%
hypot-define73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y.re around inf 35.2%
+-commutative35.2%
associate-/l*35.2%
unpow235.2%
unpow235.2%
hypot-undefine73.2%
Simplified73.2%
Taylor expanded in y.im around 0 73.2%
Taylor expanded in y.im around 0 83.2%
Taylor expanded in y.re around 0 84.6%
if -9.5999999999999998e-15 < y.re < 8.6e13Initial program 41.5%
Taylor expanded in y.im around 0 46.4%
Taylor expanded in y.re around 0 44.7%
Taylor expanded in y.re around 0 73.4%
associate-*r*73.4%
neg-mul-173.4%
*-commutative73.4%
Simplified73.4%
if 8.6e13 < y.re Initial program 44.3%
Taylor expanded in y.im around 0 60.7%
Taylor expanded in y.re around 0 73.8%
Taylor expanded in y.re around inf 72.2%
unpow272.2%
unpow272.2%
hypot-undefine72.2%
Simplified72.2%
Final simplification76.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -5e-14) (not (<= y.re 90000000000000.0))) (exp (* y.re (log (hypot x.im x.re)))) (exp (* (atan2 x.im x.re) (- y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -5e-14) || !(y_46_re <= 90000000000000.0)) {
tmp = exp((y_46_re * log(hypot(x_46_im, x_46_re))));
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -5e-14) || !(y_46_re <= 90000000000000.0)) {
tmp = Math.exp((y_46_re * Math.log(Math.hypot(x_46_im, x_46_re))));
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -5e-14) or not (y_46_re <= 90000000000000.0): tmp = math.exp((y_46_re * math.log(math.hypot(x_46_im, x_46_re)))) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -5e-14) || !(y_46_re <= 90000000000000.0)) tmp = exp(Float64(y_46_re * log(hypot(x_46_im, x_46_re)))); else tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -5e-14) || ~((y_46_re <= 90000000000000.0))) tmp = exp((y_46_re * log(hypot(x_46_im, x_46_re)))); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -5e-14], N[Not[LessEqual[y$46$re, 90000000000000.0]], $MachinePrecision]], N[Exp[N[(y$46$re * 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5 \cdot 10^{-14} \lor \neg \left(y.re \leq 90000000000000\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14 or 9e13 < y.re Initial program 41.7%
Taylor expanded in y.im around 0 72.1%
Taylor expanded in y.re around 0 78.1%
Taylor expanded in y.re around inf 76.7%
unpow276.7%
unpow276.7%
hypot-undefine77.4%
Simplified77.4%
if -5.0000000000000002e-14 < y.re < 9e13Initial program 41.5%
Taylor expanded in y.im around 0 46.4%
Taylor expanded in y.re around 0 44.7%
Taylor expanded in y.re around 0 73.4%
associate-*r*73.4%
neg-mul-173.4%
*-commutative73.4%
Simplified73.4%
Final simplification75.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (* (atan2 x.im x.re) (- y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = exp((atan2(x_46im, x_46re) * -y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}
\end{array}
Initial program 41.6%
Taylor expanded in y.im around 0 59.6%
Taylor expanded in y.re around 0 61.9%
Taylor expanded in y.re around 0 48.3%
associate-*r*48.3%
neg-mul-148.3%
*-commutative48.3%
Simplified48.3%
Final simplification48.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (* (atan2 x.im x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp((atan2(x_46_im, x_46_re) * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = exp((atan2(x_46im, x_46re) * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.exp((Math.atan2(x_46_im, x_46_re) * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.exp((math.atan2(x_46_im, x_46_re) * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(atan(x_46_im, x_46_re) * y_46_im)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp((atan2(x_46_im, x_46_re) * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}
\end{array}
Initial program 41.6%
Taylor expanded in y.im around 0 59.6%
Taylor expanded in y.re around 0 61.9%
Taylor expanded in y.re around 0 48.3%
associate-*r*48.3%
neg-mul-148.3%
*-commutative48.3%
Simplified48.3%
add-sqr-sqrt27.8%
sqrt-unprod40.5%
sqr-neg40.5%
sqrt-unprod12.8%
add-sqr-sqrt26.9%
add-log-exp28.0%
log-pow28.2%
*-un-lft-identity28.2%
log-prod28.2%
metadata-eval28.2%
pow-exp26.9%
rem-log-exp26.9%
Applied egg-rr26.9%
+-lft-identity26.9%
Simplified26.9%
Final simplification26.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 41.6%
Taylor expanded in y.im around 0 59.6%
Taylor expanded in y.re around 0 61.9%
Taylor expanded in y.re around 0 48.3%
associate-*r*48.3%
neg-mul-148.3%
*-commutative48.3%
Simplified48.3%
Taylor expanded in y.im around 0 22.7%
Final simplification22.7%
herbie shell --seed 2024110
(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)))))