
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= y.re 1e-300)
(*
(exp
(pow (cbrt (* y.im (- (* t_0 (/ y.re y.im)) (atan2 x.im x.re)))) 3.0))
(cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(if (<= y.re 3.9e-64)
(exp (* y.im (- (atan2 x.im x.re))))
(*
(exp
(*
y.im
(- (* y.re (/ (log (hypot x.im x.re)) y.im)) (atan2 x.im x.re))))
(cos (* y.im t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 1e-300) {
tmp = exp(pow(cbrt((y_46_im * ((t_0 * (y_46_re / y_46_im)) - atan2(x_46_im, x_46_re)))), 3.0)) * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 3.9e-64) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = exp((y_46_im * ((y_46_re * (log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan2(x_46_im, x_46_re)))) * cos((y_46_im * t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 1e-300) tmp = Float64(exp((cbrt(Float64(y_46_im * Float64(Float64(t_0 * Float64(y_46_re / y_46_im)) - atan(x_46_im, x_46_re)))) ^ 3.0)) * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 3.9e-64) tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); else tmp = Float64(exp(Float64(y_46_im * Float64(Float64(y_46_re * Float64(log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan(x_46_im, x_46_re)))) * cos(Float64(y_46_im * t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 1e-300], N[(N[Exp[N[Power[N[Power[N[(y$46$im * N[(N[(t$95$0 * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $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], If[LessEqual[y$46$re, 3.9e-64], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], N[(N[Exp[N[(y$46$im * N[(N[(y$46$re * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] - N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 10^{-300}:\\
\;\;\;\;e^{{\left(\sqrt[3]{y.im \cdot \left(t\_0 \cdot \frac{y.re}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}^{3}} \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{elif}\;y.re \leq 3.9 \cdot 10^{-64}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{y.im \cdot \left(y.re \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \cos \left(y.im \cdot t\_0\right)\\
\end{array}
\end{array}
if y.re < 1.00000000000000003e-300Initial program 46.7%
cancel-sign-sub-inv46.7%
fma-define46.7%
hypot-define46.7%
distribute-lft-neg-in46.7%
distribute-rgt-neg-out46.7%
fma-define46.7%
hypot-define88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in y.im around inf 72.7%
+-commutative72.7%
mul-1-neg72.7%
unsub-neg72.7%
associate-/l*72.7%
unpow272.7%
unpow272.7%
hypot-undefine88.7%
Simplified88.7%
add-cube-cbrt88.7%
pow388.7%
*-commutative88.7%
associate-*l/88.7%
associate-/l*88.7%
hypot-undefine68.5%
+-commutative68.5%
hypot-define88.7%
Applied egg-rr88.7%
if 1.00000000000000003e-300 < y.re < 3.8999999999999997e-64Initial program 39.3%
Taylor expanded in y.im around 0 52.0%
Taylor expanded in y.re around 0 52.0%
Taylor expanded in x.re around 0 29.4%
Taylor expanded in y.re around 0 81.8%
distribute-lft-neg-in81.8%
Simplified81.8%
if 3.8999999999999997e-64 < y.re Initial program 31.2%
cancel-sign-sub-inv31.2%
fma-define31.2%
hypot-define31.2%
distribute-lft-neg-in31.2%
distribute-rgt-neg-out31.2%
fma-define31.2%
hypot-define76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in y.im around inf 61.0%
+-commutative61.0%
mul-1-neg61.0%
unsub-neg61.0%
associate-/l*61.0%
unpow261.0%
unpow261.0%
hypot-undefine76.6%
Simplified76.6%
Taylor expanded in y.re around 0 33.9%
+-commutative33.9%
unpow233.9%
unpow233.9%
hypot-undefine79.2%
Simplified79.2%
Final simplification84.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(*
y.im
(- (* y.re (/ (log (hypot x.im x.re)) y.im)) (atan2 x.im x.re)))))
(t_1 (log (hypot x.re x.im))))
(if (<= y.re 6.1e-295)
(* (cos (fma t_1 y.im (* y.re (atan2 x.im x.re)))) t_0)
(if (<= y.re 3.5e-68)
(exp (* y.im (- (atan2 x.im x.re))))
(* t_0 (cos (* y.im t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((y_46_im * ((y_46_re * (log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan2(x_46_im, x_46_re))));
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 6.1e-295) {
tmp = cos(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * t_0;
} else if (y_46_re <= 3.5e-68) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * cos((y_46_im * t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(y_46_im * Float64(Float64(y_46_re * Float64(log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan(x_46_im, x_46_re)))) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 6.1e-295) tmp = Float64(cos(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * t_0); elseif (y_46_re <= 3.5e-68) tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * cos(Float64(y_46_im * t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(y$46$im * N[(N[(y$46$re * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] - N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $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, 6.1e-295], 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] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 3.5e-68], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], N[(t$95$0 * N[Cos[N[(y$46$im * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.im \cdot \left(y.re \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 6.1 \cdot 10^{-295}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t\_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 3.5 \cdot 10^{-68}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.im \cdot t\_1\right)\\
\end{array}
\end{array}
if y.re < 6.09999999999999974e-295Initial program 46.7%
cancel-sign-sub-inv46.7%
fma-define46.7%
hypot-define46.7%
distribute-lft-neg-in46.7%
distribute-rgt-neg-out46.7%
fma-define46.7%
hypot-define88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in y.im around inf 72.7%
+-commutative72.7%
mul-1-neg72.7%
unsub-neg72.7%
associate-/l*72.7%
unpow272.7%
unpow272.7%
hypot-undefine88.7%
Simplified88.7%
if 6.09999999999999974e-295 < y.re < 3.50000000000000013e-68Initial program 39.3%
Taylor expanded in y.im around 0 52.0%
Taylor expanded in y.re around 0 52.0%
Taylor expanded in x.re around 0 29.4%
Taylor expanded in y.re around 0 81.8%
distribute-lft-neg-in81.8%
Simplified81.8%
if 3.50000000000000013e-68 < y.re Initial program 31.2%
cancel-sign-sub-inv31.2%
fma-define31.2%
hypot-define31.2%
distribute-lft-neg-in31.2%
distribute-rgt-neg-out31.2%
fma-define31.2%
hypot-define76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in y.im around inf 61.0%
+-commutative61.0%
mul-1-neg61.0%
unsub-neg61.0%
associate-/l*61.0%
unpow261.0%
unpow261.0%
hypot-undefine76.6%
Simplified76.6%
Taylor expanded in y.re around 0 33.9%
+-commutative33.9%
unpow233.9%
unpow233.9%
hypot-undefine79.2%
Simplified79.2%
Final simplification84.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.im 1.5e-12)
(*
(exp
(* y.im (- (* y.re (/ (log (hypot x.im x.re)) y.im)) (atan2 x.im x.re))))
(cos (* y.im (log (hypot x.re x.im)))))
(exp (- (* y.re (log x.im)) (* y.im (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= 1.5e-12) {
tmp = exp((y_46_im * ((y_46_re * (log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan2(x_46_im, x_46_re)))) * cos((y_46_im * log(hypot(x_46_re, x_46_im))));
} else {
tmp = exp(((y_46_re * log(x_46_im)) - (y_46_im * atan2(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 (x_46_im <= 1.5e-12) {
tmp = Math.exp((y_46_im * ((y_46_re * (Math.log(Math.hypot(x_46_im, x_46_re)) / y_46_im)) - Math.atan2(x_46_im, x_46_re)))) * Math.cos((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im))));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - (y_46_im * Math.atan2(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 x_46_im <= 1.5e-12: tmp = math.exp((y_46_im * ((y_46_re * (math.log(math.hypot(x_46_im, x_46_re)) / y_46_im)) - math.atan2(x_46_im, x_46_re)))) * math.cos((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) else: tmp = math.exp(((y_46_re * math.log(x_46_im)) - (y_46_im * math.atan2(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 (x_46_im <= 1.5e-12) tmp = Float64(exp(Float64(y_46_im * Float64(Float64(y_46_re * Float64(log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan(x_46_im, x_46_re)))) * cos(Float64(y_46_im * log(hypot(x_46_re, x_46_im))))); else tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - Float64(y_46_im * atan(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 (x_46_im <= 1.5e-12) tmp = exp((y_46_im * ((y_46_re * (log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan2(x_46_im, x_46_re)))) * cos((y_46_im * log(hypot(x_46_re, x_46_im)))); else tmp = exp(((y_46_re * log(x_46_im)) - (y_46_im * atan2(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[x$46$im, 1.5e-12], N[(N[Exp[N[(y$46$im * N[(N[(y$46$re * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] - N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 1.5 \cdot 10^{-12}:\\
\;\;\;\;e^{y.im \cdot \left(y.re \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if x.im < 1.5000000000000001e-12Initial program 42.9%
cancel-sign-sub-inv42.9%
fma-define42.9%
hypot-define42.9%
distribute-lft-neg-in42.9%
distribute-rgt-neg-out42.9%
fma-define42.9%
hypot-define81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in y.im around inf 65.1%
+-commutative65.1%
mul-1-neg65.1%
unsub-neg65.1%
associate-/l*65.1%
unpow265.1%
unpow265.1%
hypot-undefine81.3%
Simplified81.3%
Taylor expanded in y.re around 0 42.4%
+-commutative42.4%
unpow242.4%
unpow242.4%
hypot-undefine81.3%
Simplified81.3%
if 1.5000000000000001e-12 < x.im Initial program 33.3%
Taylor expanded in y.im around 0 53.8%
Taylor expanded in y.re around 0 61.4%
Taylor expanded in x.re around 0 85.7%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.46e+63)
(exp (* y.im (- (atan2 x.im x.re))))
(if (<= y.im 30000.0)
(*
(exp (* y.re (log (hypot x.re x.im))))
(+ 1.0 (* -0.5 (pow (* y.im (log (hypot x.im x.re))) 2.0))))
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -1.46e+63) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 30000.0) {
tmp = exp((y_46_re * log(hypot(x_46_re, x_46_im)))) * (1.0 + (-0.5 * pow((y_46_im * log(hypot(x_46_im, x_46_re))), 2.0)));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -1.46e+63) {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 30000.0) {
tmp = Math.exp((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im)))) * (1.0 + (-0.5 * Math.pow((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))), 2.0)));
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -1.46e+63: tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) elif y_46_im <= 30000.0: tmp = math.exp((y_46_re * math.log(math.hypot(x_46_re, x_46_im)))) * (1.0 + (-0.5 * math.pow((y_46_im * math.log(math.hypot(x_46_im, x_46_re))), 2.0))) else: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -1.46e+63) tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); elseif (y_46_im <= 30000.0) tmp = Float64(exp(Float64(y_46_re * log(hypot(x_46_re, x_46_im)))) * Float64(1.0 + Float64(-0.5 * (Float64(y_46_im * log(hypot(x_46_im, x_46_re))) ^ 2.0)))); else tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -1.46e+63) tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))); elseif (y_46_im <= 30000.0) tmp = exp((y_46_re * log(hypot(x_46_re, x_46_im)))) * (1.0 + (-0.5 * ((y_46_im * log(hypot(x_46_im, x_46_re))) ^ 2.0))); else tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -1.46e+63], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$im, 30000.0], N[(N[Exp[N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.46 \cdot 10^{+63}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.im \leq 30000:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)} \cdot \left(1 + -0.5 \cdot {\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < -1.4599999999999999e63Initial program 37.4%
Taylor expanded in y.im around 0 44.9%
Taylor expanded in y.re around 0 46.9%
Taylor expanded in x.re around 0 25.5%
Taylor expanded in y.re around 0 65.5%
distribute-lft-neg-in65.5%
Simplified65.5%
if -1.4599999999999999e63 < y.im < 3e4Initial program 42.3%
cancel-sign-sub-inv42.3%
fma-define42.3%
hypot-define42.3%
distribute-lft-neg-in42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in y.im around inf 64.2%
+-commutative64.2%
mul-1-neg64.2%
unsub-neg64.2%
associate-/l*64.2%
unpow264.2%
unpow264.2%
hypot-undefine87.6%
Simplified87.6%
Taylor expanded in y.re around 0 43.8%
+-commutative43.8%
unpow243.8%
unpow243.8%
hypot-undefine89.8%
Simplified89.8%
Taylor expanded in y.im around 0 45.8%
unpow245.8%
+-commutative45.8%
unpow245.8%
unpow245.8%
hypot-undefine91.0%
unpow291.0%
swap-sqr91.0%
unpow291.0%
Simplified91.0%
Taylor expanded in y.im around 0 65.4%
+-commutative65.4%
unpow265.4%
unpow265.4%
hypot-undefine88.0%
Simplified88.0%
if 3e4 < y.im Initial program 39.1%
Taylor expanded in y.im around 0 66.0%
Taylor expanded in y.re around 0 70.5%
Final simplification78.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(*
y.im
(- (* y.re (/ (log (hypot x.im x.re)) y.im)) (atan2 x.im x.re))))))
(if (<= x.re -5e-309)
(* t_0 (cos (* y.im (log (/ -1.0 x.re)))))
(* t_0 (cos (* y.im (log x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((y_46_im * ((y_46_re * (log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan2(x_46_im, x_46_re))));
double tmp;
if (x_46_re <= -5e-309) {
tmp = t_0 * cos((y_46_im * log((-1.0 / x_46_re))));
} else {
tmp = t_0 * cos((y_46_im * log(x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp((y_46_im * ((y_46_re * (Math.log(Math.hypot(x_46_im, x_46_re)) / y_46_im)) - Math.atan2(x_46_im, x_46_re))));
double tmp;
if (x_46_re <= -5e-309) {
tmp = t_0 * Math.cos((y_46_im * Math.log((-1.0 / x_46_re))));
} else {
tmp = t_0 * Math.cos((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((y_46_im * ((y_46_re * (math.log(math.hypot(x_46_im, x_46_re)) / y_46_im)) - math.atan2(x_46_im, x_46_re)))) tmp = 0 if x_46_re <= -5e-309: tmp = t_0 * math.cos((y_46_im * math.log((-1.0 / x_46_re)))) else: tmp = t_0 * math.cos((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(y_46_im * Float64(Float64(y_46_re * Float64(log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan(x_46_im, x_46_re)))) tmp = 0.0 if (x_46_re <= -5e-309) tmp = Float64(t_0 * cos(Float64(y_46_im * log(Float64(-1.0 / x_46_re))))); else tmp = Float64(t_0 * cos(Float64(y_46_im * log(x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((y_46_im * ((y_46_re * (log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan2(x_46_im, x_46_re)))); tmp = 0.0; if (x_46_re <= -5e-309) tmp = t_0 * cos((y_46_im * log((-1.0 / x_46_re)))); else tmp = t_0 * cos((y_46_im * log(x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(y$46$im * N[(N[(y$46$re * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] - N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -5e-309], N[(t$95$0 * N[Cos[N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.im \cdot \left(y.re \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;x.re \leq -5 \cdot 10^{-309}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -4.9999999999999995e-309Initial program 46.0%
cancel-sign-sub-inv46.0%
fma-define46.0%
hypot-define46.0%
distribute-lft-neg-in46.0%
distribute-rgt-neg-out46.0%
fma-define46.0%
hypot-define83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in y.im around inf 66.3%
+-commutative66.3%
mul-1-neg66.3%
unsub-neg66.3%
associate-/l*66.3%
unpow266.3%
unpow266.3%
hypot-undefine83.3%
Simplified83.3%
Taylor expanded in y.re around 0 46.8%
+-commutative46.8%
unpow246.8%
unpow246.8%
hypot-undefine84.1%
Simplified84.1%
Taylor expanded in x.re around -inf 84.4%
mul-1-neg84.4%
cos-neg84.4%
Simplified84.4%
if -4.9999999999999995e-309 < x.re Initial program 35.1%
cancel-sign-sub-inv35.1%
fma-define35.1%
hypot-define35.1%
distribute-lft-neg-in35.1%
distribute-rgt-neg-out35.1%
fma-define35.1%
hypot-define78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in y.im around inf 58.9%
+-commutative58.9%
mul-1-neg58.9%
unsub-neg58.9%
associate-/l*58.9%
unpow258.9%
unpow258.9%
hypot-undefine78.3%
Simplified78.3%
Taylor expanded in y.re around 0 34.3%
+-commutative34.3%
unpow234.3%
unpow234.3%
hypot-undefine77.5%
Simplified77.5%
Taylor expanded in x.im around 0 80.6%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re -5e-310)
(exp (- (* y.re (log (- x.re))) (* y.im (atan2 x.im x.re))))
(*
(exp
(* y.im (- (* y.re (/ (log (hypot x.im x.re)) y.im)) (atan2 x.im x.re))))
(cos (* y.im (log x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -5e-310) {
tmp = exp(((y_46_re * log(-x_46_re)) - (y_46_im * atan2(x_46_im, x_46_re))));
} else {
tmp = exp((y_46_im * ((y_46_re * (log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan2(x_46_im, x_46_re)))) * cos((y_46_im * log(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 (x_46_re <= -5e-310) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_re)) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = Math.exp((y_46_im * ((y_46_re * (Math.log(Math.hypot(x_46_im, x_46_re)) / y_46_im)) - Math.atan2(x_46_im, x_46_re)))) * Math.cos((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -5e-310: tmp = math.exp(((y_46_re * math.log(-x_46_re)) - (y_46_im * math.atan2(x_46_im, x_46_re)))) else: tmp = math.exp((y_46_im * ((y_46_re * (math.log(math.hypot(x_46_im, x_46_re)) / y_46_im)) - math.atan2(x_46_im, x_46_re)))) * math.cos((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -5e-310) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = Float64(exp(Float64(y_46_im * Float64(Float64(y_46_re * Float64(log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan(x_46_im, x_46_re)))) * cos(Float64(y_46_im * log(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 (x_46_re <= -5e-310) tmp = exp(((y_46_re * log(-x_46_re)) - (y_46_im * atan2(x_46_im, x_46_re)))); else tmp = exp((y_46_im * ((y_46_re * (log(hypot(x_46_im, x_46_re)) / y_46_im)) - atan2(x_46_im, x_46_re)))) * cos((y_46_im * log(x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -5e-310], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Exp[N[(y$46$im * N[(N[(y$46$re * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] - N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;e^{y.im \cdot \left(y.re \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \cos \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -4.999999999999985e-310Initial program 46.0%
Taylor expanded in y.im around 0 64.3%
Taylor expanded in y.re around 0 67.5%
Taylor expanded in x.re around -inf 77.4%
mul-1-neg77.4%
Simplified77.4%
if -4.999999999999985e-310 < x.re Initial program 35.1%
cancel-sign-sub-inv35.1%
fma-define35.1%
hypot-define35.1%
distribute-lft-neg-in35.1%
distribute-rgt-neg-out35.1%
fma-define35.1%
hypot-define78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in y.im around inf 58.9%
+-commutative58.9%
mul-1-neg58.9%
unsub-neg58.9%
associate-/l*58.9%
unpow258.9%
unpow258.9%
hypot-undefine78.3%
Simplified78.3%
Taylor expanded in y.re around 0 34.3%
+-commutative34.3%
unpow234.3%
unpow234.3%
hypot-undefine77.5%
Simplified77.5%
Taylor expanded in x.im around 0 80.6%
Final simplification79.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.2e+27)
(exp (* y.im (- (atan2 x.im x.re))))
(if (<= y.im 62000000000000.0)
(* (cos (* y.im (log (hypot x.re x.im)))) (pow (hypot x.re x.im) y.re))
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -1.2e+27) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 62000000000000.0) {
tmp = cos((y_46_im * log(hypot(x_46_re, x_46_im)))) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -1.2e+27) {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 62000000000000.0) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im)))) * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(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_im <= -1.2e+27: tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) elif y_46_im <= 62000000000000.0: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) else: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(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_im <= -1.2e+27) tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); elseif (y_46_im <= 62000000000000.0) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_re, x_46_im)))) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -1.2e+27) tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))); elseif (y_46_im <= 62000000000000.0) tmp = cos((y_46_im * log(hypot(x_46_re, x_46_im)))) * (hypot(x_46_re, x_46_im) ^ y_46_re); else tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -1.2e+27], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$im, 62000000000000.0], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.2 \cdot 10^{+27}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.im \leq 62000000000000:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < -1.19999999999999999e27Initial program 32.5%
Taylor expanded in y.im around 0 48.2%
Taylor expanded in y.re around 0 48.2%
Taylor expanded in x.re around 0 22.7%
Taylor expanded in y.re around 0 63.6%
distribute-lft-neg-in63.6%
Simplified63.6%
if -1.19999999999999999e27 < y.im < 6.2e13Initial program 44.5%
exp-diff44.5%
exp-to-pow44.5%
hypot-define44.5%
*-commutative44.5%
exp-prod44.5%
fma-define44.5%
hypot-define88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in y.im around 0 86.7%
Taylor expanded in y.re around 0 43.5%
+-commutative46.1%
unpow246.1%
unpow246.1%
hypot-undefine92.3%
Simplified89.8%
if 6.2e13 < y.im Initial program 40.3%
Taylor expanded in y.im around 0 66.4%
Taylor expanded in y.re around 0 71.1%
Final simplification78.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5.4e+26)
(exp (* y.im (- (atan2 x.im x.re))))
(if (<= y.im 62000000000000.0)
(pow (hypot x.im x.re) y.re)
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -5.4e+26) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 62000000000000.0) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -5.4e+26) {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 62000000000000.0) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(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_im <= -5.4e+26: tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) elif y_46_im <= 62000000000000.0: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(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_im <= -5.4e+26) tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); elseif (y_46_im <= 62000000000000.0) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -5.4e+26) tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))); elseif (y_46_im <= 62000000000000.0) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -5.4e+26], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$im, 62000000000000.0], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.4 \cdot 10^{+26}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.im \leq 62000000000000:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < -5.4e26Initial program 32.5%
Taylor expanded in y.im around 0 48.2%
Taylor expanded in y.re around 0 48.2%
Taylor expanded in x.re around 0 22.7%
Taylor expanded in y.re around 0 63.6%
distribute-lft-neg-in63.6%
Simplified63.6%
if -5.4e26 < y.im < 6.2e13Initial program 44.5%
cancel-sign-sub-inv44.5%
fma-define44.5%
hypot-define44.5%
distribute-lft-neg-in44.5%
distribute-rgt-neg-out44.5%
fma-define44.5%
hypot-define89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in y.im around inf 64.1%
+-commutative64.1%
mul-1-neg64.1%
unsub-neg64.1%
associate-/l*64.1%
unpow264.1%
unpow264.1%
hypot-undefine89.2%
Simplified89.2%
Taylor expanded in y.re around 0 46.1%
+-commutative46.1%
unpow246.1%
unpow246.1%
hypot-undefine92.3%
Simplified92.3%
Taylor expanded in y.im around 0 44.4%
unpow244.4%
+-commutative44.4%
unpow244.4%
unpow244.4%
hypot-undefine89.6%
unpow289.6%
swap-sqr89.6%
unpow289.6%
Simplified89.6%
Taylor expanded in y.im around 0 64.1%
unpow264.1%
unpow264.1%
hypot-undefine89.1%
Simplified89.1%
if 6.2e13 < y.im Initial program 40.3%
Taylor expanded in y.im around 0 66.4%
Taylor expanded in y.re around 0 71.1%
Final simplification78.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (atan2 x.im x.re))))
(if (<= y.im -5.4e+26)
(exp (* y.im t_0))
(if (<= y.im 4.2e+57)
(pow (hypot x.im x.re) y.re)
(pow (exp y.im) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = -atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -5.4e+26) {
tmp = exp((y_46_im * t_0));
} else if (y_46_im <= 4.2e+57) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow(exp(y_46_im), t_0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = -Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -5.4e+26) {
tmp = Math.exp((y_46_im * t_0));
} else if (y_46_im <= 4.2e+57) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.pow(Math.exp(y_46_im), t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = -math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_im <= -5.4e+26: tmp = math.exp((y_46_im * t_0)) elif y_46_im <= 4.2e+57: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.pow(math.exp(y_46_im), t_0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(-atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -5.4e+26) tmp = exp(Float64(y_46_im * t_0)); elseif (y_46_im <= 4.2e+57) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = exp(y_46_im) ^ t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = -atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_im <= -5.4e+26) tmp = exp((y_46_im * t_0)); elseif (y_46_im <= 4.2e+57) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = exp(y_46_im) ^ t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])}, If[LessEqual[y$46$im, -5.4e+26], N[Exp[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$im, 4.2e+57], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[Power[N[Exp[y$46$im], $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -5.4 \cdot 10^{+26}:\\
\;\;\;\;e^{y.im \cdot t\_0}\\
\mathbf{elif}\;y.im \leq 4.2 \cdot 10^{+57}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(e^{y.im}\right)}^{t\_0}\\
\end{array}
\end{array}
if y.im < -5.4e26Initial program 32.5%
Taylor expanded in y.im around 0 48.2%
Taylor expanded in y.re around 0 48.2%
Taylor expanded in x.re around 0 22.7%
Taylor expanded in y.re around 0 63.6%
distribute-lft-neg-in63.6%
Simplified63.6%
if -5.4e26 < y.im < 4.19999999999999982e57Initial program 46.6%
cancel-sign-sub-inv46.6%
fma-define46.6%
hypot-define46.6%
distribute-lft-neg-in46.6%
distribute-rgt-neg-out46.6%
fma-define46.6%
hypot-define89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in y.im around inf 65.2%
+-commutative65.2%
mul-1-neg65.2%
unsub-neg65.2%
associate-/l*65.2%
unpow265.2%
unpow265.2%
hypot-undefine89.0%
Simplified89.0%
Taylor expanded in y.re around 0 48.1%
+-commutative48.1%
unpow248.1%
unpow248.1%
hypot-undefine92.0%
Simplified92.0%
Taylor expanded in y.im around 0 45.8%
unpow245.8%
+-commutative45.8%
unpow245.8%
unpow245.8%
hypot-undefine88.7%
unpow288.7%
swap-sqr88.7%
unpow288.7%
Simplified88.7%
Taylor expanded in y.im around 0 64.5%
unpow264.5%
unpow264.5%
hypot-undefine88.2%
Simplified88.2%
if 4.19999999999999982e57 < y.im Initial program 34.8%
Taylor expanded in y.im around 0 64.1%
Taylor expanded in y.re around 0 69.3%
Taylor expanded in x.re around 0 39.7%
Taylor expanded in y.re around 0 66.1%
distribute-rgt-neg-in66.1%
exp-prod67.7%
Simplified67.7%
Final simplification77.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -9.6e+27) (not (<= y.im 1.05e+58))) (exp (* y.im (- (atan2 x.im x.re)))) (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -9.6e+27) || !(y_46_im <= 1.05e+58)) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -9.6e+27) || !(y_46_im <= 1.05e+58)) {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -9.6e+27) or not (y_46_im <= 1.05e+58): tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -9.6e+27) || !(y_46_im <= 1.05e+58)) tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -9.6e+27) || ~((y_46_im <= 1.05e+58))) tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -9.6e+27], N[Not[LessEqual[y$46$im, 1.05e+58]], $MachinePrecision]], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -9.6 \cdot 10^{+27} \lor \neg \left(y.im \leq 1.05 \cdot 10^{+58}\right):\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -9.59999999999999991e27 or 1.05000000000000006e58 < y.im Initial program 33.6%
Taylor expanded in y.im around 0 55.8%
Taylor expanded in y.re around 0 58.3%
Taylor expanded in x.re around 0 30.8%
Taylor expanded in y.re around 0 64.8%
distribute-lft-neg-in64.8%
Simplified64.8%
if -9.59999999999999991e27 < y.im < 1.05000000000000006e58Initial program 46.6%
cancel-sign-sub-inv46.6%
fma-define46.6%
hypot-define46.6%
distribute-lft-neg-in46.6%
distribute-rgt-neg-out46.6%
fma-define46.6%
hypot-define89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in y.im around inf 65.2%
+-commutative65.2%
mul-1-neg65.2%
unsub-neg65.2%
associate-/l*65.2%
unpow265.2%
unpow265.2%
hypot-undefine89.0%
Simplified89.0%
Taylor expanded in y.re around 0 48.1%
+-commutative48.1%
unpow248.1%
unpow248.1%
hypot-undefine92.0%
Simplified92.0%
Taylor expanded in y.im around 0 45.8%
unpow245.8%
+-commutative45.8%
unpow245.8%
unpow245.8%
hypot-undefine88.7%
unpow288.7%
swap-sqr88.7%
unpow288.7%
Simplified88.7%
Taylor expanded in y.im around 0 64.5%
unpow264.5%
unpow264.5%
hypot-undefine88.2%
Simplified88.2%
Final simplification77.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (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) {
return pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return hypot(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) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 40.5%
cancel-sign-sub-inv40.5%
fma-define40.5%
hypot-define40.5%
distribute-lft-neg-in40.5%
distribute-rgt-neg-out40.5%
fma-define40.5%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around inf 62.5%
+-commutative62.5%
mul-1-neg62.5%
unsub-neg62.5%
associate-/l*62.5%
unpow262.5%
unpow262.5%
hypot-undefine80.8%
Simplified80.8%
Taylor expanded in y.re around 0 40.5%
+-commutative40.5%
unpow240.5%
unpow240.5%
hypot-undefine80.8%
Simplified80.8%
Taylor expanded in y.im around 0 37.1%
unpow237.1%
+-commutative37.1%
unpow237.1%
unpow237.1%
hypot-undefine64.8%
unpow264.8%
swap-sqr64.8%
unpow264.8%
Simplified64.8%
Taylor expanded in y.im around 0 51.0%
unpow251.0%
unpow251.0%
hypot-undefine58.2%
Simplified58.2%
Final simplification58.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow x.im y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(x_46_im, y_46_re);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im ** y_46re
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(x_46_im, y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(x_46_im, y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return x_46_im ^ y_46_re end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im ^ y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[x$46$im, y$46$re], $MachinePrecision]
\begin{array}{l}
\\
{x.im}^{y.re}
\end{array}
Initial program 40.5%
Taylor expanded in y.im around 0 59.2%
Taylor expanded in y.re around 0 62.0%
Taylor expanded in x.re around 0 33.7%
Taylor expanded in y.im around 0 36.5%
Final simplification36.5%
herbie shell --seed 2024078
(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)))))