
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -9e+43)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0))
t_1)
(if (<= y.re 5.9e-18)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 2.4e+231)
(* (exp (- (* y.re (log1p (+ (hypot x.re x.im) -1.0))) t_0)) t_1)
(* t_1 (/ (pow (hypot x.re x.im) y.re) (+ t_0 1.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 <= -9e+43) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * t_1;
} else if (y_46_re <= 5.9e-18) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 2.4e+231) {
tmp = exp(((y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0))) - t_0)) * t_1;
} else {
tmp = t_1 * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * 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 <= -9e+43) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * t_1;
} else if (y_46_re <= 5.9e-18) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 2.4e+231) {
tmp = Math.exp(((y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0))) - t_0)) * t_1;
} else {
tmp = t_1 * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.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 <= -9e+43: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * t_1 elif y_46_re <= 5.9e-18: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif y_46_re <= 2.4e+231: tmp = math.exp(((y_46_re * math.log1p((math.hypot(x_46_re, x_46_im) + -1.0))) - t_0)) * t_1 else: tmp = t_1 * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.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 <= -9e+43) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_0)) * t_1); elseif (y_46_re <= 5.9e-18) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 2.4e+231) tmp = Float64(exp(Float64(Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0))) - t_0)) * t_1); else tmp = Float64(t_1 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.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[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -9e+43], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 5.9e-18], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.4e+231], N[(N[Exp[N[(N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.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 -9 \cdot 10^{+43}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_0} \cdot t\_1\\
\mathbf{elif}\;y.re \leq 5.9 \cdot 10^{-18}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 2.4 \cdot 10^{+231}:\\
\;\;\;\;e^{y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right) - t\_0} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t\_0 + 1}\\
\end{array}
\end{array}
if y.re < -9e43Initial program 43.1%
Taylor expanded in y.im around 0 88.3%
if -9e43 < y.re < 5.90000000000000019e-18Initial program 37.6%
cancel-sign-sub-inv37.6%
fma-define37.6%
hypot-define37.6%
distribute-lft-neg-in37.6%
distribute-rgt-neg-out37.6%
fma-define37.6%
hypot-define79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in y.re around 0 37.6%
*-commutative37.6%
unpow237.6%
unpow237.6%
hypot-undefine78.6%
neg-mul-178.6%
distribute-rgt-neg-in78.6%
Simplified78.6%
if 5.90000000000000019e-18 < y.re < 2.40000000000000007e231Initial program 42.2%
Taylor expanded in y.im around 0 69.1%
log1p-expm1-u66.9%
hypot-define77.8%
expm1-undefine77.8%
add-exp-log77.8%
Applied egg-rr77.8%
if 2.40000000000000007e231 < y.re Initial program 50.0%
exp-diff31.8%
exp-to-pow31.8%
hypot-define31.8%
*-commutative31.8%
exp-prod31.8%
fma-define31.8%
hypot-define59.1%
*-commutative59.1%
Simplified59.1%
Taylor expanded in y.im around 0 86.4%
Taylor expanded in y.im around 0 91.0%
Final simplification81.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_3 (cos (+ (* t_2 y.im) t_1))) INFINITY)
(* t_3 (cos (+ t_1 (pow (cbrt (* y.im t_0)) 3.0))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_0 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_3 * cos(((t_2 * y_46_im) + t_1))) <= ((double) INFINITY)) {
tmp = t_3 * cos((t_1 + pow(cbrt((y_46_im * t_0)), 3.0)));
} else {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_0, y_46_im, 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_3 * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= Inf) tmp = Float64(t_3 * cos(Float64(t_1 + (cbrt(Float64(y_46_im * t_0)) ^ 3.0)))); else tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_0, y_46_im, 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$3 * N[Cos[N[(t$95$1 + N[Power[N[Power[N[(y$46$im * t$95$0), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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] * N[Cos[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_3 \cdot \cos \left(t\_2 \cdot y.im + t\_1\right) \leq \infty:\\
\;\;\;\;t\_3 \cdot \cos \left(t\_1 + {\left(\sqrt[3]{y.im \cdot t\_0}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, t\_1\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < +inf.0Initial program 79.9%
add-cube-cbrt82.5%
pow383.3%
*-commutative83.3%
hypot-define83.3%
Applied egg-rr83.3%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 0.0%
cancel-sign-sub-inv0.0%
fma-define0.0%
hypot-define0.0%
distribute-lft-neg-in0.0%
distribute-rgt-neg-out0.0%
fma-define0.0%
hypot-define79.2%
*-commutative79.2%
Simplified79.2%
Final simplification81.3%
(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 (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (* (exp (- (* t_2 y.re) t_0)) (cos (+ (* t_2 y.im) t_1)))))
(if (<= t_3 INFINITY)
t_3
(* (exp (- (* y.re (log1p (+ (hypot x.re x.im) -1.0))) t_0)) (cos t_1)))))
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(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - t_0)) * cos(((t_2 * y_46_im) + t_1));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = exp(((y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0))) - t_0)) * cos(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.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.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = Math.exp(((t_2 * y_46_re) - t_0)) * Math.cos(((t_2 * y_46_im) + t_1));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = Math.exp(((y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0))) - t_0)) * Math.cos(t_1);
}
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 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) t_3 = math.exp(((t_2 * y_46_re) - t_0)) * math.cos(((t_2 * y_46_im) + t_1)) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = math.exp(((y_46_re * math.log1p((math.hypot(x_46_re, x_46_im) + -1.0))) - t_0)) * math.cos(t_1) 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(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = Float64(exp(Float64(Float64(t_2 * y_46_re) - t_0)) * cos(Float64(Float64(t_2 * y_46_im) + t_1))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(exp(Float64(Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0))) - t_0)) * cos(t_1)); 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[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(N[Exp[N[(N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$1], $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(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - t\_0} \cdot \cos \left(t\_2 \cdot y.im + t\_1\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right) - t\_0} \cdot \cos t\_1\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < +inf.0Initial program 79.9%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 0.0%
Taylor expanded in y.im around 0 37.8%
log1p-expm1-u37.8%
hypot-define78.7%
expm1-undefine78.7%
add-exp-log78.7%
Applied egg-rr78.7%
Final simplification79.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))))
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));
return exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) 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]}, N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 40.6%
cancel-sign-sub-inv40.6%
fma-define40.6%
hypot-define40.6%
distribute-lft-neg-in40.6%
distribute-rgt-neg-out40.6%
fma-define40.6%
hypot-define79.6%
*-commutative79.6%
Simplified79.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))))
(t_2
(* (exp (- (* y.re (log1p (+ (hypot x.re x.im) -1.0))) t_0)) t_1)))
(if (<= y.re -9e+43)
t_2
(if (<= y.re 5.9e-18)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 1e+229)
t_2
(* t_1 (/ (pow (hypot x.re x.im) y.re) (+ t_0 1.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 t_2 = exp(((y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0))) - t_0)) * t_1;
double tmp;
if (y_46_re <= -9e+43) {
tmp = t_2;
} else if (y_46_re <= 5.9e-18) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1e+229) {
tmp = t_2;
} else {
tmp = t_1 * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = Math.exp(((y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0))) - t_0)) * t_1;
double tmp;
if (y_46_re <= -9e+43) {
tmp = t_2;
} else if (y_46_re <= 5.9e-18) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1e+229) {
tmp = t_2;
} else {
tmp = t_1 * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.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))) t_2 = math.exp(((y_46_re * math.log1p((math.hypot(x_46_re, x_46_im) + -1.0))) - t_0)) * t_1 tmp = 0 if y_46_re <= -9e+43: tmp = t_2 elif y_46_re <= 5.9e-18: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif y_46_re <= 1e+229: tmp = t_2 else: tmp = t_1 * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.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))) t_2 = Float64(exp(Float64(Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0))) - t_0)) * t_1) tmp = 0.0 if (y_46_re <= -9e+43) tmp = t_2; elseif (y_46_re <= 5.9e-18) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 1e+229) tmp = t_2; else tmp = Float64(t_1 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.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[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -9e+43], t$95$2, If[LessEqual[y$46$re, 5.9e-18], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1e+229], t$95$2, N[(t$95$1 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.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)\\
t_2 := e^{y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right) - t\_0} \cdot t\_1\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{+43}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 5.9 \cdot 10^{-18}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 10^{+229}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t\_0 + 1}\\
\end{array}
\end{array}
if y.re < -9e43 or 5.90000000000000019e-18 < y.re < 9.9999999999999999e228Initial program 42.7%
Taylor expanded in y.im around 0 79.3%
log1p-expm1-u76.2%
hypot-define81.3%
expm1-undefine81.3%
add-exp-log81.3%
Applied egg-rr81.3%
if -9e43 < y.re < 5.90000000000000019e-18Initial program 37.6%
cancel-sign-sub-inv37.6%
fma-define37.6%
hypot-define37.6%
distribute-lft-neg-in37.6%
distribute-rgt-neg-out37.6%
fma-define37.6%
hypot-define79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in y.re around 0 37.6%
*-commutative37.6%
unpow237.6%
unpow237.6%
hypot-undefine78.6%
neg-mul-178.6%
distribute-rgt-neg-in78.6%
Simplified78.6%
if 9.9999999999999999e228 < y.re Initial program 50.0%
exp-diff31.8%
exp-to-pow31.8%
hypot-define31.8%
*-commutative31.8%
exp-prod31.8%
fma-define31.8%
hypot-define59.1%
*-commutative59.1%
Simplified59.1%
Taylor expanded in y.im around 0 86.4%
Taylor expanded in y.im around 0 91.0%
Final simplification80.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.im -1.6e+119)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.im 8.8e+17)
(*
t_0
(/ (pow (hypot x.re x.im) y.re) (+ (* (atan2 x.im x.re) y.im) 1.0)))
(/
(cos (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -1.6e+119) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_im <= 8.8e+17) {
tmp = t_0 * (pow(hypot(x_46_re, x_46_im), y_46_re) / ((atan2(x_46_im, x_46_re) * y_46_im) + 1.0));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -1.6e+119) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_im <= 8.8e+17) {
tmp = t_0 * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / ((Math.atan2(x_46_im, x_46_re) * y_46_im) + 1.0));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= -1.6e+119: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif y_46_im <= 8.8e+17: tmp = t_0 * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / ((math.atan2(x_46_im, x_46_re) * y_46_im) + 1.0)) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -1.6e+119) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_im <= 8.8e+17) tmp = Float64(t_0 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(Float64(atan(x_46_im, x_46_re) * y_46_im) + 1.0))); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= -1.6e+119) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); elseif (y_46_im <= 8.8e+17) tmp = t_0 * ((hypot(x_46_re, x_46_im) ^ y_46_re) / ((atan2(x_46_im, x_46_re) * y_46_im) + 1.0)); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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$im, -1.6e+119], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8.8e+17], N[(t$95$0 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $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.im \leq -1.6 \cdot 10^{+119}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.im \leq 8.8 \cdot 10^{+17}:\\
\;\;\;\;t\_0 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\end{array}
\end{array}
if y.im < -1.59999999999999995e119Initial program 35.8%
Taylor expanded in y.im around 0 53.3%
Taylor expanded in y.re around 0 72.1%
mul-1-neg72.1%
distribute-rgt-neg-out72.1%
Simplified72.1%
if -1.59999999999999995e119 < y.im < 8.8e17Initial program 39.6%
exp-diff37.5%
exp-to-pow37.5%
hypot-define37.5%
*-commutative37.5%
exp-prod35.7%
fma-define35.7%
hypot-define82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in y.im around 0 85.6%
Taylor expanded in y.im around 0 84.7%
if 8.8e17 < y.im Initial program 45.4%
add-cube-cbrt45.9%
pow347.0%
*-commutative47.0%
hypot-define57.2%
Applied egg-rr57.2%
add-cbrt-cube57.2%
pow1/351.1%
Applied egg-rr48.0%
Taylor expanded in y.re around 0 38.5%
unpow238.5%
unpow238.5%
hypot-undefine62.7%
exp-prod65.1%
Simplified65.1%
Final simplification77.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 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.im -2.3e+119)
(* t_0 t_1)
(if (<= y.im 2.05e+21)
(*
t_0
(/ (pow (hypot x.re x.im) y.re) (+ (* (atan2 x.im x.re) y.im) 1.0)))
(* (cos (* y.im (log (hypot x.im x.re)))) 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 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_im <= -2.3e+119) {
tmp = t_0 * t_1;
} else if (y_46_im <= 2.05e+21) {
tmp = t_0 * (pow(hypot(x_46_re, x_46_im), y_46_re) / ((atan2(x_46_im, x_46_re) * y_46_im) + 1.0));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_im <= -2.3e+119) {
tmp = t_0 * t_1;
} else if (y_46_im <= 2.05e+21) {
tmp = t_0 * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / ((Math.atan2(x_46_im, x_46_re) * y_46_im) + 1.0));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) tmp = 0 if y_46_im <= -2.3e+119: tmp = t_0 * t_1 elif y_46_im <= 2.05e+21: tmp = t_0 * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / ((math.atan2(x_46_im, x_46_re) * y_46_im) + 1.0)) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * 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 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (y_46_im <= -2.3e+119) tmp = Float64(t_0 * t_1); elseif (y_46_im <= 2.05e+21) tmp = Float64(t_0 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(Float64(atan(x_46_im, x_46_re) * y_46_im) + 1.0))); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * 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 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); tmp = 0.0; if (y_46_im <= -2.3e+119) tmp = t_0 * t_1; elseif (y_46_im <= 2.05e+21) tmp = t_0 * ((hypot(x_46_re, x_46_im) ^ y_46_re) / ((atan2(x_46_im, x_46_re) * y_46_im) + 1.0)); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -2.3e+119], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 2.05e+21], N[(t$95$0 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.im \leq -2.3 \cdot 10^{+119}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.im \leq 2.05 \cdot 10^{+21}:\\
\;\;\;\;t\_0 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + 1}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t\_1\\
\end{array}
\end{array}
if y.im < -2.3000000000000001e119Initial program 35.8%
Taylor expanded in y.im around 0 53.3%
Taylor expanded in y.re around 0 72.1%
mul-1-neg72.1%
distribute-rgt-neg-out72.1%
Simplified72.1%
if -2.3000000000000001e119 < y.im < 2.05e21Initial program 40.1%
exp-diff38.0%
exp-to-pow38.0%
hypot-define38.0%
*-commutative38.0%
exp-prod36.2%
fma-define36.2%
hypot-define82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in y.im around 0 85.7%
Taylor expanded in y.im around 0 84.8%
if 2.05e21 < y.im Initial program 44.6%
cancel-sign-sub-inv44.6%
fma-define44.6%
hypot-define44.6%
distribute-lft-neg-in44.6%
distribute-rgt-neg-out44.6%
fma-define44.6%
hypot-define69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in y.re around 0 39.0%
*-commutative39.0%
unpow239.0%
unpow239.0%
hypot-undefine63.6%
neg-mul-163.6%
distribute-rgt-neg-in63.6%
Simplified63.6%
Final simplification76.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re))))
(t_1 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.im -8.5e+119)
(* t_0 t_1)
(if (<= y.im 5.8e+19)
(* t_0 (pow (hypot x.im x.re) y.re))
(* (cos (* y.im (log (hypot x.im x.re)))) 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 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_im <= -8.5e+119) {
tmp = t_0 * t_1;
} else if (y_46_im <= 5.8e+19) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_im <= -8.5e+119) {
tmp = t_0 * t_1;
} else if (y_46_im <= 5.8e+19) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) tmp = 0 if y_46_im <= -8.5e+119: tmp = t_0 * t_1 elif y_46_im <= 5.8e+19: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * 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 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (y_46_im <= -8.5e+119) tmp = Float64(t_0 * t_1); elseif (y_46_im <= 5.8e+19) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * 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 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); tmp = 0.0; if (y_46_im <= -8.5e+119) tmp = t_0 * t_1; elseif (y_46_im <= 5.8e+19) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -8.5e+119], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 5.8e+19], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.im \leq -8.5 \cdot 10^{+119}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.im \leq 5.8 \cdot 10^{+19}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t\_1\\
\end{array}
\end{array}
if y.im < -8.49999999999999997e119Initial program 35.0%
Taylor expanded in y.im around 0 51.0%
Taylor expanded in y.re around 0 70.7%
mul-1-neg70.7%
distribute-rgt-neg-out70.7%
Simplified70.7%
if -8.49999999999999997e119 < y.im < 5.8e19Initial program 40.2%
cancel-sign-sub-inv40.2%
fma-define40.2%
hypot-define40.2%
distribute-lft-neg-in40.2%
distribute-rgt-neg-out40.2%
fma-define40.2%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.im around 0 61.1%
unpow261.1%
unpow261.1%
hypot-undefine84.2%
Simplified84.2%
if 5.8e19 < y.im Initial program 44.6%
cancel-sign-sub-inv44.6%
fma-define44.6%
hypot-define44.6%
distribute-lft-neg-in44.6%
distribute-rgt-neg-out44.6%
fma-define44.6%
hypot-define69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in y.re around 0 39.0%
*-commutative39.0%
unpow239.0%
unpow239.0%
hypot-undefine63.6%
neg-mul-163.6%
distribute-rgt-neg-in63.6%
Simplified63.6%
Final simplification76.5%
(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.im -1.05e+122) (not (<= y.im 6.9e+19)))
(* t_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_im <= -1.05e+122) || !(y_46_im <= 6.9e+19)) {
tmp = t_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_im <= -1.05e+122) || !(y_46_im <= 6.9e+19)) {
tmp = t_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_im <= -1.05e+122) or not (y_46_im <= 6.9e+19): tmp = t_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_im <= -1.05e+122) || !(y_46_im <= 6.9e+19)) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-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_im <= -1.05e+122) || ~((y_46_im <= 6.9e+19))) tmp = t_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[Or[LessEqual[y$46$im, -1.05e+122], N[Not[LessEqual[y$46$im, 6.9e+19]], $MachinePrecision]], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $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.im \leq -1.05 \cdot 10^{+122} \lor \neg \left(y.im \leq 6.9 \cdot 10^{+19}\right):\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -1.05000000000000008e122 or 6.9e19 < y.im Initial program 41.1%
Taylor expanded in y.im around 0 48.8%
Taylor expanded in y.re around 0 60.6%
mul-1-neg60.6%
distribute-rgt-neg-out60.6%
Simplified60.6%
if -1.05000000000000008e122 < y.im < 6.9e19Initial program 40.2%
cancel-sign-sub-inv40.2%
fma-define40.2%
hypot-define40.2%
distribute-lft-neg-in40.2%
distribute-rgt-neg-out40.2%
fma-define40.2%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.im around 0 61.1%
unpow261.1%
unpow261.1%
hypot-undefine84.2%
Simplified84.2%
Final simplification74.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -1.02e-206) (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 <= -1.02e-206) {
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 <= -1.02e-206) {
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 <= -1.02e-206: 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 <= -1.02e-206) 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 <= -1.02e-206) 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, -1.02e-206], 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 -1.02 \cdot 10^{-206}:\\
\;\;\;\;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 < -1.0200000000000001e-206Initial 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-define80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in x.im around -inf 71.1%
+-commutative71.1%
mul-1-neg71.1%
unsub-neg71.1%
*-commutative71.1%
mul-1-neg71.1%
unsub-neg71.1%
neg-mul-171.1%
distribute-rgt-neg-in71.1%
Simplified71.1%
Taylor expanded in y.re around 0 66.3%
cos-neg66.3%
*-commutative66.3%
Simplified66.3%
Taylor expanded in y.im around 0 68.4%
if -1.0200000000000001e-206 < x.im Initial 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-define78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in y.im around 0 49.5%
unpow249.5%
unpow249.5%
hypot-undefine61.3%
Simplified61.3%
Final simplification64.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -9e+43) (not (<= y.re 4e+39))) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (+ 1.0 (log (pow (hypot x.im x.re) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -9e+43) || !(y_46_re <= 4e+39)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + log(pow(hypot(x_46_im, x_46_re), y_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -9e+43) || !(y_46_re <= 4e+39)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + Math.log(Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -9e+43) or not (y_46_re <= 4e+39): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) else: tmp = 1.0 + math.log(math.pow(math.hypot(x_46_im, x_46_re), y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -9e+43) || !(y_46_re <= 4e+39)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = Float64(1.0 + log((hypot(x_46_im, x_46_re) ^ y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -9e+43) || ~((y_46_re <= 4e+39))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = 1.0 + log((hypot(x_46_im, x_46_re) ^ y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -9e+43], N[Not[LessEqual[y$46$re, 4e+39]], $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], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -9 \cdot 10^{+43} \lor \neg \left(y.re \leq 4 \cdot 10^{+39}\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < -9e43 or 3.99999999999999976e39 < y.re Initial program 43.4%
cancel-sign-sub-inv43.4%
fma-define43.4%
hypot-define43.4%
distribute-lft-neg-in43.4%
distribute-rgt-neg-out43.4%
fma-define43.4%
hypot-define79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y.im around 0 72.8%
unpow272.8%
unpow272.8%
hypot-undefine72.8%
Simplified72.8%
Taylor expanded in x.re around 0 58.9%
if -9e43 < y.re < 3.99999999999999976e39Initial program 38.6%
cancel-sign-sub-inv38.6%
fma-define38.6%
hypot-define38.6%
distribute-lft-neg-in38.6%
distribute-rgt-neg-out38.6%
fma-define38.6%
hypot-define79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in y.im around 0 25.7%
unpow225.7%
unpow225.7%
hypot-undefine45.9%
Simplified45.9%
Taylor expanded in y.re around 0 21.7%
+-commutative21.7%
unpow221.7%
unpow221.7%
hypot-undefine41.0%
Simplified41.0%
+-commutative41.0%
*-un-lft-identity41.0%
fma-define41.0%
add-log-exp44.8%
*-commutative44.8%
exp-to-pow44.8%
Applied egg-rr44.8%
fma-undefine44.8%
*-lft-identity44.8%
hypot-undefine24.9%
unpow224.9%
unpow224.9%
+-commutative24.9%
unpow224.9%
unpow224.9%
hypot-define44.8%
Simplified44.8%
Final simplification50.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= x.im -4.4e-305)
(exp (- (* (atan2 x.im x.re) (- y.im)) (* y.re (log (/ -1.0 x.im)))))
(if (<= x.im 3e-46) (* t_0 (pow x.re y.re)) (* t_0 (pow x.im 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 (x_46_im <= -4.4e-305) {
tmp = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * log((-1.0 / x_46_im)))));
} else if (x_46_im <= 3e-46) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else {
tmp = t_0 * 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) :: t_0
real(8) :: tmp
t_0 = cos((y_46re * atan2(x_46im, x_46re)))
if (x_46im <= (-4.4d-305)) then
tmp = exp(((atan2(x_46im, x_46re) * -y_46im) - (y_46re * log(((-1.0d0) / x_46im)))))
else if (x_46im <= 3d-46) then
tmp = t_0 * (x_46re ** y_46re)
else
tmp = t_0 * (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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -4.4e-305) {
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 if (x_46_im <= 3e-46) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_im, 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 x_46_im <= -4.4e-305: tmp = math.exp(((math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * math.log((-1.0 / x_46_im))))) elif x_46_im <= 3e-46: tmp = t_0 * math.pow(x_46_re, y_46_re) else: tmp = t_0 * math.pow(x_46_im, 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 (x_46_im <= -4.4e-305) 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))))); elseif (x_46_im <= 3e-46) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); else tmp = Float64(t_0 * (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) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -4.4e-305) tmp = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * log((-1.0 / x_46_im))))); elseif (x_46_im <= 3e-46) tmp = t_0 * (x_46_re ^ y_46_re); else tmp = t_0 * (x_46_im ^ 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[x$46$im, -4.4e-305], 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], If[LessEqual[x$46$im, 3e-46], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, 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}\;x.im \leq -4.4 \cdot 10^{-305}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right) - y.re \cdot \log \left(\frac{-1}{x.im}\right)}\\
\mathbf{elif}\;x.im \leq 3 \cdot 10^{-46}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -4.39999999999999993e-305Initial program 41.8%
cancel-sign-sub-inv41.8%
fma-define41.8%
hypot-define41.8%
distribute-lft-neg-in41.8%
distribute-rgt-neg-out41.8%
fma-define41.8%
hypot-define82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in x.im around -inf 71.6%
+-commutative71.6%
mul-1-neg71.6%
unsub-neg71.6%
*-commutative71.6%
mul-1-neg71.6%
unsub-neg71.6%
neg-mul-171.6%
distribute-rgt-neg-in71.6%
Simplified71.6%
Taylor expanded in y.re around 0 66.4%
cos-neg66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in y.im around 0 68.0%
if -4.39999999999999993e-305 < x.im < 2.99999999999999987e-46Initial program 42.5%
cancel-sign-sub-inv42.5%
fma-define42.5%
hypot-define42.5%
distribute-lft-neg-in42.5%
distribute-rgt-neg-out42.5%
fma-define42.5%
hypot-define73.0%
*-commutative73.0%
Simplified73.0%
Taylor expanded in y.im around 0 44.8%
unpow244.8%
unpow244.8%
hypot-undefine54.0%
Simplified54.0%
Taylor expanded in x.im around 0 47.8%
if 2.99999999999999987e-46 < x.im Initial program 36.8%
cancel-sign-sub-inv36.8%
fma-define36.8%
hypot-define36.8%
distribute-lft-neg-in36.8%
distribute-rgt-neg-out36.8%
fma-define36.8%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in y.im around 0 49.5%
unpow249.5%
unpow249.5%
hypot-undefine61.4%
Simplified61.4%
Taylor expanded in x.re around 0 60.6%
Final simplification61.9%
(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 -9e+43)
(* t_0 (pow x.re y.re))
(if (<= y.re 1e+42)
(+ 1.0 (log (pow (hypot x.im x.re) y.re)))
(* t_0 (pow x.im 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 <= -9e+43) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else if (y_46_re <= 1e+42) {
tmp = 1.0 + log(pow(hypot(x_46_im, x_46_re), y_46_re));
} else {
tmp = t_0 * pow(x_46_im, 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 <= -9e+43) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else if (y_46_re <= 1e+42) {
tmp = 1.0 + Math.log(Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re));
} else {
tmp = t_0 * Math.pow(x_46_im, 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 <= -9e+43: tmp = t_0 * math.pow(x_46_re, y_46_re) elif y_46_re <= 1e+42: tmp = 1.0 + math.log(math.pow(math.hypot(x_46_im, x_46_re), y_46_re)) else: tmp = t_0 * math.pow(x_46_im, 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 <= -9e+43) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); elseif (y_46_re <= 1e+42) tmp = Float64(1.0 + log((hypot(x_46_im, x_46_re) ^ y_46_re))); else tmp = Float64(t_0 * (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) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -9e+43) tmp = t_0 * (x_46_re ^ y_46_re); elseif (y_46_re <= 1e+42) tmp = 1.0 + log((hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = t_0 * (x_46_im ^ 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, -9e+43], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1e+42], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, 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 -9 \cdot 10^{+43}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{elif}\;y.re \leq 10^{+42}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -9e43Initial program 43.1%
cancel-sign-sub-inv43.1%
fma-define43.1%
hypot-define43.1%
distribute-lft-neg-in43.1%
distribute-rgt-neg-out43.1%
fma-define43.1%
hypot-define84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in y.im around 0 78.6%
unpow278.6%
unpow278.6%
hypot-undefine78.6%
Simplified78.6%
Taylor expanded in x.im around 0 65.1%
if -9e43 < y.re < 1.00000000000000004e42Initial program 38.6%
cancel-sign-sub-inv38.6%
fma-define38.6%
hypot-define38.6%
distribute-lft-neg-in38.6%
distribute-rgt-neg-out38.6%
fma-define38.6%
hypot-define79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in y.im around 0 25.7%
unpow225.7%
unpow225.7%
hypot-undefine45.9%
Simplified45.9%
Taylor expanded in y.re around 0 21.7%
+-commutative21.7%
unpow221.7%
unpow221.7%
hypot-undefine41.0%
Simplified41.0%
+-commutative41.0%
*-un-lft-identity41.0%
fma-define41.0%
add-log-exp44.8%
*-commutative44.8%
exp-to-pow44.8%
Applied egg-rr44.8%
fma-undefine44.8%
*-lft-identity44.8%
hypot-undefine24.9%
unpow224.9%
unpow224.9%
+-commutative24.9%
unpow224.9%
unpow224.9%
hypot-define44.8%
Simplified44.8%
if 1.00000000000000004e42 < y.re Initial program 43.6%
cancel-sign-sub-inv43.6%
fma-define43.6%
hypot-define43.6%
distribute-lft-neg-in43.6%
distribute-rgt-neg-out43.6%
fma-define43.6%
hypot-define74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in y.im around 0 67.4%
unpow267.4%
unpow267.4%
hypot-undefine67.4%
Simplified67.4%
Taylor expanded in x.re around 0 56.8%
Final simplification51.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (log (pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + log(pow(hypot(x_46_im, x_46_re), y_46_re));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + Math.log(Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + math.log(math.pow(math.hypot(x_46_im, x_46_re), y_46_re))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + log((hypot(x_46_im, x_46_re) ^ y_46_re))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + log((hypot(x_46_im, x_46_re) ^ y_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)
\end{array}
Initial program 40.6%
cancel-sign-sub-inv40.6%
fma-define40.6%
hypot-define40.6%
distribute-lft-neg-in40.6%
distribute-rgt-neg-out40.6%
fma-define40.6%
hypot-define79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in y.im around 0 45.2%
unpow245.2%
unpow245.2%
hypot-undefine57.0%
Simplified57.0%
Taylor expanded in y.re around 0 20.8%
+-commutative20.8%
unpow220.8%
unpow220.8%
hypot-undefine25.6%
Simplified25.6%
+-commutative25.6%
*-un-lft-identity25.6%
fma-define25.6%
add-log-exp39.0%
*-commutative39.0%
exp-to-pow39.0%
Applied egg-rr39.0%
fma-undefine39.0%
*-lft-identity39.0%
hypot-undefine27.4%
unpow227.4%
unpow227.4%
+-commutative27.4%
unpow227.4%
unpow227.4%
hypot-define39.0%
Simplified39.0%
Final simplification39.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -2.7e+19) (+ 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_re <= -2.7e+19) {
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_re <= -2.7e+19) {
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_re <= -2.7e+19: 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_re <= -2.7e+19) 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$re, -2.7e+19], 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.re \leq -2.7 \cdot 10^{+19}:\\
\;\;\;\;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.re < -2.7e19Initial program 42.3%
cancel-sign-sub-inv42.3%
fma-define42.3%
hypot-define42.3%
distribute-lft-neg-in42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in y.im around 0 77.1%
unpow277.1%
unpow277.1%
hypot-undefine77.1%
Simplified77.1%
Taylor expanded in y.re around 0 7.7%
+-commutative7.7%
unpow27.7%
unpow27.7%
hypot-undefine2.6%
Simplified2.6%
log1p-expm1-u17.0%
expm1-define17.0%
add-exp-log17.0%
sub-neg17.0%
metadata-eval17.0%
Applied egg-rr17.0%
if -2.7e19 < y.re Initial program 40.1%
cancel-sign-sub-inv40.1%
fma-define40.1%
hypot-define40.1%
distribute-lft-neg-in40.1%
distribute-rgt-neg-out40.1%
fma-define40.1%
hypot-define78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in y.im around 0 37.1%
unpow237.1%
unpow237.1%
hypot-undefine51.9%
Simplified51.9%
Taylor expanded in y.re around 0 24.2%
+-commutative24.2%
unpow224.2%
unpow224.2%
hypot-undefine31.5%
Simplified31.5%
(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 40.6%
cancel-sign-sub-inv40.6%
fma-define40.6%
hypot-define40.6%
distribute-lft-neg-in40.6%
distribute-rgt-neg-out40.6%
fma-define40.6%
hypot-define79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in y.im around 0 45.2%
unpow245.2%
unpow245.2%
hypot-undefine57.0%
Simplified57.0%
Taylor expanded in y.re around 0 20.8%
+-commutative20.8%
unpow220.8%
unpow220.8%
hypot-undefine25.6%
Simplified25.6%
(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 40.6%
cancel-sign-sub-inv40.6%
fma-define40.6%
hypot-define40.6%
distribute-lft-neg-in40.6%
distribute-rgt-neg-out40.6%
fma-define40.6%
hypot-define79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in y.im around 0 45.2%
unpow245.2%
unpow245.2%
hypot-undefine57.0%
Simplified57.0%
Taylor expanded in y.re around 0 24.7%
herbie shell --seed 2024129
(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)))))