
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (log (hypot x.im x.re)))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (* (atan2 x.im x.re) (- y.im)))
(t_4 (log (hypot x.re x.im))))
(if (<= x.im -6.6e+43)
(exp (- t_3 (* y.re (log (/ -1.0 x.im)))))
(if (<= x.im 2.6e-141)
(* (exp (fma t_4 y.re t_3)) (cos (fma t_4 y.im t_2)))
(if (<= x.im 20000000.0)
(*
(fabs (cos (fma y.re (atan2 x.im x.re) (* t_1 y.im))))
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))
(* (exp (- (* (fabs t_1) y.re) t_0)) (cos t_2)))))))
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_im, x_46_re));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = atan2(x_46_im, x_46_re) * -y_46_im;
double t_4 = log(hypot(x_46_re, x_46_im));
double tmp;
if (x_46_im <= -6.6e+43) {
tmp = exp((t_3 - (y_46_re * log((-1.0 / x_46_im)))));
} else if (x_46_im <= 2.6e-141) {
tmp = exp(fma(t_4, y_46_re, t_3)) * cos(fma(t_4, y_46_im, t_2));
} else if (x_46_im <= 20000000.0) {
tmp = fabs(cos(fma(y_46_re, atan2(x_46_im, x_46_re), (t_1 * y_46_im)))) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
} else {
tmp = exp(((fabs(t_1) * y_46_re) - t_0)) * cos(t_2);
}
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_im, x_46_re)) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) t_4 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (x_46_im <= -6.6e+43) tmp = exp(Float64(t_3 - Float64(y_46_re * log(Float64(-1.0 / x_46_im))))); elseif (x_46_im <= 2.6e-141) tmp = Float64(exp(fma(t_4, y_46_re, t_3)) * cos(fma(t_4, y_46_im, t_2))); elseif (x_46_im <= 20000000.0) tmp = Float64(abs(cos(fma(y_46_re, atan(x_46_im, x_46_re), Float64(t_1 * y_46_im)))) * 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))); else tmp = Float64(exp(Float64(Float64(abs(t_1) * y_46_re) - t_0)) * cos(t_2)); 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]}, Block[{t$95$4 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -6.6e+43], N[Exp[N[(t$95$3 - N[(y$46$re * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$im, 2.6e-141], N[(N[Exp[N[(t$95$4 * y$46$re + t$95$3), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$4 * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 20000000.0], N[(N[Abs[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(t$95$1 * y$46$im), $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$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(N[Abs[t$95$1], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$2], $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.im, x.re\right)\right)\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\\
t_4 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;x.im \leq -6.6 \cdot 10^{+43}:\\
\;\;\;\;e^{t\_3 - y.re \cdot \log \left(\frac{-1}{x.im}\right)}\\
\mathbf{elif}\;x.im \leq 2.6 \cdot 10^{-141}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_4, y.re, t\_3\right)} \cdot \cos \left(\mathsf{fma}\left(t\_4, y.im, t\_2\right)\right)\\
\mathbf{elif}\;x.im \leq 20000000:\\
\;\;\;\;\left|\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_1 \cdot y.im\right)\right)\right| \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;e^{\left|t\_1\right| \cdot y.re - t\_0} \cdot \cos t\_2\\
\end{array}
\end{array}
if x.im < -6.6000000000000003e43Initial program 30.5%
cancel-sign-sub-inv30.5%
fma-define30.5%
hypot-define30.5%
distribute-lft-neg-in30.5%
distribute-rgt-neg-out30.5%
fma-define30.5%
hypot-define77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in x.im around -inf 78.9%
+-commutative78.9%
mul-1-neg78.9%
unsub-neg78.9%
*-commutative78.9%
mul-1-neg78.9%
unsub-neg78.9%
neg-mul-178.9%
distribute-rgt-neg-in78.9%
Simplified78.9%
Taylor expanded in y.re around 0 80.6%
cos-neg80.6%
Simplified80.6%
Taylor expanded in y.im around 0 86.8%
if -6.6000000000000003e43 < x.im < 2.60000000000000011e-141Initial 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-define86.6%
*-commutative86.6%
Simplified86.6%
if 2.60000000000000011e-141 < x.im < 2e7Initial program 62.0%
fma-define49.8%
hypot-define53.0%
*-commutative53.0%
add-sqr-sqrt37.1%
sqrt-unprod69.3%
pow269.3%
Applied egg-rr80.8%
unpow269.3%
rem-sqrt-square69.3%
*-commutative69.3%
hypot-undefine65.4%
unpow265.4%
unpow265.4%
+-commutative65.4%
unpow265.4%
unpow265.4%
hypot-undefine69.3%
Simplified80.8%
if 2e7 < x.im Initial program 29.2%
hypot-define29.2%
add-sqr-sqrt29.2%
sqrt-unprod29.2%
pow229.2%
Applied egg-rr29.2%
hypot-undefine29.2%
unpow229.2%
unpow229.2%
+-commutative29.2%
unpow229.2%
rem-sqrt-square29.2%
unpow229.2%
unpow229.2%
hypot-undefine29.2%
Simplified29.2%
Taylor expanded in y.im around 0 84.9%
Final simplification85.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))) (t_1 (log (hypot x.re x.im))))
(if (or (<= x.im -5e+220) (not (<= x.im 1.08e-49)))
(*
(exp (- (* (fabs t_0) y.re) (* (atan2 x.im x.re) y.im)))
(fabs (cos (fma y.re (atan2 x.im x.re) (* t_0 y.im)))))
(*
(exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_1 y.im (* y.re (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((x_46_im <= -5e+220) || !(x_46_im <= 1.08e-49)) {
tmp = exp(((fabs(t_0) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * fabs(cos(fma(y_46_re, atan2(x_46_im, x_46_re), (t_0 * y_46_im))));
} else {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if ((x_46_im <= -5e+220) || !(x_46_im <= 1.08e-49)) tmp = Float64(exp(Float64(Float64(abs(t_0) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * abs(cos(fma(y_46_re, atan(x_46_im, x_46_re), Float64(t_0 * y_46_im))))); else tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x$46$im, -5e+220], N[Not[LessEqual[x$46$im, 1.08e-49]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Abs[t$95$0], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(t$95$0 * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;x.im \leq -5 \cdot 10^{+220} \lor \neg \left(x.im \leq 1.08 \cdot 10^{-49}\right):\\
\;\;\;\;e^{\left|t\_0\right| \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left|\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_0 \cdot y.im\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if x.im < -5.0000000000000002e220 or 1.08e-49 < x.im Initial program 28.0%
hypot-define28.0%
add-sqr-sqrt23.7%
sqrt-unprod28.0%
pow228.0%
Applied egg-rr28.0%
hypot-undefine28.0%
unpow228.0%
unpow228.0%
+-commutative28.0%
unpow228.0%
rem-sqrt-square28.0%
unpow228.0%
unpow228.0%
hypot-undefine28.0%
Simplified28.0%
fma-define28.0%
hypot-define70.9%
*-commutative70.9%
add-sqr-sqrt51.5%
sqrt-unprod85.1%
pow285.1%
Applied egg-rr85.1%
unpow285.1%
rem-sqrt-square85.1%
*-commutative85.1%
hypot-undefine33.4%
unpow233.4%
unpow233.4%
+-commutative33.4%
unpow233.4%
unpow233.4%
hypot-undefine85.1%
Simplified85.1%
if -5.0000000000000002e220 < x.im < 1.08e-49Initial program 51.6%
cancel-sign-sub-inv51.6%
fma-define51.6%
hypot-define51.6%
distribute-lft-neg-in51.6%
distribute-rgt-neg-out51.6%
fma-define51.6%
hypot-define84.3%
*-commutative84.3%
Simplified84.3%
Final simplification84.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (hypot x.re x.im)))
(t_3 (log (hypot x.im x.re))))
(if (<= y.re -1.1e-55)
(*
(exp (fma t_2 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_2 y.im t_1)))
(if (<= y.re 6.5e+14)
(* (exp (- (* (fabs t_3) y.re) t_0)) (cos t_1))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(cos (* t_3 y.im)))))))
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 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(hypot(x_46_re, x_46_im));
double t_3 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -1.1e-55) {
tmp = exp(fma(t_2, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_2, y_46_im, t_1));
} else if (y_46_re <= 6.5e+14) {
tmp = exp(((fabs(t_3) * y_46_re) - t_0)) * cos(t_1);
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * cos((t_3 * y_46_im));
}
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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(hypot(x_46_re, x_46_im)) t_3 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -1.1e-55) tmp = Float64(exp(fma(t_2, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_2, y_46_im, t_1))); elseif (y_46_re <= 6.5e+14) tmp = Float64(exp(Float64(Float64(abs(t_3) * y_46_re) - t_0)) * cos(t_1)); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * cos(Float64(t_3 * y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.1e-55], 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$2 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.5e+14], N[(N[Exp[N[(N[(N[Abs[t$95$3], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$3 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -1.1 \cdot 10^{-55}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_2, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_2, y.im, t\_1\right)\right)\\
\mathbf{elif}\;y.re \leq 6.5 \cdot 10^{+14}:\\
\;\;\;\;e^{\left|t\_3\right| \cdot y.re - t\_0} \cdot \cos t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \cos \left(t\_3 \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -1.1e-55Initial program 43.8%
cancel-sign-sub-inv43.8%
fma-define43.8%
hypot-define43.8%
distribute-lft-neg-in43.8%
distribute-rgt-neg-out43.8%
fma-define43.8%
hypot-define81.1%
*-commutative81.1%
Simplified81.1%
if -1.1e-55 < y.re < 6.5e14Initial program 43.4%
hypot-define43.4%
add-sqr-sqrt24.6%
sqrt-unprod43.3%
pow243.3%
Applied egg-rr43.3%
hypot-undefine43.3%
unpow243.3%
unpow243.3%
+-commutative43.3%
unpow243.3%
rem-sqrt-square43.3%
unpow243.3%
unpow243.3%
hypot-undefine43.3%
Simplified43.3%
Taylor expanded in y.im around 0 89.1%
if 6.5e14 < y.re Initial program 41.1%
Taylor expanded in y.re around 0 42.9%
*-commutative42.9%
unpow242.9%
unpow242.9%
hypot-undefine75.0%
Simplified75.0%
Final simplification83.8%
(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.im x.re))))
(if (or (<= y.re -100000000.0) (not (<= y.re 5.8e+18)))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(cos (* t_1 y.im)))
(* (exp (- (* (fabs t_1) y.re) t_0)) (cos (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((y_46_re <= -100000000.0) || !(y_46_re <= 5.8e+18)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * cos((t_1 * y_46_im));
} else {
tmp = exp(((fabs(t_1) * y_46_re) - t_0)) * cos((y_46_re * 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 t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if ((y_46_re <= -100000000.0) || !(y_46_re <= 5.8e+18)) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * Math.cos((t_1 * y_46_im));
} else {
tmp = Math.exp(((Math.abs(t_1) * y_46_re) - t_0)) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.log(math.hypot(x_46_im, x_46_re)) tmp = 0 if (y_46_re <= -100000000.0) or not (y_46_re <= 5.8e+18): tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * math.cos((t_1 * y_46_im)) else: tmp = math.exp(((math.fabs(t_1) * y_46_re) - t_0)) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -100000000.0) || !(y_46_re <= 5.8e+18)) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * cos(Float64(t_1 * y_46_im))); else tmp = Float64(exp(Float64(Float64(abs(t_1) * y_46_re) - t_0)) * cos(Float64(y_46_re * 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) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = log(hypot(x_46_im, x_46_re)); tmp = 0.0; if ((y_46_re <= -100000000.0) || ~((y_46_re <= 5.8e+18))) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * cos((t_1 * y_46_im)); else tmp = exp(((abs(t_1) * y_46_re) - t_0)) * cos((y_46_re * 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_] := 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -100000000.0], N[Not[LessEqual[y$46$re, 5.8e+18]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(N[Abs[t$95$1], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -100000000 \lor \neg \left(y.re \leq 5.8 \cdot 10^{+18}\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \cos \left(t\_1 \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\left|t\_1\right| \cdot y.re - t\_0} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if y.re < -1e8 or 5.8e18 < y.re Initial program 42.9%
Taylor expanded in y.re around 0 44.6%
*-commutative44.6%
unpow244.6%
unpow244.6%
hypot-undefine80.4%
Simplified80.4%
if -1e8 < y.re < 5.8e18Initial program 43.1%
hypot-define43.1%
add-sqr-sqrt24.5%
sqrt-unprod43.1%
pow243.1%
Applied egg-rr43.1%
hypot-undefine43.1%
unpow243.1%
unpow243.1%
+-commutative43.1%
unpow243.1%
rem-sqrt-square43.1%
unpow243.1%
unpow243.1%
hypot-undefine43.1%
Simplified43.1%
Taylor expanded in y.im around 0 86.3%
Final simplification83.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (cos t_1)))
(if (<= y.re -4.5e+148)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_2)
(if (<= y.re 2e+148)
(* (exp (- (* (fabs (log (hypot x.im x.re))) y.re) t_0)) t_2)
(* (cos (pow (cbrt t_1) 3.0)) (pow (hypot x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = cos(t_1);
double tmp;
if (y_46_re <= -4.5e+148) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
} else if (y_46_re <= 2e+148) {
tmp = exp(((fabs(log(hypot(x_46_im, x_46_re))) * y_46_re) - t_0)) * t_2;
} else {
tmp = cos(pow(cbrt(t_1), 3.0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.cos(t_1);
double tmp;
if (y_46_re <= -4.5e+148) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
} else if (y_46_re <= 2e+148) {
tmp = Math.exp(((Math.abs(Math.log(Math.hypot(x_46_im, x_46_re))) * y_46_re) - t_0)) * t_2;
} else {
tmp = Math.cos(Math.pow(Math.cbrt(t_1), 3.0)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = cos(t_1) tmp = 0.0 if (y_46_re <= -4.5e+148) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * t_2); elseif (y_46_re <= 2e+148) tmp = Float64(exp(Float64(Float64(abs(log(hypot(x_46_im, x_46_re))) * y_46_re) - t_0)) * t_2); else tmp = Float64(cos((cbrt(t_1) ^ 3.0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, If[LessEqual[y$46$re, -4.5e+148], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 2e+148], N[(N[Exp[N[(N[(N[Abs[N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[Cos[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \cos t\_1\\
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{+148}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot t\_2\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{+148}:\\
\;\;\;\;e^{\left|\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right| \cdot y.re - t\_0} \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{t\_1}\right)}^{3}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -4.49999999999999994e148Initial program 37.0%
Taylor expanded in y.im around 0 81.5%
if -4.49999999999999994e148 < y.re < 2.0000000000000001e148Initial program 46.4%
hypot-define46.4%
add-sqr-sqrt29.0%
sqrt-unprod43.9%
pow243.9%
Applied egg-rr43.9%
hypot-undefine43.9%
unpow243.9%
unpow243.9%
+-commutative43.9%
unpow243.9%
rem-sqrt-square43.9%
unpow243.9%
unpow243.9%
hypot-undefine43.9%
Simplified43.9%
Taylor expanded in y.im around 0 83.2%
if 2.0000000000000001e148 < y.re Initial program 28.6%
cancel-sign-sub-inv28.6%
fma-define28.6%
hypot-define28.6%
distribute-lft-neg-in28.6%
distribute-rgt-neg-out28.6%
fma-define28.6%
hypot-define60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in y.im around 0 57.2%
unpow257.2%
unpow257.2%
hypot-undefine57.2%
Simplified57.2%
expm1-log1p-u37.2%
add-cube-cbrt31.5%
pow334.3%
expm1-log1p-u65.8%
Applied egg-rr65.8%
Final simplification80.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (cos (* y.re (atan2 x.im x.re)))))
(if (or (<= y.re -1700.0) (not (<= y.re 1.25e-17)))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_1)
(* t_1 (/ 1.0 (exp 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 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_re <= -1700.0) || !(y_46_re <= 1.25e-17)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1;
} else {
tmp = t_1 * (1.0 / exp(t_0));
}
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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = cos((y_46re * atan2(x_46im, x_46re)))
if ((y_46re <= (-1700.0d0)) .or. (.not. (y_46re <= 1.25d-17))) then
tmp = exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - t_0)) * t_1
else
tmp = t_1 * (1.0d0 / exp(t_0))
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 t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_re <= -1700.0) || !(y_46_re <= 1.25e-17)) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1;
} else {
tmp = t_1 * (1.0 / Math.exp(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) * y_46_im t_1 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_re <= -1700.0) or not (y_46_re <= 1.25e-17): tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1 else: tmp = t_1 * (1.0 / math.exp(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 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_re <= -1700.0) || !(y_46_re <= 1.25e-17)) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * t_1); else tmp = Float64(t_1 * Float64(1.0 / exp(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) * y_46_im; t_1 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if ((y_46_re <= -1700.0) || ~((y_46_re <= 1.25e-17))) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1; else tmp = t_1 * (1.0 / exp(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -1700.0], N[Not[LessEqual[y$46$re, 1.25e-17]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(1.0 / N[Exp[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 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -1700 \lor \neg \left(y.re \leq 1.25 \cdot 10^{-17}\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{1}{e^{t\_0}}\\
\end{array}
\end{array}
if y.re < -1700 or 1.25e-17 < y.re Initial program 45.0%
Taylor expanded in y.im around 0 74.2%
if -1700 < y.re < 1.25e-17Initial program 41.2%
exp-diff41.2%
exp-to-pow41.2%
hypot-define41.2%
*-commutative41.2%
exp-prod41.1%
fma-define41.1%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.re around 0 81.0%
Taylor expanded in y.im around 0 85.6%
Final simplification80.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -6.4e-12)
(* t_0 (pow (sqrt (+ (pow x.im 2.0) (pow x.re 2.0))) y.re))
(if (<= y.re 270.0)
(* t_0 (/ 1.0 (exp (* (atan2 x.im x.re) y.im))))
(* t_0 (pow (hypot x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -6.4e-12) {
tmp = t_0 * pow(sqrt((pow(x_46_im, 2.0) + pow(x_46_re, 2.0))), y_46_re);
} else if (y_46_re <= 270.0) {
tmp = t_0 * (1.0 / exp((atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -6.4e-12) {
tmp = t_0 * Math.pow(Math.sqrt((Math.pow(x_46_im, 2.0) + Math.pow(x_46_re, 2.0))), y_46_re);
} else if (y_46_re <= 270.0) {
tmp = t_0 * (1.0 / Math.exp((Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -6.4e-12: tmp = t_0 * math.pow(math.sqrt((math.pow(x_46_im, 2.0) + math.pow(x_46_re, 2.0))), y_46_re) elif y_46_re <= 270.0: tmp = t_0 * (1.0 / math.exp((math.atan2(x_46_im, x_46_re) * y_46_im))) else: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -6.4e-12) tmp = Float64(t_0 * (sqrt(Float64((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re)); elseif (y_46_re <= 270.0) tmp = Float64(t_0 * Float64(1.0 / exp(Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -6.4e-12) tmp = t_0 * (sqrt(((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re); elseif (y_46_re <= 270.0) tmp = t_0 * (1.0 / exp((atan2(x_46_im, x_46_re) * y_46_im))); else tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -6.4e-12], N[(t$95$0 * N[Power[N[Sqrt[N[(N[Power[x$46$im, 2.0], $MachinePrecision] + N[Power[x$46$re, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 270.0], N[(t$95$0 * N[(1.0 / N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -6.4 \cdot 10^{-12}:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 270:\\
\;\;\;\;t\_0 \cdot \frac{1}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -6.4000000000000002e-12Initial program 43.5%
cancel-sign-sub-inv43.5%
fma-define43.5%
hypot-define43.5%
distribute-lft-neg-in43.5%
distribute-rgt-neg-out43.5%
fma-define43.5%
hypot-define82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in y.im around 0 72.8%
if -6.4000000000000002e-12 < y.re < 270Initial program 43.8%
exp-diff43.1%
exp-to-pow43.1%
hypot-define43.1%
*-commutative43.1%
exp-prod43.0%
fma-define43.0%
hypot-define81.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in y.re around 0 82.2%
Taylor expanded in y.im around 0 86.8%
if 270 < y.re Initial program 40.4%
cancel-sign-sub-inv40.4%
fma-define40.4%
hypot-define40.4%
distribute-lft-neg-in40.4%
distribute-rgt-neg-out40.4%
fma-define40.4%
hypot-define68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in y.im around 0 63.3%
unpow263.3%
unpow263.3%
hypot-undefine63.3%
Simplified63.3%
Final simplification78.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (or (<= y.re -1820.0) (not (<= y.re 39000.0)))
(* t_0 (pow (hypot x.im x.re) y.re))
(* t_0 (/ 1.0 (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 t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_re <= -1820.0) || !(y_46_re <= 39000.0)) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * (1.0 / 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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_re <= -1820.0) || !(y_46_re <= 39000.0)) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * (1.0 / 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): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_re <= -1820.0) or not (y_46_re <= 39000.0): tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * (1.0 / 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) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_re <= -1820.0) || !(y_46_re <= 39000.0)) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * Float64(1.0 / exp(Float64(atan(x_46_im, x_46_re) * y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if ((y_46_re <= -1820.0) || ~((y_46_re <= 39000.0))) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0 * (1.0 / 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_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -1820.0], N[Not[LessEqual[y$46$re, 39000.0]], $MachinePrecision]], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 / N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -1820 \lor \neg \left(y.re \leq 39000\right):\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\end{array}
\end{array}
if y.re < -1820 or 39000 < y.re Initial program 42.6%
cancel-sign-sub-inv42.6%
fma-define42.6%
hypot-define42.6%
distribute-lft-neg-in42.6%
distribute-rgt-neg-out42.6%
fma-define42.6%
hypot-define76.5%
*-commutative76.5%
Simplified76.5%
Taylor expanded in y.im around 0 68.9%
unpow268.9%
unpow268.9%
hypot-undefine68.9%
Simplified68.9%
if -1820 < y.re < 39000Initial program 43.3%
exp-diff42.6%
exp-to-pow42.6%
hypot-define42.6%
*-commutative42.6%
exp-prod42.5%
fma-define42.5%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.re around 0 81.3%
Taylor expanded in y.im around 0 85.7%
Final simplification78.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -2.2e-28) (exp (- (* (atan2 x.im x.re) (- y.im)) (* y.re (log (/ -1.0 x.im))))) (* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -2.2e-28) {
tmp = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * log((-1.0 / x_46_im)))));
} else {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -2.2e-28) {
tmp = Math.exp(((Math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * Math.log((-1.0 / x_46_im)))));
} else {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -2.2e-28: tmp = math.exp(((math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * math.log((-1.0 / x_46_im))))) else: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -2.2e-28) tmp = exp(Float64(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) - Float64(y_46_re * log(Float64(-1.0 / x_46_im))))); else tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_im <= -2.2e-28) tmp = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * log((-1.0 / x_46_im))))); else tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -2.2e-28], N[Exp[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision] - N[(y$46$re * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$re * 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]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2.2 \cdot 10^{-28}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right) - y.re \cdot \log \left(\frac{-1}{x.im}\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if x.im < -2.19999999999999996e-28Initial program 34.8%
cancel-sign-sub-inv34.8%
fma-define34.8%
hypot-define34.8%
distribute-lft-neg-in34.8%
distribute-rgt-neg-out34.8%
fma-define34.8%
hypot-define79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in x.im around -inf 80.6%
+-commutative80.6%
mul-1-neg80.6%
unsub-neg80.6%
*-commutative80.6%
mul-1-neg80.6%
unsub-neg80.6%
neg-mul-180.6%
distribute-rgt-neg-in80.6%
Simplified80.6%
Taylor expanded in y.re around 0 82.0%
cos-neg82.0%
Simplified82.0%
Taylor expanded in y.im around 0 85.8%
if -2.19999999999999996e-28 < x.im Initial 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-define79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.im around 0 49.8%
unpow249.8%
unpow249.8%
hypot-undefine57.5%
Simplified57.5%
Final simplification65.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))) (t_1 (* t_0 (pow x.re y.re))))
(if (<= y.re -1e+182)
t_1
(if (<= y.re -1.26)
(* t_0 (pow x.im y.re))
(if (<= y.re 2.12e+186)
(log (* (pow (hypot x.im x.re) y.re) E))
t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = t_0 * pow(x_46_re, y_46_re);
double tmp;
if (y_46_re <= -1e+182) {
tmp = t_1;
} else if (y_46_re <= -1.26) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else if (y_46_re <= 2.12e+186) {
tmp = log((pow(hypot(x_46_im, x_46_re), y_46_re) * ((double) M_E)));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = t_0 * Math.pow(x_46_re, y_46_re);
double tmp;
if (y_46_re <= -1e+182) {
tmp = t_1;
} else if (y_46_re <= -1.26) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 2.12e+186) {
tmp = Math.log((Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.E));
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = t_0 * math.pow(x_46_re, y_46_re) tmp = 0 if y_46_re <= -1e+182: tmp = t_1 elif y_46_re <= -1.26: tmp = t_0 * math.pow(x_46_im, y_46_re) elif y_46_re <= 2.12e+186: tmp = math.log((math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.e)) else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = Float64(t_0 * (x_46_re ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1e+182) tmp = t_1; elseif (y_46_re <= -1.26) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); elseif (y_46_re <= 2.12e+186) tmp = log(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * exp(1))); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); t_1 = t_0 * (x_46_re ^ y_46_re); tmp = 0.0; if (y_46_re <= -1e+182) tmp = t_1; elseif (y_46_re <= -1.26) tmp = t_0 * (x_46_im ^ y_46_re); elseif (y_46_re <= 2.12e+186) tmp = log(((hypot(x_46_im, x_46_re) ^ y_46_re) * 2.71828182845904523536)); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1e+182], t$95$1, If[LessEqual[y$46$re, -1.26], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.12e+186], N[Log[N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * E), $MachinePrecision]], $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := t\_0 \cdot {x.re}^{y.re}\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{+182}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -1.26:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 2.12 \cdot 10^{+186}:\\
\;\;\;\;\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot e\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.0000000000000001e182 or 2.12000000000000003e186 < y.re Initial program 35.0%
cancel-sign-sub-inv35.0%
fma-define35.0%
hypot-define35.0%
distribute-lft-neg-in35.0%
distribute-rgt-neg-out35.0%
fma-define35.0%
hypot-define70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in y.im around 0 67.5%
unpow267.5%
unpow267.5%
hypot-undefine67.5%
Simplified67.5%
Taylor expanded in x.im around 0 62.8%
*-commutative62.8%
Simplified62.8%
if -1.0000000000000001e182 < y.re < -1.26000000000000001Initial program 47.5%
cancel-sign-sub-inv47.5%
fma-define47.5%
hypot-define47.5%
distribute-lft-neg-in47.5%
distribute-rgt-neg-out47.5%
fma-define47.5%
hypot-define82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in y.im around 0 70.4%
unpow270.4%
unpow270.4%
hypot-undefine70.4%
Simplified70.4%
Taylor expanded in x.re around 0 62.9%
*-commutative62.9%
Simplified62.9%
if -1.26000000000000001 < y.re < 2.12000000000000003e186Initial program 43.8%
cancel-sign-sub-inv43.8%
fma-define43.8%
hypot-define43.8%
distribute-lft-neg-in43.8%
distribute-rgt-neg-out43.8%
fma-define43.8%
hypot-define80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in y.im around 0 39.6%
unpow239.6%
unpow239.6%
hypot-undefine49.1%
Simplified49.1%
Taylor expanded in y.re around 0 28.9%
+-commutative28.9%
unpow228.9%
unpow228.9%
hypot-undefine35.4%
Simplified35.4%
add-log-exp47.3%
+-commutative47.3%
exp-sum47.3%
*-commutative47.3%
pow-to-exp47.3%
Applied egg-rr47.3%
hypot-undefine34.3%
unpow234.3%
unpow234.3%
+-commutative34.3%
unpow234.3%
unpow234.3%
hypot-undefine47.3%
exp-1-e47.3%
Simplified47.3%
Final simplification52.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -4.8e-298) (exp (- (* (atan2 x.im x.re) (- y.im)) (* y.re (log (/ -1.0 x.im))))) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -4.8e-298) {
tmp = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * log((-1.0 / x_46_im)))));
} else {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46im <= (-4.8d-298)) then
tmp = exp(((atan2(x_46im, x_46re) * -y_46im) - (y_46re * log(((-1.0d0) / x_46im)))))
else
tmp = cos((y_46re * atan2(x_46im, x_46re))) * (x_46im ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -4.8e-298) {
tmp = Math.exp(((Math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * Math.log((-1.0 / x_46_im)))));
} else {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -4.8e-298: tmp = math.exp(((math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * math.log((-1.0 / x_46_im))))) else: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -4.8e-298) tmp = exp(Float64(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) - Float64(y_46_re * log(Float64(-1.0 / x_46_im))))); else tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_im <= -4.8e-298) tmp = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * log((-1.0 / x_46_im))))); else tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -4.8e-298], N[Exp[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision] - N[(y$46$re * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -4.8 \cdot 10^{-298}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right) - y.re \cdot \log \left(\frac{-1}{x.im}\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -4.79999999999999975e-298Initial program 40.7%
cancel-sign-sub-inv40.7%
fma-define40.7%
hypot-define40.7%
distribute-lft-neg-in40.7%
distribute-rgt-neg-out40.7%
fma-define40.7%
hypot-define80.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in x.im around -inf 71.9%
+-commutative71.9%
mul-1-neg71.9%
unsub-neg71.9%
*-commutative71.9%
mul-1-neg71.9%
unsub-neg71.9%
neg-mul-171.9%
distribute-rgt-neg-in71.9%
Simplified71.9%
Taylor expanded in y.re around 0 73.5%
cos-neg73.5%
Simplified73.5%
Taylor expanded in y.im around 0 75.0%
if -4.79999999999999975e-298 < x.im Initial program 45.3%
cancel-sign-sub-inv45.3%
fma-define45.3%
hypot-define45.3%
distribute-lft-neg-in45.3%
distribute-rgt-neg-out45.3%
fma-define45.3%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in y.im around 0 45.7%
unpow245.7%
unpow245.7%
hypot-undefine54.4%
Simplified54.4%
Taylor expanded in x.re around 0 47.6%
*-commutative47.6%
Simplified47.6%
Final simplification61.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -0.00148) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (log (* (pow (hypot x.im x.re) y.re) E))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -0.00148) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = log((pow(hypot(x_46_im, x_46_re), y_46_re) * ((double) M_E)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -0.00148) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.log((Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.E));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -0.00148: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) else: tmp = math.log((math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.e)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -0.00148) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = log(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * exp(1))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -0.00148) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = log(((hypot(x_46_im, x_46_re) ^ y_46_re) * 2.71828182845904523536)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -0.00148], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[Log[N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * E), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00148:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot e\right)\\
\end{array}
\end{array}
if y.re < -0.00148Initial program 45.0%
cancel-sign-sub-inv45.0%
fma-define45.0%
hypot-define45.0%
distribute-lft-neg-in45.0%
distribute-rgt-neg-out45.0%
fma-define45.0%
hypot-define83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in y.im around 0 73.6%
unpow273.6%
unpow273.6%
hypot-undefine73.6%
Simplified73.6%
Taylor expanded in x.re around 0 57.1%
*-commutative57.1%
Simplified57.1%
if -0.00148 < y.re Initial program 42.4%
cancel-sign-sub-inv42.4%
fma-define42.4%
hypot-define42.4%
distribute-lft-neg-in42.4%
distribute-rgt-neg-out42.4%
fma-define42.4%
hypot-define78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in y.im around 0 41.2%
unpow241.2%
unpow241.2%
hypot-undefine49.7%
Simplified49.7%
Taylor expanded in y.re around 0 26.2%
+-commutative26.2%
unpow226.2%
unpow226.2%
hypot-undefine32.1%
Simplified32.1%
add-log-exp45.1%
+-commutative45.1%
exp-sum45.1%
*-commutative45.1%
pow-to-exp45.1%
Applied egg-rr45.1%
hypot-undefine33.4%
unpow233.4%
unpow233.4%
+-commutative33.4%
unpow233.4%
unpow233.4%
hypot-undefine45.1%
exp-1-e45.1%
Simplified45.1%
Final simplification47.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (log (* (pow (hypot x.im x.re) y.re) E)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return log((pow(hypot(x_46_im, x_46_re), y_46_re) * ((double) M_E)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.log((Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.E));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.log((math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.e))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return log(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * exp(1))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = log(((hypot(x_46_im, x_46_re) ^ y_46_re) * 2.71828182845904523536)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Log[N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * E), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot e\right)
\end{array}
Initial program 43.0%
cancel-sign-sub-inv43.0%
fma-define43.0%
hypot-define43.0%
distribute-lft-neg-in43.0%
distribute-rgt-neg-out43.0%
fma-define43.0%
hypot-define79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.im around 0 48.8%
unpow248.8%
unpow248.8%
hypot-undefine55.3%
Simplified55.3%
Taylor expanded in y.re around 0 22.1%
+-commutative22.1%
unpow222.1%
unpow222.1%
hypot-undefine25.2%
Simplified25.2%
add-log-exp39.5%
+-commutative39.5%
exp-sum39.5%
*-commutative39.5%
pow-to-exp39.5%
Applied egg-rr39.5%
hypot-undefine30.5%
unpow230.5%
unpow230.5%
+-commutative30.5%
unpow230.5%
unpow230.5%
hypot-undefine39.5%
exp-1-e39.5%
Simplified39.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -9.5e-125) (+ 1.0 (* y.re (log1p (+ (hypot x.re x.im) -1.0)))) (+ 1.0 (* y.re (log (hypot x.re x.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -9.5e-125) {
tmp = 1.0 + (y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0)));
} else {
tmp = 1.0 + (y_46_re * log(hypot(x_46_re, x_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -9.5e-125) {
tmp = 1.0 + (y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0)));
} else {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_re, x_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -9.5e-125: tmp = 1.0 + (y_46_re * math.log1p((math.hypot(x_46_re, x_46_im) + -1.0))) else: tmp = 1.0 + (y_46_re * math.log(math.hypot(x_46_re, x_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -9.5e-125) tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0)))); else tmp = Float64(1.0 + Float64(y_46_re * log(hypot(x_46_re, x_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -9.5e-125], N[(1.0 + N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -9.5 \cdot 10^{-125}:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\end{array}
\end{array}
if y.im < -9.50000000000000031e-125Initial program 35.3%
cancel-sign-sub-inv35.3%
fma-define35.3%
hypot-define35.3%
distribute-lft-neg-in35.3%
distribute-rgt-neg-out35.3%
fma-define35.3%
hypot-define77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in y.im around 0 40.0%
unpow240.0%
unpow240.0%
hypot-undefine38.6%
Simplified38.6%
Taylor expanded in y.re around 0 11.6%
+-commutative11.6%
unpow211.6%
unpow211.6%
hypot-undefine12.7%
Simplified12.7%
log1p-expm1-u20.9%
expm1-undefine20.9%
add-exp-log20.9%
Applied egg-rr20.9%
if -9.50000000000000031e-125 < y.im Initial program 47.4%
cancel-sign-sub-inv47.4%
fma-define47.4%
hypot-define47.4%
distribute-lft-neg-in47.4%
distribute-rgt-neg-out47.4%
fma-define47.4%
hypot-define80.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in y.im around 0 53.8%
unpow253.8%
unpow253.8%
hypot-undefine64.8%
Simplified64.8%
Taylor expanded in y.re around 0 28.0%
+-commutative28.0%
unpow228.0%
unpow228.0%
hypot-undefine32.3%
Simplified32.3%
Final simplification28.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (* y.re (log (hypot x.re x.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + (y_46_re * log(hypot(x_46_re, x_46_im)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + (y_46_re * Math.log(Math.hypot(x_46_re, x_46_im)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + (y_46_re * math.log(math.hypot(x_46_re, x_46_im)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + Float64(y_46_re * log(hypot(x_46_re, x_46_im)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + (y_46_re * log(hypot(x_46_re, x_46_im))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)
\end{array}
Initial program 43.0%
cancel-sign-sub-inv43.0%
fma-define43.0%
hypot-define43.0%
distribute-lft-neg-in43.0%
distribute-rgt-neg-out43.0%
fma-define43.0%
hypot-define79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.im around 0 48.8%
unpow248.8%
unpow248.8%
hypot-undefine55.3%
Simplified55.3%
Taylor expanded in y.re around 0 22.1%
+-commutative22.1%
unpow222.1%
unpow222.1%
hypot-undefine25.2%
Simplified25.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 43.0%
cancel-sign-sub-inv43.0%
fma-define43.0%
hypot-define43.0%
distribute-lft-neg-in43.0%
distribute-rgt-neg-out43.0%
fma-define43.0%
hypot-define79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.im around 0 48.8%
unpow248.8%
unpow248.8%
hypot-undefine55.3%
Simplified55.3%
Taylor expanded in y.re around 0 24.8%
herbie shell --seed 2024157
(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)))))