
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_2 (cos (+ (* t_1 y.im) t_0))) 0.9999999995)
(* t_2 (fabs (cos (fma y.im (log (hypot x.im x.re)) t_0))))
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(cos t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_2 * cos(((t_1 * y_46_im) + t_0))) <= 0.9999999995) {
tmp = t_2 * fabs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)));
} else {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_2 * cos(Float64(Float64(t_1 * y_46_im) + t_0))) <= 0.9999999995) tmp = Float64(t_2 * abs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)))); else tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * 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$2 * N[Cos[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 0.9999999995], N[(t$95$2 * N[Abs[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{t\_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_2 \cdot \cos \left(t\_1 \cdot y.im + t\_0\right) \leq 0.9999999995:\\
\;\;\;\;t\_2 \cdot \left|\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos t\_0\\
\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)))) < 0.99999999949999996Initial program 74.2%
fma-define74.2%
hypot-define74.2%
*-commutative74.2%
add-sqr-sqrt32.3%
sqrt-unprod79.8%
pow279.8%
Applied egg-rr79.8%
unpow279.8%
rem-sqrt-square79.8%
fma-define79.8%
hypot-undefine79.8%
unpow279.8%
unpow279.8%
+-commutative79.8%
+-commutative79.8%
fma-define79.8%
Simplified79.8%
if 0.99999999949999996 < (*.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 23.0%
fmm-def23.0%
hypot-define23.0%
distribute-rgt-neg-out23.0%
fma-define23.0%
hypot-define77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in y.re around inf 21.9%
+-commutative21.9%
associate-/l*23.6%
unpow223.6%
unpow223.6%
hypot-undefine72.6%
Simplified72.6%
add-cube-cbrt72.7%
pow373.9%
hypot-undefine24.7%
+-commutative24.7%
hypot-define73.9%
Applied egg-rr73.9%
Taylor expanded in y.im around 0 79.3%
Final simplification79.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_2 (cos (+ (* t_1 y.im) t_0))) 0.9999999995)
(* t_2 (cos (* y.im (log (hypot x.im x.re)))))
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(cos t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_2 * cos(((t_1 * y_46_im) + t_0))) <= 0.9999999995) {
tmp = t_2 * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_2 * cos(Float64(Float64(t_1 * y_46_im) + t_0))) <= 0.9999999995) tmp = Float64(t_2 * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * 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$2 * N[Cos[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 0.9999999995], N[(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]), $MachinePrecision], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{t\_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_2 \cdot \cos \left(t\_1 \cdot y.im + t\_0\right) \leq 0.9999999995:\\
\;\;\;\;t\_2 \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos t\_0\\
\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)))) < 0.99999999949999996Initial program 74.2%
Taylor expanded in y.re around 0 79.4%
*-commutative79.4%
unpow279.4%
unpow279.4%
hypot-undefine79.4%
Simplified79.4%
if 0.99999999949999996 < (*.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 23.0%
fmm-def23.0%
hypot-define23.0%
distribute-rgt-neg-out23.0%
fma-define23.0%
hypot-define77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in y.re around inf 21.9%
+-commutative21.9%
associate-/l*23.6%
unpow223.6%
unpow223.6%
hypot-undefine72.6%
Simplified72.6%
add-cube-cbrt72.7%
pow373.9%
hypot-undefine24.7%
+-commutative24.7%
hypot-define73.9%
Applied egg-rr73.9%
Taylor expanded in y.im around 0 79.3%
Final simplification79.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.im -3.3e+118)
t_1
(if (<= y.im 11600000.0)
(pow
(pow (* (cos t_0) (pow (hypot x.re x.im) y.re)) 3.0)
0.3333333333333333)
(* t_1 (cos (fma (log (hypot x.re x.im)) y.im t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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 <= -3.3e+118) {
tmp = t_1;
} else if (y_46_im <= 11600000.0) {
tmp = pow(pow((cos(t_0) * pow(hypot(x_46_re, x_46_im), y_46_re)), 3.0), 0.3333333333333333);
} else {
tmp = t_1 * cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (y_46_im <= -3.3e+118) tmp = t_1; elseif (y_46_im <= 11600000.0) tmp = (Float64(cos(t_0) * (hypot(x_46_re, x_46_im) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; else tmp = Float64(t_1 * cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $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, -3.3e+118], t$95$1, If[LessEqual[y$46$im, 11600000.0], N[Power[N[Power[N[(N[Cos[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision], N[(t$95$1 * N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.im \leq -3.3 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 11600000:\\
\;\;\;\;{\left({\left(\cos t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)}^{3}\right)}^{0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)\\
\end{array}
\end{array}
if y.im < -3.3e118Initial program 31.7%
fmm-def31.7%
hypot-define31.7%
distribute-rgt-neg-out31.7%
fma-define31.7%
hypot-define67.0%
*-commutative67.0%
Simplified67.0%
Taylor expanded in y.re around inf 23.3%
+-commutative23.3%
associate-/l*25.0%
unpow225.0%
unpow225.0%
hypot-undefine50.4%
Simplified50.4%
add-cube-cbrt48.7%
pow350.3%
hypot-undefine23.3%
+-commutative23.3%
hypot-define50.3%
Applied egg-rr50.3%
Taylor expanded in y.im around 0 73.7%
Taylor expanded in y.re around 0 67.2%
neg-mul-167.2%
distribute-lft-neg-in67.2%
Simplified67.2%
if -3.3e118 < y.im < 1.16e7Initial program 43.1%
fmm-def43.1%
hypot-define43.1%
distribute-rgt-neg-out43.1%
fma-define43.1%
hypot-define85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in y.im around 0 65.2%
unpow265.2%
unpow265.2%
hypot-undefine81.1%
Simplified81.1%
add-cbrt-cube81.1%
pow1/386.2%
pow386.2%
hypot-undefine70.3%
+-commutative70.3%
hypot-define86.2%
Applied egg-rr86.2%
if 1.16e7 < y.im Initial program 35.4%
fmm-def35.4%
hypot-define35.4%
distribute-rgt-neg-out35.4%
fma-define35.4%
hypot-define65.9%
*-commutative65.9%
Simplified65.9%
Taylor expanded in y.re around 0 59.3%
neg-mul-159.3%
distribute-rgt-neg-in59.3%
Simplified59.3%
Final simplification75.6%
(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 -2.4e+122)
(pow (pow (* t_0 (pow (hypot x.re x.im) y.re)) 3.0) 0.3333333333333333)
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -2.4e+122) {
tmp = pow(pow((t_0 * pow(hypot(x_46_re, x_46_im), y_46_re)), 3.0), 0.3333333333333333);
} else {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * t_0;
}
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 <= -2.4e+122) tmp = (Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; else tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * t_0); end return 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, -2.4e+122], N[Power[N[Power[N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $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 -2.4 \cdot 10^{+122}:\\
\;\;\;\;{\left({\left(t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)}^{3}\right)}^{0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -2.4000000000000002e122Initial program 40.5%
fmm-def40.5%
hypot-define40.5%
distribute-rgt-neg-out40.5%
fma-define40.5%
hypot-define78.6%
*-commutative78.6%
Simplified78.6%
Taylor expanded in y.im around 0 78.7%
unpow278.7%
unpow278.7%
hypot-undefine78.7%
Simplified78.7%
add-cbrt-cube78.7%
pow1/388.2%
pow388.2%
hypot-undefine88.2%
+-commutative88.2%
hypot-define88.2%
Applied egg-rr88.2%
if -2.4000000000000002e122 < y.re Initial program 38.3%
fmm-def38.3%
hypot-define38.3%
distribute-rgt-neg-out38.3%
fma-define38.3%
hypot-define76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in y.re around inf 32.1%
+-commutative32.1%
associate-/l*33.2%
unpow233.2%
unpow233.2%
hypot-undefine66.5%
Simplified66.5%
add-cube-cbrt66.6%
pow367.0%
hypot-undefine34.1%
+-commutative34.1%
hypot-define67.0%
Applied egg-rr67.0%
Taylor expanded in y.im around 0 76.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -3.4e+118) (not (<= y.im 3000000000.0)))
(exp (* (atan2 x.im x.re) (- y.im)))
(pow
(pow (* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.re x.im) y.re)) 3.0)
0.3333333333333333)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -3.4e+118) || !(y_46_im <= 3000000000.0)) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(pow((cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_re, x_46_im), y_46_re)), 3.0), 0.3333333333333333);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -3.4e+118) || !(y_46_im <= 3000000000.0)) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(Math.pow((Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re)), 3.0), 0.3333333333333333);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -3.4e+118) or not (y_46_im <= 3000000000.0): tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(math.pow((math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re)), 3.0), 0.3333333333333333) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -3.4e+118) || !(y_46_im <= 3000000000.0)) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = (Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_re, x_46_im) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -3.4e+118) || ~((y_46_im <= 3000000000.0))) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = ((cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_re, x_46_im) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -3.4e+118], N[Not[LessEqual[y$46$im, 3000000000.0]], $MachinePrecision]], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[Power[N[Power[N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.4 \cdot 10^{+118} \lor \neg \left(y.im \leq 3000000000\right):\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.im < -3.39999999999999986e118 or 3e9 < y.im Initial program 33.5%
fmm-def33.5%
hypot-define33.5%
distribute-rgt-neg-out33.5%
fma-define33.5%
hypot-define66.5%
*-commutative66.5%
Simplified66.5%
Taylor expanded in y.re around inf 22.3%
+-commutative22.3%
associate-/l*23.3%
unpow223.3%
unpow223.3%
hypot-undefine49.6%
Simplified49.6%
add-cube-cbrt48.9%
pow350.6%
hypot-undefine23.3%
+-commutative23.3%
hypot-define50.6%
Applied egg-rr50.6%
Taylor expanded in y.im around 0 68.6%
Taylor expanded in y.re around 0 62.9%
neg-mul-162.9%
distribute-lft-neg-in62.9%
Simplified62.9%
if -3.39999999999999986e118 < y.im < 3e9Initial program 43.1%
fmm-def43.1%
hypot-define43.1%
distribute-rgt-neg-out43.1%
fma-define43.1%
hypot-define85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in y.im around 0 65.2%
unpow265.2%
unpow265.2%
hypot-undefine81.1%
Simplified81.1%
add-cbrt-cube81.1%
pow1/386.2%
pow386.2%
hypot-undefine70.3%
+-commutative70.3%
hypot-define86.2%
Applied egg-rr86.2%
Final simplification75.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -4.5e-18)
(* (cos (* y.re (atan2 x.im x.re))) t_0)
(if (<= y.re 6.9e+44)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_0 (cos (* y.re (log (exp (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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -4.5e-18) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * t_0;
} else if (y_46_re <= 6.9e+44) {
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 {
tmp = t_0 * cos((y_46_re * log(exp(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.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -4.5e-18) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * t_0;
} else if (y_46_re <= 6.9e+44) {
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 {
tmp = t_0 * Math.cos((y_46_re * Math.log(Math.exp(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.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -4.5e-18: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * t_0 elif y_46_re <= 6.9e+44: 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: tmp = t_0 * math.cos((y_46_re * math.log(math.exp(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 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -4.5e-18) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * t_0); elseif (y_46_re <= 6.9e+44) 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)))); else tmp = Float64(t_0 * cos(Float64(y_46_re * log(exp(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 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -4.5e-18) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * t_0; elseif (y_46_re <= 6.9e+44) 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 tmp = t_0 * cos((y_46_re * log(exp(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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -4.5e-18], 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, 6.9e+44], 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], N[(t$95$0 * N[Cos[N[(y$46$re * N[Log[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-18}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 6.9 \cdot 10^{+44}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \log \left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\\
\end{array}
\end{array}
if y.re < -4.49999999999999994e-18Initial program 40.0%
fmm-def40.0%
hypot-define40.0%
distribute-rgt-neg-out40.0%
fma-define40.0%
hypot-define80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in y.im around 0 76.2%
unpow276.2%
unpow276.2%
hypot-undefine76.2%
Simplified76.2%
if -4.49999999999999994e-18 < y.re < 6.8999999999999997e44Initial program 40.1%
fmm-def40.1%
hypot-define40.1%
distribute-rgt-neg-out40.1%
fma-define40.1%
hypot-define78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in y.re around 0 39.3%
*-commutative39.3%
unpow239.3%
unpow239.3%
hypot-undefine75.7%
neg-mul-175.7%
distribute-rgt-neg-in75.7%
Simplified75.7%
if 6.8999999999999997e44 < y.re Initial program 33.9%
fmm-def33.9%
hypot-define33.9%
distribute-rgt-neg-out33.9%
fma-define33.9%
hypot-define67.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in y.im around 0 64.5%
unpow264.5%
unpow264.5%
hypot-undefine64.5%
Simplified64.5%
add-log-exp66.2%
Applied egg-rr66.2%
Final simplification73.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -4.5e-18) (not (<= y.re 1.46e+46)))
(* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.5e-18) || !(y_46_re <= 1.46e+46)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * 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)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.5e-18) || !(y_46_re <= 1.46e+46)) {
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);
} else {
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));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -4.5e-18) or not (y_46_re <= 1.46e+46): 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) else: 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)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -4.5e-18) || !(y_46_re <= 1.46e+46)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (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)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -4.5e-18) || ~((y_46_re <= 1.46e+46))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -4.5e-18], N[Not[LessEqual[y$46$re, 1.46e+46]], $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], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-18} \lor \neg \left(y.re \leq 1.46 \cdot 10^{+46}\right):\\
\;\;\;\;\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}\\
\mathbf{else}:\\
\;\;\;\;\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)}\\
\end{array}
\end{array}
if y.re < -4.49999999999999994e-18 or 1.46e46 < y.re Initial program 37.3%
fmm-def37.3%
hypot-define37.3%
distribute-rgt-neg-out37.3%
fma-define37.3%
hypot-define74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in y.im around 0 71.1%
unpow271.1%
unpow271.1%
hypot-undefine71.1%
Simplified71.1%
if -4.49999999999999994e-18 < y.re < 1.46e46Initial program 40.1%
fmm-def40.1%
hypot-define40.1%
distribute-rgt-neg-out40.1%
fma-define40.1%
hypot-define78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in y.re around 0 39.3%
*-commutative39.3%
unpow239.3%
unpow239.3%
hypot-undefine75.7%
neg-mul-175.7%
distribute-rgt-neg-in75.7%
Simplified75.7%
Final simplification73.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -6.2e+123) (not (<= y.im 4000000.0))) (exp (* (atan2 x.im x.re) (- y.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 ((y_46_im <= -6.2e+123) || !(y_46_im <= 4000000.0)) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_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 ((y_46_im <= -6.2e+123) || !(y_46_im <= 4000000.0)) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -6.2e+123) or not (y_46_im <= 4000000.0): tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -6.2e+123) || !(y_46_im <= 4000000.0)) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -6.2e+123) || ~((y_46_im <= 4000000.0))) tmp = exp((atan2(x_46_im, x_46_re) * -y_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[Or[LessEqual[y$46$im, -6.2e+123], N[Not[LessEqual[y$46$im, 4000000.0]], $MachinePrecision]], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $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}\;y.im \leq -6.2 \cdot 10^{+123} \lor \neg \left(y.im \leq 4000000\right):\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -6.20000000000000013e123 or 4e6 < y.im Initial program 33.2%
fmm-def33.2%
hypot-define33.2%
distribute-rgt-neg-out33.2%
fma-define33.2%
hypot-define65.9%
*-commutative65.9%
Simplified65.9%
Taylor expanded in y.re around inf 21.9%
+-commutative21.9%
associate-/l*22.9%
unpow222.9%
unpow222.9%
hypot-undefine48.7%
Simplified48.7%
add-cube-cbrt48.0%
pow349.8%
hypot-undefine22.9%
+-commutative22.9%
hypot-define49.8%
Applied egg-rr49.8%
Taylor expanded in y.im around 0 69.0%
Taylor expanded in y.re around 0 64.0%
neg-mul-164.0%
distribute-lft-neg-in64.0%
Simplified64.0%
if -6.20000000000000013e123 < y.im < 4e6Initial program 43.2%
fmm-def43.2%
hypot-define43.2%
distribute-rgt-neg-out43.2%
fma-define43.2%
hypot-define85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y.im around 0 65.0%
unpow265.0%
unpow265.0%
hypot-undefine80.7%
Simplified80.7%
Final simplification73.0%
(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 -1.05e+18)
(* t_0 (pow x.re y.re))
(if (<= y.re 2.55e-20)
(exp (* (atan2 x.im x.re) (- y.im)))
(if (<= y.re 1.7e+142)
(+ 1.0 (log (pow (hypot x.re x.im) 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 <= -1.05e+18) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else if (y_46_re <= 2.55e-20) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1.7e+142) {
tmp = 1.0 + log(pow(hypot(x_46_re, x_46_im), 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 <= -1.05e+18) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else if (y_46_re <= 2.55e-20) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1.7e+142) {
tmp = 1.0 + Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), 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 <= -1.05e+18: tmp = t_0 * math.pow(x_46_re, y_46_re) elif y_46_re <= 2.55e-20: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif y_46_re <= 1.7e+142: tmp = 1.0 + math.log(math.pow(math.hypot(x_46_re, x_46_im), 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 <= -1.05e+18) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); elseif (y_46_re <= 2.55e-20) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); elseif (y_46_re <= 1.7e+142) tmp = Float64(1.0 + log((hypot(x_46_re, x_46_im) ^ 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 <= -1.05e+18) tmp = t_0 * (x_46_re ^ y_46_re); elseif (y_46_re <= 2.55e-20) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); elseif (y_46_re <= 1.7e+142) tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ 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, -1.05e+18], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.55e-20], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 1.7e+142], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 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 -1.05 \cdot 10^{+18}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{elif}\;y.re \leq 2.55 \cdot 10^{-20}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{+142}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.05e18Initial program 40.0%
fmm-def40.0%
hypot-define40.0%
distribute-rgt-neg-out40.0%
fma-define40.0%
hypot-define81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y.im around 0 77.1%
unpow277.1%
unpow277.1%
hypot-undefine77.1%
Simplified77.1%
Taylor expanded in x.im around 0 58.9%
if -1.05e18 < y.re < 2.55000000000000009e-20Initial program 41.5%
fmm-def41.5%
hypot-define41.5%
distribute-rgt-neg-out41.5%
fma-define41.5%
hypot-define78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in y.re around inf 29.7%
+-commutative29.7%
associate-/l*30.1%
unpow230.1%
unpow230.1%
hypot-undefine58.6%
Simplified58.6%
add-cube-cbrt60.3%
pow361.2%
hypot-undefine32.7%
+-commutative32.7%
hypot-define61.2%
Applied egg-rr61.2%
Taylor expanded in y.im around 0 76.9%
Taylor expanded in y.re around 0 75.1%
neg-mul-175.1%
distribute-lft-neg-in75.1%
Simplified75.1%
if 2.55000000000000009e-20 < y.re < 1.6999999999999999e142Initial program 32.4%
fmm-def32.4%
hypot-define32.4%
distribute-rgt-neg-out32.4%
fma-define32.4%
hypot-define70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in y.im around 0 49.0%
unpow249.0%
unpow249.0%
hypot-undefine49.7%
Simplified49.7%
Taylor expanded in y.re around 0 31.3%
+-commutative31.3%
unpow231.3%
unpow231.3%
hypot-undefine6.1%
Simplified6.1%
*-commutative6.1%
add-log-exp55.2%
exp-to-pow55.2%
Applied egg-rr55.2%
if 1.6999999999999999e142 < y.re Initial program 34.1%
fmm-def34.1%
hypot-define34.1%
distribute-rgt-neg-out34.1%
fma-define34.1%
hypot-define68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in y.im around 0 66.0%
unpow266.0%
unpow266.0%
hypot-undefine66.0%
Simplified66.0%
Taylor expanded in x.re around 0 61.4%
Final simplification65.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re))))
(if (<= y.re -1.25e+29)
t_0
(if (<= y.re 2.55e-20)
(exp (* (atan2 x.im x.re) (- y.im)))
(if (<= y.re 3.4e+139)
(+ 1.0 (log (pow (hypot x.re x.im) y.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_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.25e+29) {
tmp = t_0;
} else if (y_46_re <= 2.55e-20) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 3.4e+139) {
tmp = 1.0 + log(pow(hypot(x_46_re, x_46_im), y_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_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.25e+29) {
tmp = t_0;
} else if (y_46_re <= 2.55e-20) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 3.4e+139) {
tmp = 1.0 + Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_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_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) tmp = 0 if y_46_re <= -1.25e+29: tmp = t_0 elif y_46_re <= 2.55e-20: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif y_46_re <= 3.4e+139: tmp = 1.0 + math.log(math.pow(math.hypot(x_46_re, x_46_im), y_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_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.25e+29) tmp = t_0; elseif (y_46_re <= 2.55e-20) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); elseif (y_46_re <= 3.4e+139) tmp = Float64(1.0 + log((hypot(x_46_re, x_46_im) ^ y_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_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); tmp = 0.0; if (y_46_re <= -1.25e+29) tmp = t_0; elseif (y_46_re <= 2.55e-20) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); elseif (y_46_re <= 3.4e+139) tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ y_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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.25e+29], t$95$0, If[LessEqual[y$46$re, 2.55e-20], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 3.4e+139], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{+29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.55 \cdot 10^{-20}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 3.4 \cdot 10^{+139}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.25e29 or 3.4000000000000002e139 < y.re Initial program 35.9%
fmm-def35.9%
hypot-define35.9%
distribute-rgt-neg-out35.9%
fma-define35.9%
hypot-define75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in y.im around 0 72.0%
unpow272.0%
unpow272.0%
hypot-undefine72.0%
Simplified72.0%
Taylor expanded in x.re around 0 58.7%
if -1.25e29 < y.re < 2.55000000000000009e-20Initial program 43.0%
fmm-def43.0%
hypot-define43.0%
distribute-rgt-neg-out43.0%
fma-define43.0%
hypot-define79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.re around inf 31.6%
+-commutative31.6%
associate-/l*31.9%
unpow231.9%
unpow231.9%
hypot-undefine59.7%
Simplified59.7%
add-cube-cbrt61.3%
pow362.2%
hypot-undefine34.5%
+-commutative34.5%
hypot-define62.2%
Applied egg-rr62.2%
Taylor expanded in y.im around 0 77.5%
Taylor expanded in y.re around 0 74.9%
neg-mul-174.9%
distribute-lft-neg-in74.9%
Simplified74.9%
if 2.55000000000000009e-20 < y.re < 3.4000000000000002e139Initial program 32.4%
fmm-def32.4%
hypot-define32.4%
distribute-rgt-neg-out32.4%
fma-define32.4%
hypot-define70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in y.im around 0 49.0%
unpow249.0%
unpow249.0%
hypot-undefine49.7%
Simplified49.7%
Taylor expanded in y.re around 0 31.3%
+-commutative31.3%
unpow231.3%
unpow231.3%
hypot-undefine6.1%
Simplified6.1%
*-commutative6.1%
add-log-exp55.2%
exp-to-pow55.2%
Applied egg-rr55.2%
Final simplification65.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.5e+96) (not (<= y.im 1.1e-13))) (exp (* (atan2 x.im x.re) (- y.im))) (+ 1.0 (log (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 tmp;
if ((y_46_im <= -1.5e+96) || !(y_46_im <= 1.1e-13)) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 1.0 + log(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 tmp;
if ((y_46_im <= -1.5e+96) || !(y_46_im <= 1.1e-13)) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 1.0 + Math.log(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): tmp = 0 if (y_46_im <= -1.5e+96) or not (y_46_im <= 1.1e-13): tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = 1.0 + math.log(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) tmp = 0.0 if ((y_46_im <= -1.5e+96) || !(y_46_im <= 1.1e-13)) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = Float64(1.0 + log((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) tmp = 0.0; if ((y_46_im <= -1.5e+96) || ~((y_46_im <= 1.1e-13))) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = 1.0 + log((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_] := If[Or[LessEqual[y$46$im, -1.5e+96], N[Not[LessEqual[y$46$im, 1.1e-13]], $MachinePrecision]], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.5 \cdot 10^{+96} \lor \neg \left(y.im \leq 1.1 \cdot 10^{-13}\right):\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.im < -1.5e96 or 1.09999999999999998e-13 < y.im Initial program 34.0%
fmm-def34.0%
hypot-define34.0%
distribute-rgt-neg-out34.0%
fma-define34.0%
hypot-define68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in y.re around inf 23.5%
+-commutative23.5%
associate-/l*24.4%
unpow224.4%
unpow224.4%
hypot-undefine52.4%
Simplified52.4%
add-cube-cbrt51.8%
pow353.3%
hypot-undefine24.4%
+-commutative24.4%
hypot-define53.3%
Applied egg-rr53.3%
Taylor expanded in y.im around 0 70.2%
Taylor expanded in y.re around 0 63.3%
neg-mul-163.3%
distribute-lft-neg-in63.3%
Simplified63.3%
if -1.5e96 < y.im < 1.09999999999999998e-13Initial program 43.1%
fmm-def43.1%
hypot-define43.1%
distribute-rgt-neg-out43.1%
fma-define43.1%
hypot-define84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in y.im around 0 64.2%
unpow264.2%
unpow264.2%
hypot-undefine80.5%
Simplified80.5%
Taylor expanded in y.re around 0 31.3%
+-commutative31.3%
unpow231.3%
unpow231.3%
hypot-undefine37.0%
Simplified37.0%
*-commutative37.0%
add-log-exp60.2%
exp-to-pow60.2%
Applied egg-rr60.2%
Final simplification61.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (* (atan2 x.im x.re) (- y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = exp((atan2(x_46im, x_46re) * -y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}
\end{array}
Initial program 38.6%
fmm-def38.6%
hypot-define38.6%
distribute-rgt-neg-out38.6%
fma-define38.6%
hypot-define76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in y.re around inf 33.4%
+-commutative33.4%
associate-/l*34.0%
unpow234.0%
unpow234.0%
hypot-undefine68.1%
Simplified68.1%
add-cube-cbrt68.1%
pow368.9%
hypot-undefine34.8%
+-commutative34.8%
hypot-define68.9%
Applied egg-rr68.9%
Taylor expanded in y.im around 0 76.6%
Taylor expanded in y.re around 0 51.3%
neg-mul-151.3%
distribute-lft-neg-in51.3%
Simplified51.3%
Final simplification51.3%
(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 38.6%
fmm-def38.6%
hypot-define38.6%
distribute-rgt-neg-out38.6%
fma-define38.6%
hypot-define76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in y.im around 0 51.4%
unpow251.4%
unpow251.4%
hypot-undefine58.3%
Simplified58.3%
Taylor expanded in y.re around 0 20.6%
herbie shell --seed 2024165
(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)))))