
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (cbrt (fma t_1 y.im t_0)))
(t_3 (exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im)))))
(t_4 (cbrt t_2)))
(if (<= x.im -2e+132)
(* (exp (- (* (log (- x.im)) y.re) (* (atan2 x.im x.re) y.im))) (cos t_0))
(if (<= x.im -1e-8)
(* t_3 (cos (pow t_2 3.0)))
(if (<= x.im 3.2e-247)
(*
t_3
(cos
(pow
(*
t_4
(pow
(cbrt
(pow (* (pow (pow t_4 2.0) 0.3333333333333333) (cbrt t_4)) 2.0))
3.0))
3.0)))
(* t_3 (cos (+ t_0 (* y.im (log x.im))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = cbrt(fma(t_1, y_46_im, t_0));
double t_3 = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double t_4 = cbrt(t_2);
double tmp;
if (x_46_im <= -2e+132) {
tmp = exp(((log(-x_46_im) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(t_0);
} else if (x_46_im <= -1e-8) {
tmp = t_3 * cos(pow(t_2, 3.0));
} else if (x_46_im <= 3.2e-247) {
tmp = t_3 * cos(pow((t_4 * pow(cbrt(pow((pow(pow(t_4, 2.0), 0.3333333333333333) * cbrt(t_4)), 2.0)), 3.0)), 3.0));
} else {
tmp = t_3 * cos((t_0 + (y_46_im * log(x_46_im))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = cbrt(fma(t_1, y_46_im, t_0)) t_3 = exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) t_4 = cbrt(t_2) tmp = 0.0 if (x_46_im <= -2e+132) tmp = Float64(exp(Float64(Float64(log(Float64(-x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(t_0)); elseif (x_46_im <= -1e-8) tmp = Float64(t_3 * cos((t_2 ^ 3.0))); elseif (x_46_im <= 3.2e-247) tmp = Float64(t_3 * cos((Float64(t_4 * (cbrt((Float64(((t_4 ^ 2.0) ^ 0.3333333333333333) * cbrt(t_4)) ^ 2.0)) ^ 3.0)) ^ 3.0))); else tmp = Float64(t_3 * cos(Float64(t_0 + Float64(y_46_im * log(x_46_im))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$3 = 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]}, Block[{t$95$4 = N[Power[t$95$2, 1/3], $MachinePrecision]}, If[LessEqual[x$46$im, -2e+132], N[(N[Exp[N[(N[(N[Log[(-x$46$im)], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -1e-8], N[(t$95$3 * N[Cos[N[Power[t$95$2, 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 3.2e-247], N[(t$95$3 * N[Cos[N[Power[N[(t$95$4 * N[Power[N[Power[N[Power[N[(N[Power[N[Power[t$95$4, 2.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision] * N[Power[t$95$4, 1/3], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Cos[N[(t$95$0 + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := \sqrt[3]{\mathsf{fma}\left(t\_1, y.im, t\_0\right)}\\
t_3 := e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
t_4 := \sqrt[3]{t\_2}\\
\mathbf{if}\;x.im \leq -2 \cdot 10^{+132}:\\
\;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos t\_0\\
\mathbf{elif}\;x.im \leq -1 \cdot 10^{-8}:\\
\;\;\;\;t\_3 \cdot \cos \left({t\_2}^{3}\right)\\
\mathbf{elif}\;x.im \leq 3.2 \cdot 10^{-247}:\\
\;\;\;\;t\_3 \cdot \cos \left({\left(t\_4 \cdot {\left(\sqrt[3]{{\left({\left({t\_4}^{2}\right)}^{0.3333333333333333} \cdot \sqrt[3]{t\_4}\right)}^{2}}\right)}^{3}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \cos \left(t\_0 + y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -1.99999999999999998e132Initial program 7.7%
Taylor expanded in y.im around 0 54.5%
Taylor expanded in x.im around -inf 82.1%
mul-1-neg82.1%
Simplified82.1%
if -1.99999999999999998e132 < x.im < -1e-8Initial program 48.4%
cancel-sign-sub-inv48.4%
fma-define48.4%
hypot-define48.4%
distribute-lft-neg-in48.4%
distribute-rgt-neg-out48.4%
fma-define48.4%
hypot-define67.8%
*-commutative67.8%
Simplified67.8%
fma-undefine67.8%
hypot-define48.4%
*-commutative48.4%
add-cube-cbrt64.5%
pow367.7%
fma-define67.7%
hypot-define94.4%
Applied egg-rr94.4%
if -1e-8 < x.im < 3.19999999999999993e-247Initial program 50.0%
cancel-sign-sub-inv50.0%
fma-define50.0%
hypot-define50.0%
distribute-lft-neg-in50.0%
distribute-rgt-neg-out50.0%
fma-define50.0%
hypot-define74.3%
*-commutative74.3%
Simplified74.3%
fma-undefine74.3%
hypot-define50.0%
*-commutative50.0%
add-cube-cbrt49.7%
pow351.0%
fma-define51.0%
hypot-define80.7%
Applied egg-rr80.7%
add-cube-cbrt79.4%
pow380.7%
Applied egg-rr80.7%
add-cube-cbrt79.3%
unpow-prod-down78.2%
cbrt-unprod75.3%
pow275.3%
pow378.0%
Applied egg-rr74.5%
pow1/331.3%
add-cube-cbrt33.0%
unpow-prod-down31.7%
pow231.7%
pow1/386.0%
Applied egg-rr86.0%
if 3.19999999999999993e-247 < x.im Initial program 39.2%
cancel-sign-sub-inv39.2%
fma-define39.2%
hypot-define39.2%
distribute-lft-neg-in39.2%
distribute-rgt-neg-out39.2%
fma-define39.2%
hypot-define81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in x.re around 0 86.1%
Final simplification86.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= x.im -1e+131)
(* (exp (- (* (log (- x.im)) y.re) (* (atan2 x.im x.re) y.im))) (cos t_0))
(if (<= x.im 6.5e-247)
(* t_2 (cos (pow (cbrt (fma t_1 y.im t_0)) 3.0)))
(* t_2 (cos (+ t_0 (* y.im (log x.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (x_46_im <= -1e+131) {
tmp = exp(((log(-x_46_im) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(t_0);
} else if (x_46_im <= 6.5e-247) {
tmp = t_2 * cos(pow(cbrt(fma(t_1, y_46_im, t_0)), 3.0));
} else {
tmp = t_2 * cos((t_0 + (y_46_im * log(x_46_im))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (x_46_im <= -1e+131) tmp = Float64(exp(Float64(Float64(log(Float64(-x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(t_0)); elseif (x_46_im <= 6.5e-247) tmp = Float64(t_2 * cos((cbrt(fma(t_1, y_46_im, t_0)) ^ 3.0))); else tmp = Float64(t_2 * cos(Float64(t_0 + Float64(y_46_im * log(x_46_im))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[x$46$im, -1e+131], N[(N[Exp[N[(N[(N[Log[(-x$46$im)], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 6.5e-247], N[(t$95$2 * N[Cos[N[Power[N[Power[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Cos[N[(t$95$0 + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;x.im \leq -1 \cdot 10^{+131}:\\
\;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos t\_0\\
\mathbf{elif}\;x.im \leq 6.5 \cdot 10^{-247}:\\
\;\;\;\;t\_2 \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(t\_1, y.im, t\_0\right)}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \cos \left(t\_0 + y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -9.9999999999999991e130Initial program 7.7%
Taylor expanded in y.im around 0 54.5%
Taylor expanded in x.im around -inf 82.1%
mul-1-neg82.1%
Simplified82.1%
if -9.9999999999999991e130 < x.im < 6.4999999999999996e-247Initial program 49.5%
cancel-sign-sub-inv49.5%
fma-define49.5%
hypot-define49.5%
distribute-lft-neg-in49.5%
distribute-rgt-neg-out49.5%
fma-define49.5%
hypot-define72.4%
*-commutative72.4%
Simplified72.4%
fma-undefine72.4%
hypot-define49.5%
*-commutative49.5%
add-cube-cbrt54.0%
pow355.9%
fma-define55.9%
hypot-define84.7%
Applied egg-rr84.7%
if 6.4999999999999996e-247 < x.im Initial program 39.2%
cancel-sign-sub-inv39.2%
fma-define39.2%
hypot-define39.2%
distribute-lft-neg-in39.2%
distribute-rgt-neg-out39.2%
fma-define39.2%
hypot-define81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in x.re around 0 86.1%
Final simplification84.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(exp
(fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= x.im -3.4e+129)
(* (exp (- (* (log (- x.im)) y.re) (* (atan2 x.im x.re) y.im))) (cos t_0))
(if (<= x.im -5e-309)
(* t_1 (cos (pow (cbrt (- t_0 (* y.im (log (/ -1.0 x.im))))) 3.0)))
(* t_1 (cos (+ t_0 (* y.im (log x.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (x_46_im <= -3.4e+129) {
tmp = exp(((log(-x_46_im) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(t_0);
} else if (x_46_im <= -5e-309) {
tmp = t_1 * cos(pow(cbrt((t_0 - (y_46_im * log((-1.0 / x_46_im))))), 3.0));
} else {
tmp = t_1 * cos((t_0 + (y_46_im * log(x_46_im))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (x_46_im <= -3.4e+129) tmp = Float64(exp(Float64(Float64(log(Float64(-x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(t_0)); elseif (x_46_im <= -5e-309) tmp = Float64(t_1 * cos((cbrt(Float64(t_0 - Float64(y_46_im * log(Float64(-1.0 / x_46_im))))) ^ 3.0))); else tmp = Float64(t_1 * cos(Float64(t_0 + Float64(y_46_im * log(x_46_im))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -3.4e+129], N[(N[Exp[N[(N[(N[Log[(-x$46$im)], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -5e-309], N[(t$95$1 * N[Cos[N[Power[N[Power[N[(t$95$0 - N[(y$46$im * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Cos[N[(t$95$0 + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;x.im \leq -3.4 \cdot 10^{+129}:\\
\;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos t\_0\\
\mathbf{elif}\;x.im \leq -5 \cdot 10^{-309}:\\
\;\;\;\;t\_1 \cdot \cos \left({\left(\sqrt[3]{t\_0 - y.im \cdot \log \left(\frac{-1}{x.im}\right)}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \cos \left(t\_0 + y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -3.40000000000000018e129Initial program 7.7%
Taylor expanded in y.im around 0 54.5%
Taylor expanded in x.im around -inf 82.1%
mul-1-neg82.1%
Simplified82.1%
if -3.40000000000000018e129 < x.im < -4.9999999999999995e-309Initial program 53.2%
cancel-sign-sub-inv53.2%
fma-define53.2%
hypot-define53.2%
distribute-lft-neg-in53.2%
distribute-rgt-neg-out53.2%
fma-define53.2%
hypot-define74.7%
*-commutative74.7%
Simplified74.7%
fma-undefine74.7%
hypot-define53.2%
*-commutative53.2%
add-cube-cbrt59.1%
pow361.5%
fma-define61.5%
hypot-define86.7%
Applied egg-rr86.7%
Taylor expanded in x.im around -inf 86.8%
+-commutative86.8%
mul-1-neg86.8%
unsub-neg86.8%
Simplified86.8%
if -4.9999999999999995e-309 < x.im Initial program 38.4%
cancel-sign-sub-inv38.4%
fma-define38.4%
hypot-define38.4%
distribute-lft-neg-in38.4%
distribute-rgt-neg-out38.4%
fma-define38.4%
hypot-define78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in x.re around 0 82.3%
Final simplification83.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (cos (fma t_0 y.im (* y.re (atan2 x.im x.re))))))
(if (<= y.re -3.6e+78)
(*
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im)))
t_1)
(* (exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im)))) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -3.6e+78) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * t_1;
} else {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -3.6e+78) tmp = Float64(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))) * t_1); else tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * t_1); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.6e+78], N[(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] * t$95$1), $MachinePrecision], 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] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{if}\;y.re \leq -3.6 \cdot 10^{+78}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot t\_1\\
\end{array}
\end{array}
if y.re < -3.6000000000000002e78Initial program 42.3%
exp-diff34.6%
exp-to-pow34.6%
hypot-define34.6%
*-commutative34.6%
exp-prod34.6%
fma-define34.6%
hypot-define73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in y.im around 0 92.4%
if -3.6000000000000002e78 < y.re Initial program 37.7%
cancel-sign-sub-inv37.7%
fma-define37.7%
hypot-define37.7%
distribute-lft-neg-in37.7%
distribute-rgt-neg-out37.7%
fma-define37.7%
hypot-define76.7%
*-commutative76.7%
Simplified76.7%
Final simplification79.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (cos t_0))
(t_2 (log (hypot x.re x.im)))
(t_3 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -1040000000000.0)
(* (exp (- (* (log (- x.im)) y.re) t_3)) t_1)
(if (<= x.im -5e-74)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_3)))
(if (<= x.im -8.5e-172)
(*
t_1
(exp
(-
(*
y.re
(log (* x.im (- -1.0 (* 0.5 (/ (pow x.re 2.0) (pow x.im 2.0)))))))
t_3)))
(if (<= x.im 3.55e-283)
(exp (* y.re t_2))
(*
(exp (fma t_2 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (+ t_0 (* y.im (log x.im)))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = cos(t_0);
double t_2 = log(hypot(x_46_re, x_46_im));
double t_3 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -1040000000000.0) {
tmp = exp(((log(-x_46_im) * y_46_re) - t_3)) * t_1;
} else if (x_46_im <= -5e-74) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_3));
} else if (x_46_im <= -8.5e-172) {
tmp = t_1 * exp(((y_46_re * log((x_46_im * (-1.0 - (0.5 * (pow(x_46_re, 2.0) / pow(x_46_im, 2.0))))))) - t_3));
} else if (x_46_im <= 3.55e-283) {
tmp = exp((y_46_re * t_2));
} else {
tmp = exp(fma(t_2, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((t_0 + (y_46_im * log(x_46_im))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = cos(t_0) t_2 = log(hypot(x_46_re, x_46_im)) t_3 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_im <= -1040000000000.0) tmp = Float64(exp(Float64(Float64(log(Float64(-x_46_im)) * y_46_re) - t_3)) * t_1); elseif (x_46_im <= -5e-74) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * 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 (x_46_im <= -8.5e-172) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(x_46_im * Float64(-1.0 - Float64(0.5 * Float64((x_46_re ^ 2.0) / (x_46_im ^ 2.0))))))) - t_3))); elseif (x_46_im <= 3.55e-283) tmp = exp(Float64(y_46_re * t_2)); else tmp = Float64(exp(fma(t_2, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(Float64(t_0 + Float64(y_46_im * log(x_46_im))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -1040000000000.0], N[(N[Exp[N[(N[(N[Log[(-x$46$im)], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[x$46$im, -5e-74], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(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]), $MachinePrecision], If[LessEqual[x$46$im, -8.5e-172], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[N[(x$46$im * N[(-1.0 - N[(0.5 * N[(N[Power[x$46$re, 2.0], $MachinePrecision] / N[Power[x$46$im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 3.55e-283], N[Exp[N[(y$46$re * t$95$2), $MachinePrecision]], $MachinePrecision], N[(N[Exp[N[(t$95$2 * 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 + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \cos t\_0\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -1040000000000:\\
\;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - t\_3} \cdot t\_1\\
\mathbf{elif}\;x.im \leq -5 \cdot 10^{-74}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_3}\\
\mathbf{elif}\;x.im \leq -8.5 \cdot 10^{-172}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log \left(x.im \cdot \left(-1 - 0.5 \cdot \frac{{x.re}^{2}}{{x.im}^{2}}\right)\right) - t\_3}\\
\mathbf{elif}\;x.im \leq 3.55 \cdot 10^{-283}:\\
\;\;\;\;e^{y.re \cdot t\_2}\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_2, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(t\_0 + y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -1.04e12Initial program 24.6%
Taylor expanded in y.im around 0 62.0%
Taylor expanded in x.im around -inf 80.0%
mul-1-neg80.0%
Simplified80.0%
if -1.04e12 < x.im < -4.99999999999999998e-74Initial program 53.8%
Taylor expanded in y.re around 0 69.2%
unpow269.2%
unpow269.2%
hypot-undefine77.2%
Simplified77.2%
if -4.99999999999999998e-74 < x.im < -8.49999999999999963e-172Initial program 58.2%
Taylor expanded in y.im around 0 82.1%
Taylor expanded in x.im around -inf 82.2%
mul-1-neg82.2%
*-commutative82.2%
distribute-rgt-neg-in82.2%
Simplified82.2%
if -8.49999999999999963e-172 < x.im < 3.5499999999999999e-283Initial program 46.9%
Taylor expanded in y.im around 0 60.6%
Taylor expanded in y.re around 0 73.1%
Taylor expanded in y.re around inf 73.1%
+-commutative73.1%
unpow273.1%
unpow273.1%
hypot-undefine77.4%
Simplified77.4%
if 3.5499999999999999e-283 < x.im Initial program 39.0%
cancel-sign-sub-inv39.0%
fma-define39.0%
hypot-define39.0%
distribute-lft-neg-in39.0%
distribute-rgt-neg-out39.0%
fma-define39.0%
hypot-define80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in x.re around 0 84.5%
Final simplification81.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (log (hypot x.re x.im)))
(t_2 (* y.re (atan2 x.im x.re))))
(if (<= y.re -1.2e+32)
(* (/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_0)) (cos (fma t_1 y.im t_2)))
(if (<= y.re 2.7e-7)
(* (cos (* y.im t_1)) (exp (* (atan2 x.im x.re) (- y.im))))
(*
(cos t_2)
(exp
(- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -1.2e+32) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0)) * cos(fma(t_1, y_46_im, t_2));
} else if (y_46_re <= 2.7e-7) {
tmp = cos((y_46_im * t_1)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = cos(t_2) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -1.2e+32) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_0)) * cos(fma(t_1, y_46_im, t_2))); elseif (y_46_re <= 2.7e-7) tmp = Float64(cos(Float64(y_46_im * t_1)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(cos(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_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.2e+32], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(t$95$1 * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.7e-7], N[(N[Cos[N[(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], N[(N[Cos[t$95$2], $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] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1.2 \cdot 10^{+32}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_0} \cdot \cos \left(\mathsf{fma}\left(t\_1, y.im, t\_2\right)\right)\\
\mathbf{elif}\;y.re \leq 2.7 \cdot 10^{-7}:\\
\;\;\;\;\cos \left(y.im \cdot t\_1\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos t\_2 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
\end{array}
\end{array}
if y.re < -1.19999999999999996e32Initial program 44.8%
exp-diff36.2%
exp-to-pow36.2%
hypot-define36.2%
*-commutative36.2%
exp-prod36.2%
fma-define36.2%
hypot-define72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in y.im around 0 89.7%
if -1.19999999999999996e32 < y.re < 2.70000000000000009e-7Initial program 38.3%
cancel-sign-sub-inv38.3%
fma-define38.3%
hypot-define38.3%
distribute-lft-neg-in38.3%
distribute-rgt-neg-out38.3%
fma-define38.3%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in y.re around 0 77.7%
neg-mul-177.7%
distribute-rgt-neg-in77.7%
Simplified77.7%
fma-undefine77.7%
hypot-define37.5%
*-commutative37.5%
add-cbrt-cube28.5%
pow1/322.2%
pow322.0%
fma-define22.0%
hypot-define40.2%
Applied egg-rr40.2%
Taylor expanded in y.im around inf 37.5%
+-commutative37.5%
unpow237.5%
unpow237.5%
hypot-undefine77.7%
Simplified77.7%
if 2.70000000000000009e-7 < y.re Initial program 34.3%
Taylor expanded in y.im around 0 74.3%
Final simplification79.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -1.2e+32)
t_0
(if (<= y.re 0.000145)
(*
(cos (* y.im (log (hypot x.re x.im))))
(exp (* (atan2 x.im x.re) (- y.im))))
(* (cos (* y.re (atan2 x.im x.re))) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double 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)));
double tmp;
if (y_46_re <= -1.2e+32) {
tmp = t_0;
} else if (y_46_re <= 0.000145) {
tmp = cos((y_46_im * log(hypot(x_46_re, x_46_im)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * 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.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -1.2e+32) {
tmp = t_0;
} else if (y_46_re <= 0.000145) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if y_46_re <= -1.2e+32: tmp = t_0 elif y_46_re <= 0.000145: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, 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))) tmp = 0.0 if (y_46_re <= -1.2e+32) tmp = t_0; elseif (y_46_re <= 0.000145) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_re, x_46_im)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * t_0); 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_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))); tmp = 0.0; if (y_46_re <= -1.2e+32) tmp = t_0; elseif (y_46_re <= 0.000145) tmp = cos((y_46_im * log(hypot(x_46_re, x_46_im)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * 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[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]}, If[LessEqual[y$46$re, -1.2e+32], t$95$0, If[LessEqual[y$46$re, 0.000145], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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}\\
\mathbf{if}\;y.re \leq -1.2 \cdot 10^{+32}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.000145:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.19999999999999996e32Initial program 44.8%
Taylor expanded in y.im around 0 82.8%
Taylor expanded in y.re around 0 84.5%
if -1.19999999999999996e32 < y.re < 1.45e-4Initial program 38.3%
cancel-sign-sub-inv38.3%
fma-define38.3%
hypot-define38.3%
distribute-lft-neg-in38.3%
distribute-rgt-neg-out38.3%
fma-define38.3%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in y.re around 0 77.7%
neg-mul-177.7%
distribute-rgt-neg-in77.7%
Simplified77.7%
fma-undefine77.7%
hypot-define37.5%
*-commutative37.5%
add-cbrt-cube28.5%
pow1/322.2%
pow322.0%
fma-define22.0%
hypot-define40.2%
Applied egg-rr40.2%
Taylor expanded in y.im around inf 37.5%
+-commutative37.5%
unpow237.5%
unpow237.5%
hypot-undefine77.7%
Simplified77.7%
if 1.45e-4 < y.re Initial program 34.3%
Taylor expanded in y.im around 0 74.3%
Final simplification78.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.2e+32) (not (<= y.re 0.000175)))
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(*
(cos (* y.im (log (hypot x.re x.im))))
(exp (* (atan2 x.im x.re) (- y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.2e+32) || !(y_46_re <= 0.000175)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = cos((y_46_im * log(hypot(x_46_re, x_46_im)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.2e+32) || !(y_46_re <= 0.000175)) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.2e+32) or not (y_46_re <= 0.000175): tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.2e+32) || !(y_46_re <= 0.000175)) 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(atan(x_46_im, x_46_re) * y_46_im))); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_re, x_46_im)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.2e+32) || ~((y_46_re <= 0.000175))) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))); else tmp = cos((y_46_im * log(hypot(x_46_re, x_46_im)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.2e+32], N[Not[LessEqual[y$46$re, 0.000175]], $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], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.2 \cdot 10^{+32} \lor \neg \left(y.re \leq 0.000175\right):\\
\;\;\;\;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}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.19999999999999996e32 or 1.74999999999999998e-4 < y.re Initial program 39.1%
Taylor expanded in y.im around 0 78.2%
Taylor expanded in y.re around 0 77.0%
if -1.19999999999999996e32 < y.re < 1.74999999999999998e-4Initial program 38.3%
cancel-sign-sub-inv38.3%
fma-define38.3%
hypot-define38.3%
distribute-lft-neg-in38.3%
distribute-rgt-neg-out38.3%
fma-define38.3%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in y.re around 0 77.7%
neg-mul-177.7%
distribute-rgt-neg-in77.7%
Simplified77.7%
fma-undefine77.7%
hypot-define37.5%
*-commutative37.5%
add-cbrt-cube28.5%
pow1/322.2%
pow322.0%
fma-define22.0%
hypot-define40.2%
Applied egg-rr40.2%
Taylor expanded in y.im around inf 37.5%
+-commutative37.5%
unpow237.5%
unpow237.5%
hypot-undefine77.7%
Simplified77.7%
Final simplification77.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -5e-24) (not (<= y.re 0.000175)))
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(* (cos (* y.re (atan2 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-24) || !(y_46_re <= 0.000175)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-5d-24)) .or. (.not. (y_46re <= 0.000175d0))) then
tmp = exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - (atan2(x_46im, x_46re) * y_46im)))
else
tmp = cos((y_46re * atan2(x_46im, x_46re))) * exp((atan2(x_46im, x_46re) * -y_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -5e-24) || !(y_46_re <= 0.000175)) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else {
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));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -5e-24) or not (y_46_re <= 0.000175): tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) else: 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)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -5e-24) || !(y_46_re <= 0.000175)) 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(atan(x_46_im, x_46_re) * y_46_im))); else 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)))); 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-24) || ~((y_46_re <= 0.000175))) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))); else tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -5e-24], N[Not[LessEqual[y$46$re, 0.000175]], $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], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5 \cdot 10^{-24} \lor \neg \left(y.re \leq 0.000175\right):\\
\;\;\;\;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}\\
\mathbf{else}:\\
\;\;\;\;\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)}\\
\end{array}
\end{array}
if y.re < -4.9999999999999998e-24 or 1.74999999999999998e-4 < y.re Initial program 38.2%
Taylor expanded in y.im around 0 75.6%
Taylor expanded in y.re around 0 74.5%
if -4.9999999999999998e-24 < y.re < 1.74999999999999998e-4Initial program 39.1%
cancel-sign-sub-inv39.1%
fma-define39.1%
hypot-define39.1%
distribute-lft-neg-in39.1%
distribute-rgt-neg-out39.1%
fma-define39.1%
hypot-define79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in y.re around 0 79.5%
neg-mul-179.5%
distribute-rgt-neg-in79.5%
Simplified79.5%
fma-undefine79.5%
hypot-define39.1%
*-commutative39.1%
add-cbrt-cube29.7%
pow1/323.3%
pow323.1%
fma-define23.1%
hypot-define41.9%
Applied egg-rr41.9%
Taylor expanded in y.im around 0 76.9%
Final simplification75.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -5e-24) (not (<= y.re 126000.0))) (exp (* y.re (log (hypot x.re x.im)))) (* (cos (* y.re (atan2 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-24) || !(y_46_re <= 126000.0)) {
tmp = exp((y_46_re * log(hypot(x_46_re, x_46_im))));
} else {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -5e-24) || !(y_46_re <= 126000.0)) {
tmp = Math.exp((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))));
} else {
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));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -5e-24) or not (y_46_re <= 126000.0): tmp = math.exp((y_46_re * math.log(math.hypot(x_46_re, x_46_im)))) else: 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)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -5e-24) || !(y_46_re <= 126000.0)) tmp = exp(Float64(y_46_re * log(hypot(x_46_re, x_46_im)))); else 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)))); 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-24) || ~((y_46_re <= 126000.0))) tmp = exp((y_46_re * log(hypot(x_46_re, x_46_im)))); else tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -5e-24], N[Not[LessEqual[y$46$re, 126000.0]], $MachinePrecision]], N[Exp[N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5 \cdot 10^{-24} \lor \neg \left(y.re \leq 126000\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\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)}\\
\end{array}
\end{array}
if y.re < -4.9999999999999998e-24 or 126000 < y.re Initial program 38.6%
Taylor expanded in y.im around 0 74.9%
Taylor expanded in y.re around 0 74.9%
Taylor expanded in y.re around inf 72.6%
+-commutative72.6%
unpow272.6%
unpow272.6%
hypot-undefine72.6%
Simplified72.6%
if -4.9999999999999998e-24 < y.re < 126000Initial program 38.7%
cancel-sign-sub-inv38.7%
fma-define38.7%
hypot-define38.7%
distribute-lft-neg-in38.7%
distribute-rgt-neg-out38.7%
fma-define38.7%
hypot-define79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.re around 0 78.0%
neg-mul-178.0%
distribute-rgt-neg-in78.0%
Simplified78.0%
fma-undefine78.0%
hypot-define38.1%
*-commutative38.1%
add-cbrt-cube29.0%
pow1/322.5%
pow322.4%
fma-define22.4%
hypot-define40.6%
Applied egg-rr40.6%
Taylor expanded in y.im around 0 76.3%
Final simplification74.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -5e-24) (not (<= y.re 126000.0))) (exp (* y.re (log (hypot x.re x.im)))) (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-24) || !(y_46_re <= 126000.0)) {
tmp = exp((y_46_re * log(hypot(x_46_re, x_46_im))));
} 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-24) || !(y_46_re <= 126000.0)) {
tmp = Math.exp((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))));
} 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-24) or not (y_46_re <= 126000.0): tmp = math.exp((y_46_re * math.log(math.hypot(x_46_re, x_46_im)))) 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-24) || !(y_46_re <= 126000.0)) tmp = exp(Float64(y_46_re * log(hypot(x_46_re, x_46_im)))); 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-24) || ~((y_46_re <= 126000.0))) tmp = exp((y_46_re * log(hypot(x_46_re, x_46_im)))); 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-24], N[Not[LessEqual[y$46$re, 126000.0]], $MachinePrecision]], N[Exp[N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 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^{-24} \lor \neg \left(y.re \leq 126000\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -4.9999999999999998e-24 or 126000 < y.re Initial program 38.6%
Taylor expanded in y.im around 0 74.9%
Taylor expanded in y.re around 0 74.9%
Taylor expanded in y.re around inf 72.6%
+-commutative72.6%
unpow272.6%
unpow272.6%
hypot-undefine72.6%
Simplified72.6%
if -4.9999999999999998e-24 < y.re < 126000Initial program 38.7%
Taylor expanded in y.im around 0 46.2%
Taylor expanded in y.re around 0 45.1%
Taylor expanded in y.re around 0 76.2%
neg-mul-176.2%
distribute-lft-neg-in76.2%
*-commutative76.2%
Simplified76.2%
Final simplification74.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 38.7%
Taylor expanded in y.im around 0 60.8%
Taylor expanded in y.re around 0 60.2%
Taylor expanded in y.re around 0 49.4%
neg-mul-149.4%
distribute-lft-neg-in49.4%
*-commutative49.4%
Simplified49.4%
Final simplification49.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) * 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 38.7%
Taylor expanded in y.im around 0 60.8%
Taylor expanded in y.re around 0 60.2%
Taylor expanded in y.re around 0 49.4%
neg-mul-149.4%
distribute-lft-neg-in49.4%
*-commutative49.4%
Simplified49.4%
add-sqr-sqrt25.3%
sqrt-unprod36.6%
sqr-neg36.6%
sqrt-unprod11.8%
add-sqr-sqrt26.7%
add-log-exp27.2%
log-pow27.5%
*-un-lft-identity27.5%
log-prod27.5%
metadata-eval27.5%
pow-exp26.7%
rem-log-exp26.7%
Applied egg-rr26.7%
+-lft-identity26.7%
Simplified26.7%
Final simplification26.7%
herbie shell --seed 2024100
(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)))))