
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (* y.re t_1)))
(if (<= y.re 280000000.0)
(* (exp (- t_2 (pow (cbrt t_0) 3.0))) (cos (pow (cbrt (* t_1 y.im)) 3.0)))
(* (exp (- t_2 t_0)) (cos (* y.im (log (hypot x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = y_46_re * t_1;
double tmp;
if (y_46_re <= 280000000.0) {
tmp = exp((t_2 - pow(cbrt(t_0), 3.0))) * cos(pow(cbrt((t_1 * y_46_im)), 3.0));
} else {
tmp = exp((t_2 - t_0)) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.log(Math.hypot(x_46_re, x_46_im));
double t_2 = y_46_re * t_1;
double tmp;
if (y_46_re <= 280000000.0) {
tmp = Math.exp((t_2 - Math.pow(Math.cbrt(t_0), 3.0))) * Math.cos(Math.pow(Math.cbrt((t_1 * y_46_im)), 3.0));
} else {
tmp = Math.exp((t_2 - t_0)) * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(y_46_re * t_1) tmp = 0.0 if (y_46_re <= 280000000.0) tmp = Float64(exp(Float64(t_2 - (cbrt(t_0) ^ 3.0))) * cos((cbrt(Float64(t_1 * y_46_im)) ^ 3.0))); else tmp = Float64(exp(Float64(t_2 - t_0)) * cos(Float64(y_46_im * log(hypot(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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, 280000000.0], N[(N[Exp[N[(t$95$2 - N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[Power[N[Power[N[(t$95$1 * y$46$im), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$2 - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := y.re \cdot t_1\\
\mathbf{if}\;y.re \leq 280000000:\\
\;\;\;\;e^{t_2 - {\left(\sqrt[3]{t_0}\right)}^{3}} \cdot \cos \left({\left(\sqrt[3]{t_1 \cdot y.im}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{t_2 - t_0} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < 2.8e8Initial program 51.0%
Simplified88.8%
add-cube-cbrt88.8%
pow388.8%
*-commutative88.8%
Applied egg-rr88.8%
Taylor expanded in y.re around 0 50.4%
unpow250.4%
unpow250.4%
hypot-def87.1%
Simplified87.1%
add-cube-cbrt89.9%
pow390.5%
hypot-udef52.8%
+-commutative52.8%
hypot-udef90.5%
add-sqr-sqrt89.9%
add-sqr-sqrt90.5%
Applied egg-rr90.5%
if 2.8e8 < y.re Initial program 27.2%
Simplified66.7%
add-cube-cbrt66.7%
pow366.7%
*-commutative66.7%
Applied egg-rr66.7%
Taylor expanded in y.re around 0 35.8%
unpow235.8%
unpow235.8%
hypot-def84.0%
Simplified84.0%
rem-cube-cbrt84.0%
*-commutative84.0%
Applied egg-rr84.0%
Final simplification88.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp
(-
(* y.re (log (hypot x.re x.im)))
(pow (cbrt (cbrt (* y.im (atan2 x.im x.re)))) 9.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - pow(cbrt(cbrt((y_46_im * atan2(x_46_im, x_46_re)))), 9.0)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - Math.pow(Math.cbrt(Math.cbrt((y_46_im * Math.atan2(x_46_im, x_46_re)))), 9.0)));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - (cbrt(cbrt(Float64(y_46_im * atan(x_46_im, x_46_re)))) ^ 9.0)))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Power[N[Power[N[Power[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision], 9.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - {\left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)}^{9}}
\end{array}
Initial program 43.5%
Simplified81.8%
add-cube-cbrt81.8%
pow381.8%
*-commutative81.8%
Applied egg-rr81.8%
Taylor expanded in y.re around 0 45.8%
unpow245.8%
unpow245.8%
hypot-def86.1%
Simplified86.1%
add-cube-cbrt86.1%
pow386.1%
Applied egg-rr86.1%
pow-pow86.1%
pow-to-exp51.7%
metadata-eval51.7%
Applied egg-rr51.7%
exp-to-pow86.1%
Simplified86.1%
Final simplification86.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(*
(exp
(-
(* y.re (log (hypot x.re x.im)))
(pow (cbrt (* y.im (atan2 x.im x.re))) 3.0)))
(cos (* y.im (log (hypot x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - pow(cbrt((y_46_im * atan2(x_46_im, x_46_re))), 3.0))) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - Math.pow(Math.cbrt((y_46_im * Math.atan2(x_46_im, x_46_re))), 3.0))) * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - (cbrt(Float64(y_46_im * atan(x_46_im, x_46_re))) ^ 3.0))) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Power[N[Power[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - {\left(\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)
\end{array}
Initial program 43.5%
Simplified81.8%
add-cube-cbrt81.8%
pow381.8%
*-commutative81.8%
Applied egg-rr81.8%
Taylor expanded in y.re around 0 45.8%
unpow245.8%
unpow245.8%
hypot-def86.1%
Simplified86.1%
Final simplification86.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re))
(t_1 (* y.im (atan2 x.im x.re)))
(t_2 (cos (* y.im (log (hypot x.im x.re)))))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))))
(if (<= y.re -1.76e-22)
(* (cos (* y.re (atan2 x.im x.re))) t_3)
(if (<= y.re 4.8)
(* t_2 (/ t_0 (exp t_1)))
(if (<= y.re 5e+131) t_3 (* t_2 t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double t_2 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
double tmp;
if (y_46_re <= -1.76e-22) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * t_3;
} else if (y_46_re <= 4.8) {
tmp = t_2 * (t_0 / exp(t_1));
} else if (y_46_re <= 5e+131) {
tmp = t_3;
} else {
tmp = t_2 * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_1 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_3 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
double tmp;
if (y_46_re <= -1.76e-22) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * t_3;
} else if (y_46_re <= 4.8) {
tmp = t_2 * (t_0 / Math.exp(t_1));
} else if (y_46_re <= 5e+131) {
tmp = t_3;
} else {
tmp = t_2 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_1 = y_46_im * math.atan2(x_46_im, x_46_re) t_2 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_3 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) tmp = 0 if y_46_re <= -1.76e-22: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * t_3 elif y_46_re <= 4.8: tmp = t_2 * (t_0 / math.exp(t_1)) elif y_46_re <= 5e+131: tmp = t_3 else: tmp = t_2 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_2 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1)) tmp = 0.0 if (y_46_re <= -1.76e-22) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * t_3); elseif (y_46_re <= 4.8) tmp = Float64(t_2 * Float64(t_0 / exp(t_1))); elseif (y_46_re <= 5e+131) tmp = t_3; else tmp = Float64(t_2 * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; t_1 = y_46_im * atan2(x_46_im, x_46_re); t_2 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)); tmp = 0.0; if (y_46_re <= -1.76e-22) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * t_3; elseif (y_46_re <= 4.8) tmp = t_2 * (t_0 / exp(t_1)); elseif (y_46_re <= 5e+131) tmp = t_3; else tmp = t_2 * 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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.76e-22], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 4.8], N[(t$95$2 * N[(t$95$0 / N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5e+131], t$95$3, N[(t$95$2 * t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1}\\
\mathbf{if}\;y.re \leq -1.76 \cdot 10^{-22}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t_3\\
\mathbf{elif}\;y.re \leq 4.8:\\
\;\;\;\;t_2 \cdot \frac{t_0}{e^{t_1}}\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{+131}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot t_0\\
\end{array}
\end{array}
if y.re < -1.76e-22Initial program 45.0%
Taylor expanded in y.im around 0 95.1%
if -1.76e-22 < y.re < 4.79999999999999982Initial program 55.2%
exp-diff55.2%
exp-to-pow55.2%
hypot-def55.2%
*-commutative55.2%
exp-prod55.0%
+-commutative55.0%
*-commutative55.0%
fma-def55.0%
+-commutative55.0%
Simplified88.2%
Taylor expanded in y.re around 0 55.0%
unpow255.0%
unpow255.0%
hypot-def88.2%
Simplified88.2%
Taylor expanded in y.im around inf 88.6%
if 4.79999999999999982 < y.re < 4.99999999999999995e131Initial program 42.5%
Taylor expanded in y.im around 0 62.6%
Taylor expanded in y.re around 0 77.6%
if 4.99999999999999995e131 < y.re Initial program 13.3%
exp-diff11.1%
exp-to-pow11.1%
hypot-def11.1%
*-commutative11.1%
exp-prod11.1%
+-commutative11.1%
*-commutative11.1%
fma-def11.1%
+-commutative11.1%
Simplified46.7%
Taylor expanded in y.re around 0 22.2%
unpow222.2%
unpow222.2%
hypot-def64.4%
Simplified64.4%
Taylor expanded in y.im around 0 80.0%
Final simplification86.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (exp (- (* y.re (log (hypot x.re x.im))) (* y.im (atan2 x.im x.re)))) (cos (* y.im (log (hypot x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (y_46_im * atan2(x_46_im, x_46_re)))) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - (y_46_im * Math.atan2(x_46_im, x_46_re)))) * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) * math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re))))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (y_46_im * atan2(x_46_im, x_46_re)))) * cos((y_46_im * log(hypot(x_46_im, x_46_re)))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)
\end{array}
Initial program 43.5%
Simplified81.8%
add-cube-cbrt81.8%
pow381.8%
*-commutative81.8%
Applied egg-rr81.8%
Taylor expanded in y.re around 0 45.8%
unpow245.8%
unpow245.8%
hypot-def86.1%
Simplified86.1%
rem-cube-cbrt86.1%
*-commutative86.1%
Applied egg-rr86.1%
Final simplification86.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))))
(if (<= y.re -1.76e-22)
(* (cos (* y.re (atan2 x.im x.re))) t_0)
(if (<= y.re 2e-6)
(exp (* y.im (- (atan2 x.im x.re))))
(if (<= y.re 1e+133)
t_0
(*
(cos (* y.im (log (hypot x.im x.re))))
(pow (hypot x.re 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 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.76e-22) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * t_0;
} else if (y_46_re <= 2e-6) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1e+133) {
tmp = t_0;
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(hypot(x_46_re, 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.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.76e-22) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * t_0;
} else if (y_46_re <= 2e-6) {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1e+133) {
tmp = t_0;
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.pow(Math.hypot(x_46_re, 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.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -1.76e-22: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * t_0 elif y_46_re <= 2e-6: tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) elif y_46_re <= 1e+133: tmp = t_0 else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -1.76e-22) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * t_0); elseif (y_46_re <= 2e-6) tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1e+133) tmp = t_0; else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (hypot(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) t_0 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -1.76e-22) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * t_0; elseif (y_46_re <= 2e-6) tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))); elseif (y_46_re <= 1e+133) tmp = t_0; else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * (hypot(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_] := Block[{t$95$0 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.76e-22], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 2e-6], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 1e+133], t$95$0, N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -1.76 \cdot 10^{-22}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t_0\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{-6}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.re \leq 10^{+133}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.76e-22Initial program 45.0%
Taylor expanded in y.im around 0 95.1%
if -1.76e-22 < y.re < 1.99999999999999991e-6Initial program 54.4%
Taylor expanded in y.im around 0 58.0%
Taylor expanded in y.re around 0 58.0%
Taylor expanded in y.re around 0 85.6%
mul-1-neg85.6%
*-commutative85.6%
distribute-rgt-neg-in85.6%
Simplified85.6%
if 1.99999999999999991e-6 < y.re < 1e133Initial program 45.2%
Taylor expanded in y.im around 0 62.0%
Taylor expanded in y.re around 0 76.3%
if 1e133 < y.re Initial program 13.3%
exp-diff11.1%
exp-to-pow11.1%
hypot-def11.1%
*-commutative11.1%
exp-prod11.1%
+-commutative11.1%
*-commutative11.1%
fma-def11.1%
+-commutative11.1%
Simplified46.7%
Taylor expanded in y.re around 0 22.2%
unpow222.2%
unpow222.2%
hypot-def64.4%
Simplified64.4%
Taylor expanded in y.im around 0 80.0%
Final simplification85.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re))
(t_1 (* y.im (atan2 x.im x.re)))
(t_2 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -215000000000.0)
(* t_2 (/ t_0 (+ t_1 1.0)))
(if (<= y.re 1.3e-6)
(exp (* y.im (- (atan2 x.im x.re))))
(if (<= y.re 4e+131)
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))
(* t_2 t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double t_2 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -215000000000.0) {
tmp = t_2 * (t_0 / (t_1 + 1.0));
} else if (y_46_re <= 1.3e-6) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 4e+131) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else {
tmp = t_2 * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_1 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -215000000000.0) {
tmp = t_2 * (t_0 / (t_1 + 1.0));
} else if (y_46_re <= 1.3e-6) {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 4e+131) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else {
tmp = t_2 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_1 = y_46_im * math.atan2(x_46_im, x_46_re) t_2 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -215000000000.0: tmp = t_2 * (t_0 / (t_1 + 1.0)) elif y_46_re <= 1.3e-6: tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) elif y_46_re <= 4e+131: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) else: tmp = t_2 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_2 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -215000000000.0) tmp = Float64(t_2 * Float64(t_0 / Float64(t_1 + 1.0))); elseif (y_46_re <= 1.3e-6) tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); elseif (y_46_re <= 4e+131) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1)); else tmp = Float64(t_2 * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; t_1 = y_46_im * atan2(x_46_im, x_46_re); t_2 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -215000000000.0) tmp = t_2 * (t_0 / (t_1 + 1.0)); elseif (y_46_re <= 1.3e-6) tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))); elseif (y_46_re <= 4e+131) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)); else tmp = t_2 * 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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -215000000000.0], N[(t$95$2 * N[(t$95$0 / N[(t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.3e-6], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 4e+131], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision], N[(t$95$2 * t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -215000000000:\\
\;\;\;\;t_2 \cdot \frac{t_0}{t_1 + 1}\\
\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-6}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{+131}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot t_0\\
\end{array}
\end{array}
if y.re < -2.15e11Initial program 49.1%
exp-diff37.7%
exp-to-pow37.7%
hypot-def37.7%
*-commutative37.7%
exp-prod37.7%
+-commutative37.7%
*-commutative37.7%
fma-def37.7%
+-commutative37.7%
Simplified77.4%
Taylor expanded in y.re around 0 35.8%
unpow235.8%
unpow235.8%
hypot-def75.5%
Simplified75.5%
Taylor expanded in y.im around 0 86.9%
if -2.15e11 < y.re < 1.30000000000000005e-6Initial program 51.9%
Taylor expanded in y.im around 0 58.8%
Taylor expanded in y.re around 0 58.8%
Taylor expanded in y.re around 0 84.8%
mul-1-neg84.8%
*-commutative84.8%
distribute-rgt-neg-in84.8%
Simplified84.8%
if 1.30000000000000005e-6 < y.re < 3.9999999999999996e131Initial program 45.2%
Taylor expanded in y.im around 0 62.0%
Taylor expanded in y.re around 0 76.3%
if 3.9999999999999996e131 < y.re Initial program 13.3%
exp-diff11.1%
exp-to-pow11.1%
hypot-def11.1%
*-commutative11.1%
exp-prod11.1%
+-commutative11.1%
*-commutative11.1%
fma-def11.1%
+-commutative11.1%
Simplified46.7%
Taylor expanded in y.re around 0 22.2%
unpow222.2%
unpow222.2%
hypot-def64.4%
Simplified64.4%
Taylor expanded in y.im around 0 80.0%
Final simplification83.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re))
(t_1 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -1.7e+207)
(* (/ t_1 y.im) (/ (pow (hypot x.im x.re) y.re) (atan2 x.im x.re)))
(if (<= y.re 1.4e-5)
(/ t_0 (pow (exp y.im) (atan2 x.im x.re)))
(if (<= y.re 3.4e+132)
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
(* t_1 t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.7e+207) {
tmp = (t_1 / y_46_im) * (pow(hypot(x_46_im, x_46_re), y_46_re) / atan2(x_46_im, x_46_re));
} else if (y_46_re <= 1.4e-5) {
tmp = t_0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else if (y_46_re <= 3.4e+132) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
} else {
tmp = t_1 * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_1 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.7e+207) {
tmp = (t_1 / y_46_im) * (Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) / Math.atan2(x_46_im, x_46_re));
} else if (y_46_re <= 1.4e-5) {
tmp = t_0 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else if (y_46_re <= 3.4e+132) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = t_1 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_1 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -1.7e+207: tmp = (t_1 / y_46_im) * (math.pow(math.hypot(x_46_im, x_46_re), y_46_re) / math.atan2(x_46_im, x_46_re)) elif y_46_re <= 1.4e-5: tmp = t_0 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) elif y_46_re <= 3.4e+132: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) else: tmp = t_1 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -1.7e+207) tmp = Float64(Float64(t_1 / y_46_im) * Float64((hypot(x_46_im, x_46_re) ^ y_46_re) / atan(x_46_im, x_46_re))); elseif (y_46_re <= 1.4e-5) tmp = Float64(t_0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); elseif (y_46_re <= 3.4e+132) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = Float64(t_1 * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -1.7e+207) tmp = (t_1 / y_46_im) * ((hypot(x_46_im, x_46_re) ^ y_46_re) / atan2(x_46_im, x_46_re)); elseif (y_46_re <= 1.4e-5) tmp = t_0 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); elseif (y_46_re <= 3.4e+132) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); else tmp = t_1 * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.7e+207], N[(N[(t$95$1 / y$46$im), $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.4e-5], N[(t$95$0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.4e+132], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -1.7 \cdot 10^{+207}:\\
\;\;\;\;\frac{t_1}{y.im} \cdot \frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{\tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 1.4 \cdot 10^{-5}:\\
\;\;\;\;\frac{t_0}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.re \leq 3.4 \cdot 10^{+132}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot t_0\\
\end{array}
\end{array}
if y.re < -1.6999999999999999e207Initial program 42.9%
exp-diff28.6%
exp-to-pow28.6%
hypot-def28.6%
*-commutative28.6%
exp-prod28.6%
+-commutative28.6%
*-commutative28.6%
fma-def28.6%
+-commutative28.6%
Simplified61.9%
Taylor expanded in y.re around 0 28.6%
unpow228.6%
unpow228.6%
hypot-def61.9%
Simplified61.9%
Taylor expanded in y.im around 0 90.5%
Taylor expanded in y.im around inf 90.5%
times-frac90.5%
unpow290.5%
unpow290.5%
hypot-def90.5%
Simplified90.5%
if -1.6999999999999999e207 < y.re < 1.39999999999999998e-5Initial program 52.2%
exp-diff50.2%
exp-to-pow50.2%
hypot-def50.2%
*-commutative50.2%
exp-prod50.0%
+-commutative50.0%
*-commutative50.0%
fma-def50.0%
+-commutative50.0%
Simplified87.1%
Taylor expanded in y.re around 0 49.4%
unpow249.4%
unpow249.4%
hypot-def86.4%
Simplified86.4%
Taylor expanded in x.re around -inf 44.3%
mul-1-neg44.3%
cos-neg44.3%
Simplified44.3%
Taylor expanded in y.im around 0 84.5%
if 1.39999999999999998e-5 < y.re < 3.40000000000000025e132Initial program 45.2%
Taylor expanded in y.im around 0 62.0%
Taylor expanded in y.re around 0 76.3%
if 3.40000000000000025e132 < y.re Initial program 13.3%
exp-diff11.1%
exp-to-pow11.1%
hypot-def11.1%
*-commutative11.1%
exp-prod11.1%
+-commutative11.1%
*-commutative11.1%
fma-def11.1%
+-commutative11.1%
Simplified46.7%
Taylor expanded in y.re around 0 22.2%
unpow222.2%
unpow222.2%
hypot-def64.4%
Simplified64.4%
Taylor expanded in y.im around 0 80.0%
Final simplification82.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))))
(if (<= y.re -1.76e-22)
(exp (- t_1 (fabs t_0)))
(if (<= y.re 1.06e-5)
(exp (* y.im (- (atan2 x.im x.re))))
(if (<= y.re 1.5e+132)
(exp (- t_1 t_0))
(*
(cos (* y.im (log (hypot x.im x.re))))
(pow (hypot x.re 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 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double tmp;
if (y_46_re <= -1.76e-22) {
tmp = exp((t_1 - fabs(t_0)));
} else if (y_46_re <= 1.06e-5) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.5e+132) {
tmp = exp((t_1 - t_0));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(hypot(x_46_re, 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 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double tmp;
if (y_46_re <= -1.76e-22) {
tmp = Math.exp((t_1 - Math.abs(t_0)));
} else if (y_46_re <= 1.06e-5) {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.5e+132) {
tmp = Math.exp((t_1 - t_0));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) tmp = 0 if y_46_re <= -1.76e-22: tmp = math.exp((t_1 - math.fabs(t_0))) elif y_46_re <= 1.06e-5: tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) elif y_46_re <= 1.5e+132: tmp = math.exp((t_1 - t_0)) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) tmp = 0.0 if (y_46_re <= -1.76e-22) tmp = exp(Float64(t_1 - abs(t_0))); elseif (y_46_re <= 1.06e-5) tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1.5e+132) tmp = exp(Float64(t_1 - t_0)); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (hypot(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) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = 0.0; if (y_46_re <= -1.76e-22) tmp = exp((t_1 - abs(t_0))); elseif (y_46_re <= 1.06e-5) tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))); elseif (y_46_re <= 1.5e+132) tmp = exp((t_1 - t_0)); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * (hypot(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_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, If[LessEqual[y$46$re, -1.76e-22], N[Exp[N[(t$95$1 - N[Abs[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 1.06e-5], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 1.5e+132], N[Exp[N[(t$95$1 - t$95$0), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
\mathbf{if}\;y.re \leq -1.76 \cdot 10^{-22}:\\
\;\;\;\;e^{t_1 - \left|t_0\right|}\\
\mathbf{elif}\;y.re \leq 1.06 \cdot 10^{-5}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.re \leq 1.5 \cdot 10^{+132}:\\
\;\;\;\;e^{t_1 - t_0}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.76e-22Initial program 45.0%
Taylor expanded in y.im around 0 95.1%
Taylor expanded in y.re around 0 83.4%
add-sqr-sqrt55.0%
sqrt-unprod83.5%
pow283.5%
*-commutative83.5%
Applied egg-rr83.5%
unpow283.5%
rem-sqrt-square83.5%
Simplified83.5%
if -1.76e-22 < y.re < 1.06e-5Initial program 54.4%
Taylor expanded in y.im around 0 58.0%
Taylor expanded in y.re around 0 58.0%
Taylor expanded in y.re around 0 85.6%
mul-1-neg85.6%
*-commutative85.6%
distribute-rgt-neg-in85.6%
Simplified85.6%
if 1.06e-5 < y.re < 1.4999999999999999e132Initial program 45.2%
Taylor expanded in y.im around 0 62.0%
Taylor expanded in y.re around 0 76.3%
if 1.4999999999999999e132 < y.re Initial program 13.3%
exp-diff11.1%
exp-to-pow11.1%
hypot-def11.1%
*-commutative11.1%
exp-prod11.1%
+-commutative11.1%
*-commutative11.1%
fma-def11.1%
+-commutative11.1%
Simplified46.7%
Taylor expanded in y.re around 0 22.2%
unpow222.2%
unpow222.2%
hypot-def64.4%
Simplified64.4%
Taylor expanded in y.im around 0 80.0%
Final simplification82.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(cos (* y.im (log (hypot x.im x.re))))
(pow (hypot x.re x.im) y.re))))
(if (<= y.re -215000000000.0)
t_0
(if (<= y.re 8.5e-11)
(exp (* y.im (- (atan2 x.im x.re))))
(if (<= y.re 5.2e+132)
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -215000000000.0) {
tmp = t_0;
} else if (y_46_re <= 8.5e-11) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 5.2e+132) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -215000000000.0) {
tmp = t_0;
} else if (y_46_re <= 8.5e-11) {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 5.2e+132) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -215000000000.0: tmp = t_0 elif y_46_re <= 8.5e-11: tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) elif y_46_re <= 5.2e+132: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (hypot(x_46_re, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -215000000000.0) tmp = t_0; elseif (y_46_re <= 8.5e-11) tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); elseif (y_46_re <= 5.2e+132) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * (hypot(x_46_re, x_46_im) ^ y_46_re); tmp = 0.0; if (y_46_re <= -215000000000.0) tmp = t_0; elseif (y_46_re <= 8.5e-11) tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))); elseif (y_46_re <= 5.2e+132) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); else tmp = 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[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -215000000000.0], t$95$0, If[LessEqual[y$46$re, 8.5e-11], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 5.2e+132], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -215000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 8.5 \cdot 10^{-11}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.re \leq 5.2 \cdot 10^{+132}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.re < -2.15e11 or 5.2e132 < y.re Initial program 32.7%
exp-diff25.5%
exp-to-pow25.5%
hypot-def25.5%
*-commutative25.5%
exp-prod25.5%
+-commutative25.5%
*-commutative25.5%
fma-def25.5%
+-commutative25.5%
Simplified63.3%
Taylor expanded in y.re around 0 29.6%
unpow229.6%
unpow229.6%
hypot-def70.4%
Simplified70.4%
Taylor expanded in y.im around 0 82.7%
if -2.15e11 < y.re < 8.50000000000000037e-11Initial program 51.9%
Taylor expanded in y.im around 0 58.8%
Taylor expanded in y.re around 0 58.8%
Taylor expanded in y.re around 0 84.8%
mul-1-neg84.8%
*-commutative84.8%
distribute-rgt-neg-in84.8%
Simplified84.8%
if 8.50000000000000037e-11 < y.re < 5.2e132Initial program 45.2%
Taylor expanded in y.im around 0 62.0%
Taylor expanded in y.re around 0 76.3%
Final simplification82.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.76e-22) (not (<= y.re 1.15e-5)))
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
(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 tmp;
if ((y_46_re <= -1.76e-22) || !(y_46_re <= 1.15e-5)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
} else {
tmp = exp((y_46_im * -atan2(x_46_im, x_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 ((y_46re <= (-1.76d-22)) .or. (.not. (y_46re <= 1.15d-5))) then
tmp = exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - (y_46im * atan2(x_46im, x_46re))))
else
tmp = exp((y_46im * -atan2(x_46im, x_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 ((y_46_re <= -1.76e-22) || !(y_46_re <= 1.15e-5)) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = 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): tmp = 0 if (y_46_re <= -1.76e-22) or not (y_46_re <= 1.15e-5): tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) else: tmp = 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) tmp = 0.0 if ((y_46_re <= -1.76e-22) || !(y_46_re <= 1.15e-5)) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.76e-22) || ~((y_46_re <= 1.15e-5))) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); else tmp = 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_] := If[Or[LessEqual[y$46$re, -1.76e-22], N[Not[LessEqual[y$46$re, 1.15e-5]], $MachinePrecision]], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.76 \cdot 10^{-22} \lor \neg \left(y.re \leq 1.15 \cdot 10^{-5}\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -1.76e-22 or 1.15e-5 < y.re Initial program 35.4%
Taylor expanded in y.im around 0 72.8%
Taylor expanded in y.re around 0 75.6%
if -1.76e-22 < y.re < 1.15e-5Initial program 54.4%
Taylor expanded in y.im around 0 58.0%
Taylor expanded in y.re around 0 58.0%
Taylor expanded in y.re around 0 85.6%
mul-1-neg85.6%
*-commutative85.6%
distribute-rgt-neg-in85.6%
Simplified85.6%
Final simplification79.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.5e-16) (not (<= y.re 0.00015))) (pow (sqrt (+ (* x.re x.re) (* x.im x.im))) y.re) (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 tmp;
if ((y_46_re <= -3.5e-16) || !(y_46_re <= 0.00015)) {
tmp = pow(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else {
tmp = exp((y_46_im * -atan2(x_46_im, x_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 ((y_46re <= (-3.5d-16)) .or. (.not. (y_46re <= 0.00015d0))) then
tmp = sqrt(((x_46re * x_46re) + (x_46im * x_46im))) ** y_46re
else
tmp = exp((y_46im * -atan2(x_46im, x_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 ((y_46_re <= -3.5e-16) || !(y_46_re <= 0.00015)) {
tmp = Math.pow(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else {
tmp = 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): tmp = 0 if (y_46_re <= -3.5e-16) or not (y_46_re <= 0.00015): tmp = math.pow(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re) else: tmp = 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) tmp = 0.0 if ((y_46_re <= -3.5e-16) || !(y_46_re <= 0.00015)) tmp = sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) ^ y_46_re; else tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -3.5e-16) || ~((y_46_re <= 0.00015))) tmp = sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))) ^ y_46_re; else tmp = 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_] := If[Or[LessEqual[y$46$re, -3.5e-16], N[Not[LessEqual[y$46$re, 0.00015]], $MachinePrecision]], N[Power[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.5 \cdot 10^{-16} \lor \neg \left(y.re \leq 0.00015\right):\\
\;\;\;\;{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -3.50000000000000017e-16 or 1.49999999999999987e-4 < y.re Initial program 35.0%
exp-diff26.6%
exp-to-pow26.6%
hypot-def26.6%
*-commutative26.6%
exp-prod25.9%
+-commutative25.9%
*-commutative25.9%
fma-def25.9%
+-commutative25.9%
Simplified61.5%
Taylor expanded in y.re around 0 29.4%
unpow229.4%
unpow229.4%
hypot-def67.1%
Simplified67.1%
Taylor expanded in y.im around 0 75.7%
Taylor expanded in y.im around 0 70.8%
+-commutative70.8%
unpow270.8%
unpow270.8%
Simplified70.8%
if -3.50000000000000017e-16 < y.re < 1.49999999999999987e-4Initial program 54.2%
Taylor expanded in y.im around 0 58.6%
Taylor expanded in y.re around 0 58.6%
Taylor expanded in y.re around 0 85.2%
mul-1-neg85.2%
*-commutative85.2%
distribute-rgt-neg-in85.2%
Simplified85.2%
Final simplification77.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -235000000000.0) (not (<= y.re 3.8e-5))) (pow (hypot x.im x.re) y.re) (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 tmp;
if ((y_46_re <= -235000000000.0) || !(y_46_re <= 3.8e-5)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 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 tmp;
if ((y_46_re <= -235000000000.0) || !(y_46_re <= 3.8e-5)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 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): tmp = 0 if (y_46_re <= -235000000000.0) or not (y_46_re <= 3.8e-5): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = 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) tmp = 0.0 if ((y_46_re <= -235000000000.0) || !(y_46_re <= 3.8e-5)) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -235000000000.0) || ~((y_46_re <= 3.8e-5))) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = 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_] := If[Or[LessEqual[y$46$re, -235000000000.0], N[Not[LessEqual[y$46$re, 3.8e-5]], $MachinePrecision]], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -235000000000 \lor \neg \left(y.re \leq 3.8 \cdot 10^{-5}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -2.35e11 or 3.8000000000000002e-5 < y.re Initial program 36.0%
exp-diff27.3%
exp-to-pow27.3%
hypot-def27.3%
*-commutative27.3%
exp-prod26.6%
+-commutative26.6%
*-commutative26.6%
fma-def26.6%
+-commutative26.6%
Simplified61.2%
Taylor expanded in y.re around 0 30.2%
unpow230.2%
unpow230.2%
hypot-def66.9%
Simplified66.9%
Taylor expanded in y.im around 0 76.4%
Taylor expanded in y.im around 0 70.7%
unpow270.7%
unpow270.7%
hypot-def70.7%
Simplified70.7%
if -2.35e11 < y.re < 3.8000000000000002e-5Initial program 52.4%
Taylor expanded in y.im around 0 59.2%
Taylor expanded in y.re around 0 59.2%
Taylor expanded in y.re around 0 84.9%
mul-1-neg84.9%
*-commutative84.9%
distribute-rgt-neg-in84.9%
Simplified84.9%
Final simplification77.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow (hypot x.im x.re) y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return hypot(x_46_im, x_46_re) ^ y_46_re end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 43.5%
exp-diff38.8%
exp-to-pow38.8%
hypot-def38.8%
*-commutative38.8%
exp-prod38.3%
+-commutative38.3%
*-commutative38.3%
fma-def38.3%
+-commutative38.3%
Simplified73.0%
Taylor expanded in y.re around 0 40.3%
unpow240.3%
unpow240.3%
hypot-def76.1%
Simplified76.1%
Taylor expanded in y.im around 0 68.7%
Taylor expanded in y.im around 0 57.5%
unpow257.5%
unpow257.5%
hypot-def65.0%
Simplified65.0%
Final simplification65.0%
herbie shell --seed 2023283
(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)))))