
(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 20 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
(if (or (<= y.re -1.85e+24) (not (<= y.re 0.0075)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(fabs (cos (fma y.im (log (hypot x.im x.re)) (* y.re (atan2 x.im x.re))))))
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(cos (pow (* (cbrt (log (hypot x.re x.im))) (cbrt y.im)) 3.0)))))
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.85e+24) || !(y_46_re <= 0.0075)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * fabs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), (y_46_re * atan2(x_46_im, x_46_re)))));
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * cos(pow((cbrt(log(hypot(x_46_re, x_46_im))) * cbrt(y_46_im)), 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.85e+24) || !(y_46_re <= 0.0075)) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * abs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), Float64(y_46_re * atan(x_46_im, x_46_re)))))); else tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * cos((Float64(cbrt(log(hypot(x_46_re, x_46_im))) * cbrt(y_46_im)) ^ 3.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.85e+24], N[Not[LessEqual[y$46$re, 0.0075]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Cos[N[Power[N[(N[Power[N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[y$46$im, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.85 \cdot 10^{+24} \lor \neg \left(y.re \leq 0.0075\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left|\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \cos \left({\left(\sqrt[3]{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)} \cdot \sqrt[3]{y.im}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.re < -1.85e24 or 0.0074999999999999997 < y.re Initial program 43.8%
fma-define43.8%
hypot-define76.9%
*-commutative76.9%
add-sqr-sqrt43.8%
sqrt-unprod89.3%
pow289.3%
Applied egg-rr89.3%
unpow289.3%
rem-sqrt-square89.3%
fma-define89.3%
hypot-undefine47.1%
unpow247.1%
unpow247.1%
+-commutative47.1%
+-commutative47.1%
fma-define47.1%
Simplified89.3%
if -1.85e24 < y.re < 0.0074999999999999997Initial program 44.4%
fmm-def44.4%
hypot-define44.4%
distribute-rgt-neg-out44.4%
fma-define44.4%
hypot-define84.1%
*-commutative84.1%
Simplified84.1%
add-cube-cbrt85.4%
pow386.2%
hypot-define43.6%
*-commutative43.6%
fma-define43.6%
+-commutative43.6%
*-commutative43.6%
fma-define43.6%
*-commutative43.6%
hypot-define86.2%
Applied egg-rr86.2%
Taylor expanded in y.re around 0 83.4%
neg-mul-183.4%
distribute-rgt-neg-in83.4%
Simplified83.4%
Taylor expanded in y.re around 0 42.3%
unpow242.3%
unpow242.3%
hypot-undefine83.4%
Simplified83.4%
hypot-undefine42.3%
+-commutative42.3%
hypot-define83.4%
*-commutative83.4%
hypot-define42.3%
cbrt-prod43.9%
+-commutative43.9%
hypot-undefine86.9%
hypot-undefine43.9%
+-commutative43.9%
hypot-define86.9%
Applied egg-rr86.9%
Final simplification88.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= y.re 0.058)
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (pow (cbrt (fma y.re (atan2 x.im x.re) (* t_0 y.im))) 3.0)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(fabs
(cos (fma y.im (log (hypot x.im x.re)) (* y.re (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 0.058) {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(pow(cbrt(fma(y_46_re, atan2(x_46_im, x_46_re), (t_0 * y_46_im))), 3.0));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * fabs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), (y_46_re * atan2(x_46_im, x_46_re)))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 0.058) tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos((cbrt(fma(y_46_re, atan(x_46_im, x_46_re), Float64(t_0 * y_46_im))) ^ 3.0))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * abs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), Float64(y_46_re * atan(x_46_im, x_46_re)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 0.058], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(t$95$0 * y$46$im), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 0.058:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_0 \cdot y.im\right)}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left|\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right|\\
\end{array}
\end{array}
if y.re < 0.0580000000000000029Initial program 40.8%
fmm-def40.8%
hypot-define40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define85.0%
*-commutative85.0%
Simplified85.0%
add-cube-cbrt86.9%
pow387.9%
hypot-define40.8%
*-commutative40.8%
fma-define40.8%
+-commutative40.8%
*-commutative40.8%
fma-define40.8%
*-commutative40.8%
hypot-define87.9%
Applied egg-rr87.9%
if 0.0580000000000000029 < y.re Initial program 55.0%
fma-define55.0%
hypot-define66.7%
*-commutative66.7%
add-sqr-sqrt41.7%
sqrt-unprod86.7%
pow286.7%
Applied egg-rr86.7%
unpow286.7%
rem-sqrt-square86.7%
fma-define86.7%
hypot-undefine58.3%
unpow258.3%
unpow258.3%
+-commutative58.3%
+-commutative58.3%
fma-define58.3%
Simplified86.7%
Final simplification87.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 -9.5e+19)
(*
(exp
(-
(* y.re (log1p (+ (hypot x.re x.im) -1.0)))
(* (atan2 x.im x.re) y.im)))
t_0)
(if (<= y.re 8.1e-8)
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(cos (pow (* (cbrt (log (hypot x.re x.im))) (cbrt y.im)) 3.0)))
(pow
(pow (* t_0 (pow (hypot x.im x.re) 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 t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -9.5e+19) {
tmp = exp(((y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0))) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else if (y_46_re <= 8.1e-8) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * cos(pow((cbrt(log(hypot(x_46_re, x_46_im))) * cbrt(y_46_im)), 3.0));
} else {
tmp = pow(pow((t_0 * pow(hypot(x_46_im, x_46_re), 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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -9.5e+19) {
tmp = Math.exp(((y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0))) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else if (y_46_re <= 8.1e-8) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.cos(Math.pow((Math.cbrt(Math.log(Math.hypot(x_46_re, x_46_im))) * Math.cbrt(y_46_im)), 3.0));
} else {
tmp = Math.pow(Math.pow((t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333);
}
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 <= -9.5e+19) tmp = Float64(exp(Float64(Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0); elseif (y_46_re <= 8.1e-8) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * cos((Float64(cbrt(log(hypot(x_46_re, x_46_im))) * cbrt(y_46_im)) ^ 3.0))); else tmp = (Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; 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, -9.5e+19], N[(N[Exp[N[(N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 8.1e-8], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Cos[N[Power[N[(N[Power[N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[y$46$im, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -9.5 \cdot 10^{+19}:\\
\;\;\;\;e^{y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 8.1 \cdot 10^{-8}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \cos \left({\left(\sqrt[3]{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)} \cdot \sqrt[3]{y.im}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.re < -9.5e19Initial program 32.8%
Taylor expanded in y.im around 0 88.6%
log1p-expm1-u86.9%
hypot-define88.6%
expm1-undefine88.6%
add-exp-log88.6%
Applied egg-rr88.6%
if -9.5e19 < y.re < 8.0999999999999997e-8Initial program 44.6%
fmm-def44.6%
hypot-define44.6%
distribute-rgt-neg-out44.6%
fma-define44.6%
hypot-define83.8%
*-commutative83.8%
Simplified83.8%
add-cube-cbrt85.9%
pow386.6%
hypot-define44.6%
*-commutative44.6%
fma-define44.6%
+-commutative44.6%
*-commutative44.6%
fma-define44.6%
*-commutative44.6%
hypot-define86.6%
Applied egg-rr86.6%
Taylor expanded in y.re around 0 84.8%
neg-mul-184.8%
distribute-rgt-neg-in84.8%
Simplified84.8%
Taylor expanded in y.re around 0 43.2%
unpow243.2%
unpow243.2%
hypot-undefine84.8%
Simplified84.8%
hypot-undefine43.2%
+-commutative43.2%
hypot-define84.8%
*-commutative84.8%
hypot-define43.2%
cbrt-prod44.9%
+-commutative44.9%
hypot-undefine88.5%
hypot-undefine44.9%
+-commutative44.9%
hypot-define88.5%
Applied egg-rr88.5%
if 8.0999999999999997e-8 < y.re Initial program 53.9%
fmm-def53.9%
hypot-define53.9%
distribute-rgt-neg-out53.9%
fma-define53.9%
hypot-define71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in y.im around 0 68.4%
unpow268.4%
unpow268.4%
hypot-undefine69.9%
Simplified69.9%
add-cbrt-cube69.9%
pow1/384.2%
pow384.2%
Applied egg-rr84.2%
Final simplification87.4%
(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 -4.5e-29)
(*
(exp
(-
(* y.re (log1p (+ (hypot x.re x.im) -1.0)))
(* (atan2 x.im x.re) y.im)))
t_0)
(if (<= y.re 1.14e-7)
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(cos (pow (cbrt (* y.im (log (hypot x.im x.re)))) 3.0)))
(pow
(pow (* t_0 (pow (hypot x.im x.re) 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 t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -4.5e-29) {
tmp = exp(((y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0))) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else if (y_46_re <= 1.14e-7) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * cos(pow(cbrt((y_46_im * log(hypot(x_46_im, x_46_re)))), 3.0));
} else {
tmp = pow(pow((t_0 * pow(hypot(x_46_im, x_46_re), 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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -4.5e-29) {
tmp = Math.exp(((y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0))) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else if (y_46_re <= 1.14e-7) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.cos(Math.pow(Math.cbrt((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))), 3.0));
} else {
tmp = Math.pow(Math.pow((t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333);
}
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 <= -4.5e-29) tmp = Float64(exp(Float64(Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0); elseif (y_46_re <= 1.14e-7) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * cos((cbrt(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) ^ 3.0))); else tmp = (Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; 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, -4.5e-29], N[(N[Exp[N[(N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.14e-7], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Cos[N[Power[N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $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 -4.5 \cdot 10^{-29}:\\
\;\;\;\;e^{y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.14 \cdot 10^{-7}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \cos \left({\left(\sqrt[3]{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.re < -4.4999999999999998e-29Initial program 32.2%
Taylor expanded in y.im around 0 83.1%
log1p-expm1-u81.7%
hypot-define85.8%
expm1-undefine85.8%
add-exp-log85.8%
Applied egg-rr85.8%
if -4.4999999999999998e-29 < y.re < 1.14000000000000002e-7Initial program 45.9%
fmm-def45.9%
hypot-define45.9%
distribute-rgt-neg-out45.9%
fma-define45.9%
hypot-define85.8%
*-commutative85.8%
Simplified85.8%
add-cube-cbrt86.5%
pow387.3%
hypot-define45.9%
*-commutative45.9%
fma-define45.9%
+-commutative45.9%
*-commutative45.9%
fma-define45.9%
*-commutative45.9%
hypot-define87.3%
Applied egg-rr87.3%
Taylor expanded in y.re around 0 87.2%
neg-mul-187.2%
distribute-rgt-neg-in87.2%
Simplified87.2%
Taylor expanded in y.re around 0 45.9%
unpow245.9%
unpow245.9%
hypot-undefine87.2%
Simplified87.2%
if 1.14000000000000002e-7 < y.re Initial program 53.9%
fmm-def53.9%
hypot-define53.9%
distribute-rgt-neg-out53.9%
fma-define53.9%
hypot-define71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in y.im around 0 68.4%
unpow268.4%
unpow268.4%
hypot-undefine69.9%
Simplified69.9%
add-cbrt-cube69.9%
pow1/384.2%
pow384.2%
Applied egg-rr84.2%
Final simplification86.1%
(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 -4.8e-12)
(*
(exp
(-
(* y.re (log1p (+ (hypot x.re x.im) -1.0)))
(* (atan2 x.im x.re) y.im)))
t_0)
(if (<= y.re 2.25e-7)
(* (exp (* (atan2 x.im x.re) (- y.im))) t_0)
(pow
(pow (* t_0 (pow (hypot x.im x.re) 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 t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -4.8e-12) {
tmp = exp(((y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0))) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else if (y_46_re <= 2.25e-7) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_0;
} else {
tmp = pow(pow((t_0 * pow(hypot(x_46_im, x_46_re), 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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -4.8e-12) {
tmp = Math.exp(((y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0))) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else if (y_46_re <= 2.25e-7) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * t_0;
} else {
tmp = Math.pow(Math.pow((t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333);
}
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 <= -4.8e-12: tmp = math.exp(((y_46_re * math.log1p((math.hypot(x_46_re, x_46_im) + -1.0))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0 elif y_46_re <= 2.25e-7: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * t_0 else: tmp = math.pow(math.pow((t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333) 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 <= -4.8e-12) tmp = Float64(exp(Float64(Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0); elseif (y_46_re <= 2.25e-7) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * t_0); else tmp = (Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; 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, -4.8e-12], N[(N[Exp[N[(N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 2.25e-7], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[Power[N[Power[N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $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 -4.8 \cdot 10^{-12}:\\
\;\;\;\;e^{y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 2.25 \cdot 10^{-7}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.re < -4.79999999999999974e-12Initial program 32.7%
Taylor expanded in y.im around 0 82.8%
log1p-expm1-u81.4%
hypot-define85.6%
expm1-undefine85.6%
add-exp-log85.6%
Applied egg-rr85.6%
if -4.79999999999999974e-12 < y.re < 2.2499999999999999e-7Initial program 45.5%
Taylor expanded in y.im around 0 55.6%
Taylor expanded in x.re around -inf 48.8%
mul-1-neg48.8%
Simplified48.8%
Taylor expanded in y.re around 0 86.9%
neg-mul-186.9%
distribute-rgt-neg-in86.9%
Simplified86.9%
if 2.2499999999999999e-7 < y.re Initial program 53.9%
fmm-def53.9%
hypot-define53.9%
distribute-rgt-neg-out53.9%
fma-define53.9%
hypot-define71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in y.im around 0 68.4%
unpow268.4%
unpow268.4%
hypot-undefine69.9%
Simplified69.9%
add-cbrt-cube69.9%
pow1/384.2%
pow384.2%
Applied egg-rr84.2%
Final simplification85.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (or (<= y.re -7.2e+32) (not (<= y.re 1.82e-7)))
(pow (pow (* t_0 (pow (hypot x.im x.re) y.re)) 3.0) 0.3333333333333333)
(* (exp (* (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 <= -7.2e+32) || !(y_46_re <= 1.82e-7)) {
tmp = pow(pow((t_0 * pow(hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * 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)));
double tmp;
if ((y_46_re <= -7.2e+32) || !(y_46_re <= 1.82e-7)) {
tmp = Math.pow(Math.pow((t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333);
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * 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))) tmp = 0 if (y_46_re <= -7.2e+32) or not (y_46_re <= 1.82e-7): tmp = math.pow(math.pow((t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333) else: tmp = math.exp((math.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 <= -7.2e+32) || !(y_46_re <= 1.82e-7)) tmp = (Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; else tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * 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))); tmp = 0.0; if ((y_46_re <= -7.2e+32) || ~((y_46_re <= 1.82e-7))) tmp = ((t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * 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[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -7.2e+32], N[Not[LessEqual[y$46$re, 1.82e-7]], $MachinePrecision]], N[Power[N[Power[N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $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 -7.2 \cdot 10^{+32} \lor \neg \left(y.re \leq 1.82 \cdot 10^{-7}\right):\\
\;\;\;\;{\left({\left(t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)}^{3}\right)}^{0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -7.1999999999999994e32 or 1.81999999999999989e-7 < y.re Initial program 42.5%
fmm-def42.5%
hypot-define42.5%
distribute-rgt-neg-out42.5%
fma-define42.5%
hypot-define79.1%
*-commutative79.1%
Simplified79.1%
Taylor expanded in y.im around 0 76.8%
unpow276.8%
unpow276.8%
hypot-undefine77.6%
Simplified77.6%
add-cbrt-cube77.6%
pow1/386.7%
pow386.7%
Applied egg-rr86.7%
if -7.1999999999999994e32 < y.re < 1.81999999999999989e-7Initial program 45.5%
Taylor expanded in y.im around 0 56.2%
Taylor expanded in x.re around -inf 47.7%
mul-1-neg47.7%
Simplified47.7%
Taylor expanded in y.re around 0 84.2%
neg-mul-184.2%
distribute-rgt-neg-in84.2%
Simplified84.2%
Final simplification85.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 -7.2e+32)
(* t_0 (cos (* y.re (log1p (expm1 (atan2 x.im x.re))))))
(if (<= y.re 3.25e-12)
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(cos (* y.re (atan2 x.im x.re))))
(* t_0 (cos (* y.re (cbrt (pow (atan2 x.im x.re) 3.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_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -7.2e+32) {
tmp = t_0 * cos((y_46_re * log1p(expm1(atan2(x_46_im, x_46_re)))));
} else if (y_46_re <= 3.25e-12) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * cos((y_46_re * cbrt(pow(atan2(x_46_im, x_46_re), 3.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_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -7.2e+32) {
tmp = t_0 * Math.cos((y_46_re * Math.log1p(Math.expm1(Math.atan2(x_46_im, x_46_re)))));
} else if (y_46_re <= 3.25e-12) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * Math.cos((y_46_re * Math.cbrt(Math.pow(Math.atan2(x_46_im, x_46_re), 3.0))));
}
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 <= -7.2e+32) tmp = Float64(t_0 * cos(Float64(y_46_re * log1p(expm1(atan(x_46_im, x_46_re)))))); elseif (y_46_re <= 3.25e-12) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * cos(Float64(y_46_re * cbrt((atan(x_46_im, x_46_re) ^ 3.0))))); end return 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, -7.2e+32], N[(t$95$0 * N[Cos[N[(y$46$re * N[Log[1 + N[(Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.25e-12], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(y$46$re * N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $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 -7.2 \cdot 10^{+32}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 3.25 \cdot 10^{-12}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \sqrt[3]{{\tan^{-1}_* \frac{x.im}{x.re}}^{3}}\right)\\
\end{array}
\end{array}
if y.re < -7.1999999999999994e32Initial program 29.8%
fmm-def29.8%
hypot-define29.8%
distribute-rgt-neg-out29.8%
fma-define29.8%
hypot-define87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in y.im around 0 86.0%
unpow286.0%
unpow286.0%
hypot-undefine86.0%
Simplified86.0%
log1p-expm1-u87.8%
Applied egg-rr87.8%
if -7.1999999999999994e32 < y.re < 3.2500000000000001e-12Initial program 45.5%
Taylor expanded in y.im around 0 56.2%
Taylor expanded in x.re around -inf 47.7%
mul-1-neg47.7%
Simplified47.7%
Taylor expanded in y.re around 0 84.2%
neg-mul-184.2%
distribute-rgt-neg-in84.2%
Simplified84.2%
if 3.2500000000000001e-12 < y.re Initial program 53.9%
fmm-def53.9%
hypot-define53.9%
distribute-rgt-neg-out53.9%
fma-define53.9%
hypot-define71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in y.im around 0 68.4%
unpow268.4%
unpow268.4%
hypot-undefine69.9%
Simplified69.9%
add-cbrt-cube71.5%
pow371.5%
Applied egg-rr71.5%
Final simplification81.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -7.2e+32)
(* t_0 (cos (* y.re (log1p (expm1 (atan2 x.im x.re))))))
(if (<= y.re 1.38e-8)
(* (exp (* (atan2 x.im x.re) (- y.im))) t_1)
(* t_0 (expm1 (log1p t_1)))))))
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 t_1 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -7.2e+32) {
tmp = t_0 * cos((y_46_re * log1p(expm1(atan2(x_46_im, x_46_re)))));
} else if (y_46_re <= 1.38e-8) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_1;
} else {
tmp = t_0 * expm1(log1p(t_1));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_1 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -7.2e+32) {
tmp = t_0 * Math.cos((y_46_re * Math.log1p(Math.expm1(Math.atan2(x_46_im, x_46_re)))));
} else if (y_46_re <= 1.38e-8) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * t_1;
} else {
tmp = t_0 * Math.expm1(Math.log1p(t_1));
}
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) t_1 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -7.2e+32: tmp = t_0 * math.cos((y_46_re * math.log1p(math.expm1(math.atan2(x_46_im, x_46_re))))) elif y_46_re <= 1.38e-8: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * t_1 else: tmp = t_0 * math.expm1(math.log1p(t_1)) 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 t_1 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -7.2e+32) tmp = Float64(t_0 * cos(Float64(y_46_re * log1p(expm1(atan(x_46_im, x_46_re)))))); elseif (y_46_re <= 1.38e-8) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * t_1); else tmp = Float64(t_0 * expm1(log1p(t_1))); end return 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]}, Block[{t$95$1 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7.2e+32], N[(t$95$0 * N[Cos[N[(y$46$re * N[Log[1 + N[(Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.38e-8], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$0 * N[(Exp[N[Log[1 + t$95$1], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -7.2 \cdot 10^{+32}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 1.38 \cdot 10^{-8}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(t\_1\right)\right)\\
\end{array}
\end{array}
if y.re < -7.1999999999999994e32Initial program 29.8%
fmm-def29.8%
hypot-define29.8%
distribute-rgt-neg-out29.8%
fma-define29.8%
hypot-define87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in y.im around 0 86.0%
unpow286.0%
unpow286.0%
hypot-undefine86.0%
Simplified86.0%
log1p-expm1-u87.8%
Applied egg-rr87.8%
if -7.1999999999999994e32 < y.re < 1.37999999999999995e-8Initial program 45.5%
Taylor expanded in y.im around 0 56.2%
Taylor expanded in x.re around -inf 47.7%
mul-1-neg47.7%
Simplified47.7%
Taylor expanded in y.re around 0 84.2%
neg-mul-184.2%
distribute-rgt-neg-in84.2%
Simplified84.2%
if 1.37999999999999995e-8 < y.re Initial program 53.9%
fmm-def53.9%
hypot-define53.9%
distribute-rgt-neg-out53.9%
fma-define53.9%
hypot-define71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in y.im around 0 68.4%
unpow268.4%
unpow268.4%
hypot-undefine69.9%
Simplified69.9%
expm1-log1p-u70.0%
expm1-undefine69.9%
Applied egg-rr69.9%
expm1-define70.0%
Simplified70.0%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -7.2e+32)
(* t_0 (cos (* y.re (log1p (expm1 (atan2 x.im x.re))))))
(if (<= y.re 5.1e-8)
(* (exp (* (atan2 x.im x.re) (- y.im))) t_1)
(* 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_im, x_46_re), y_46_re);
double t_1 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -7.2e+32) {
tmp = t_0 * cos((y_46_re * log1p(expm1(atan2(x_46_im, x_46_re)))));
} else if (y_46_re <= 5.1e-8) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_1;
} 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_im, x_46_re), y_46_re);
double t_1 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -7.2e+32) {
tmp = t_0 * Math.cos((y_46_re * Math.log1p(Math.expm1(Math.atan2(x_46_im, x_46_re)))));
} else if (y_46_re <= 5.1e-8) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * t_1;
} 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_im, x_46_re), y_46_re) t_1 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -7.2e+32: tmp = t_0 * math.cos((y_46_re * math.log1p(math.expm1(math.atan2(x_46_im, x_46_re))))) elif y_46_re <= 5.1e-8: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * t_1 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_im, x_46_re) ^ y_46_re t_1 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -7.2e+32) tmp = Float64(t_0 * cos(Float64(y_46_re * log1p(expm1(atan(x_46_im, x_46_re)))))); elseif (y_46_re <= 5.1e-8) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * t_1); else tmp = Float64(t_1 * t_0); end return 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]}, Block[{t$95$1 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7.2e+32], N[(t$95$0 * N[Cos[N[(y$46$re * N[Log[1 + N[(Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.1e-8], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -7.2 \cdot 10^{+32}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 5.1 \cdot 10^{-8}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -7.1999999999999994e32Initial program 29.8%
fmm-def29.8%
hypot-define29.8%
distribute-rgt-neg-out29.8%
fma-define29.8%
hypot-define87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in y.im around 0 86.0%
unpow286.0%
unpow286.0%
hypot-undefine86.0%
Simplified86.0%
log1p-expm1-u87.8%
Applied egg-rr87.8%
if -7.1999999999999994e32 < y.re < 5.10000000000000001e-8Initial program 45.5%
Taylor expanded in y.im around 0 56.2%
Taylor expanded in x.re around -inf 47.7%
mul-1-neg47.7%
Simplified47.7%
Taylor expanded in y.re around 0 84.2%
neg-mul-184.2%
distribute-rgt-neg-in84.2%
Simplified84.2%
if 5.10000000000000001e-8 < y.re Initial program 53.9%
fmm-def53.9%
hypot-define53.9%
distribute-rgt-neg-out53.9%
fma-define53.9%
hypot-define71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in y.im around 0 68.4%
unpow268.4%
unpow268.4%
hypot-undefine69.9%
Simplified69.9%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (or (<= y.re -2.4e+34) (not (<= y.re 1.34e-8)))
(* t_0 (pow (hypot x.im x.re) y.re))
(* (exp (* (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+34) || !(y_46_re <= 1.34e-8)) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * 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)));
double tmp;
if ((y_46_re <= -2.4e+34) || !(y_46_re <= 1.34e-8)) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * 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))) tmp = 0 if (y_46_re <= -2.4e+34) or not (y_46_re <= 1.34e-8): tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.exp((math.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+34) || !(y_46_re <= 1.34e-8)) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * 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))); tmp = 0.0; if ((y_46_re <= -2.4e+34) || ~((y_46_re <= 1.34e-8))) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * 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[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -2.4e+34], N[Not[LessEqual[y$46$re, 1.34e-8]], $MachinePrecision]], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $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^{+34} \lor \neg \left(y.re \leq 1.34 \cdot 10^{-8}\right):\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -2.39999999999999987e34 or 1.33999999999999992e-8 < y.re Initial program 42.5%
fmm-def42.5%
hypot-define42.5%
distribute-rgt-neg-out42.5%
fma-define42.5%
hypot-define79.1%
*-commutative79.1%
Simplified79.1%
Taylor expanded in y.im around 0 76.8%
unpow276.8%
unpow276.8%
hypot-undefine77.6%
Simplified77.6%
if -2.39999999999999987e34 < y.re < 1.33999999999999992e-8Initial program 45.5%
Taylor expanded in y.im around 0 56.2%
Taylor expanded in x.re around -inf 47.7%
mul-1-neg47.7%
Simplified47.7%
Taylor expanded in y.re around 0 84.2%
neg-mul-184.2%
distribute-rgt-neg-in84.2%
Simplified84.2%
Final simplification81.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 5.5e+142) (* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)) (* (exp (* (atan2 x.im x.re) (- y.im))) (cos (* y.im (log x.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 5.5e+142) {
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 = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * cos((y_46_im * log(x_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 5.5e+142) {
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.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.cos((y_46_im * Math.log(x_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= 5.5e+142: 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.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.cos((y_46_im * math.log(x_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= 5.5e+142) 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(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * cos(Float64(y_46_im * log(x_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_im <= 5.5e+142) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * cos((y_46_im * log(x_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, 5.5e+142], 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 5.5 \cdot 10^{+142}:\\
\;\;\;\;\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}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \cos \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if y.im < 5.50000000000000035e142Initial program 45.5%
fmm-def45.5%
hypot-define45.5%
distribute-rgt-neg-out45.5%
fma-define45.5%
hypot-define82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in y.im around 0 57.7%
unpow257.7%
unpow257.7%
hypot-undefine67.1%
Simplified67.1%
if 5.50000000000000035e142 < y.im Initial program 34.4%
fmm-def34.4%
hypot-define34.4%
distribute-rgt-neg-out34.4%
fma-define34.4%
hypot-define75.0%
*-commutative75.0%
Simplified75.0%
add-cube-cbrt81.3%
pow384.4%
hypot-define40.6%
*-commutative40.6%
fma-define40.6%
+-commutative40.6%
*-commutative40.6%
fma-define40.6%
*-commutative40.6%
hypot-define84.4%
Applied egg-rr84.4%
Taylor expanded in y.re around 0 72.1%
neg-mul-172.1%
distribute-rgt-neg-in72.1%
Simplified72.1%
Taylor expanded in y.re around 0 28.3%
unpow228.3%
unpow228.3%
hypot-undefine68.9%
Simplified68.9%
Taylor expanded in x.re around 0 56.3%
Final simplification65.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (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) {
return cos((y_46_re * atan2(x_46_im, x_46_re))) * 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.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);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 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)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (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 = cos((y_46_re * atan2(x_46_im, x_46_re))) * (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[(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}
\\
\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}
Initial program 44.1%
fmm-def44.1%
hypot-define44.1%
distribute-rgt-neg-out44.1%
fma-define44.1%
hypot-define81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y.im around 0 55.7%
unpow255.7%
unpow255.7%
hypot-undefine62.4%
Simplified62.4%
(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 -5e+243)
(* t_0 (pow x.im y.re))
(if (or (<= y.re -4.3e+29) (not (<= y.re 11000000000.0)))
(* t_0 (pow x.re y.re))
(+ 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 t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -5e+243) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else if ((y_46_re <= -4.3e+29) || !(y_46_re <= 11000000000.0)) {
tmp = t_0 * pow(x_46_re, y_46_re);
} 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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -5e+243) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else if ((y_46_re <= -4.3e+29) || !(y_46_re <= 11000000000.0)) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} 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): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -5e+243: tmp = t_0 * math.pow(x_46_im, y_46_re) elif (y_46_re <= -4.3e+29) or not (y_46_re <= 11000000000.0): tmp = t_0 * math.pow(x_46_re, y_46_re) 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) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -5e+243) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); elseif ((y_46_re <= -4.3e+29) || !(y_46_re <= 11000000000.0)) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); 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) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -5e+243) tmp = t_0 * (x_46_im ^ y_46_re); elseif ((y_46_re <= -4.3e+29) || ~((y_46_re <= 11000000000.0))) tmp = t_0 * (x_46_re ^ y_46_re); 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_] := 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, -5e+243], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$re, -4.3e+29], N[Not[LessEqual[y$46$re, 11000000000.0]], $MachinePrecision]], N[(t$95$0 * N[Power[x$46$re, y$46$re], $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}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{+243}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq -4.3 \cdot 10^{+29} \lor \neg \left(y.re \leq 11000000000\right):\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < -5.00000000000000037e243Initial program 16.7%
fmm-def16.7%
hypot-define16.7%
distribute-rgt-neg-out16.7%
fma-define16.7%
hypot-define94.4%
*-commutative94.4%
Simplified94.4%
Taylor expanded in y.im around 0 94.4%
unpow294.4%
unpow294.4%
hypot-undefine94.4%
Simplified94.4%
Taylor expanded in x.re around 0 83.5%
if -5.00000000000000037e243 < y.re < -4.3000000000000003e29 or 1.1e10 < y.re Initial program 48.5%
fmm-def48.5%
hypot-define48.5%
distribute-rgt-neg-out48.5%
fma-define48.5%
hypot-define76.8%
*-commutative76.8%
Simplified76.8%
Taylor expanded in y.im around 0 73.8%
unpow273.8%
unpow273.8%
hypot-undefine73.8%
Simplified73.8%
Taylor expanded in x.im around 0 64.0%
if -4.3000000000000003e29 < y.re < 1.1e10Initial program 44.5%
fmm-def44.5%
hypot-define44.5%
distribute-rgt-neg-out44.5%
fma-define44.5%
hypot-define83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in y.im around 0 37.7%
unpow237.7%
unpow237.7%
hypot-undefine50.1%
Simplified50.1%
Taylor expanded in y.re around 0 28.4%
unpow228.4%
unpow228.4%
hypot-undefine44.5%
Simplified44.5%
+-commutative44.5%
*-commutative44.5%
hypot-undefine28.4%
+-commutative28.4%
add-cube-cbrt28.4%
fma-define28.4%
Applied egg-rr47.2%
fma-undefine47.2%
unpow247.2%
unpow347.2%
rem-cube-cbrt47.2%
Simplified47.2%
Final simplification56.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (cos (* y.re (atan2 x.im x.re))))) (if (<= x.re -2e-310) (* t_0 (pow (- x.re) y.re)) (* t_0 (pow x.re y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -2e-310) {
tmp = t_0 * pow(-x_46_re, y_46_re);
} else {
tmp = t_0 * pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = cos((y_46re * atan2(x_46im, x_46re)))
if (x_46re <= (-2d-310)) then
tmp = t_0 * (-x_46re ** y_46re)
else
tmp = t_0 * (x_46re ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -2e-310) {
tmp = t_0 * Math.pow(-x_46_re, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= -2e-310: tmp = t_0 * math.pow(-x_46_re, y_46_re) else: tmp = t_0 * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -2e-310) tmp = Float64(t_0 * (Float64(-x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * (x_46_re ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= -2e-310) tmp = t_0 * (-x_46_re ^ y_46_re); else tmp = t_0 * (x_46_re ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -2e-310], N[(t$95$0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -2 \cdot 10^{-310}:\\
\;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -1.999999999999994e-310Initial program 45.4%
Taylor expanded in y.im around 0 69.6%
Taylor expanded in x.re around -inf 78.5%
mul-1-neg78.5%
Simplified78.5%
Taylor expanded in y.im around 0 57.6%
if -1.999999999999994e-310 < x.re Initial program 42.5%
fmm-def42.5%
hypot-define42.5%
distribute-rgt-neg-out42.5%
fma-define42.5%
hypot-define78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in y.im around 0 51.7%
unpow251.7%
unpow251.7%
hypot-undefine60.9%
Simplified60.9%
Taylor expanded in x.im around 0 52.2%
Final simplification55.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -4.3e+29) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (+ 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_re <= -4.3e+29) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + log(pow(hypot(x_46_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_re <= -4.3e+29) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + Math.log(Math.pow(Math.hypot(x_46_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_re <= -4.3e+29: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) else: tmp = 1.0 + math.log(math.pow(math.hypot(x_46_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_re <= -4.3e+29) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = Float64(1.0 + log((hypot(x_46_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_re <= -4.3e+29) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -4.3e+29], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -4.3 \cdot 10^{+29}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < -4.3000000000000003e29Initial program 32.2%
fmm-def32.2%
hypot-define32.2%
distribute-rgt-neg-out32.2%
fma-define32.2%
hypot-define88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in y.im around 0 84.8%
unpow284.8%
unpow284.8%
hypot-undefine84.8%
Simplified84.8%
Taylor expanded in x.re around 0 61.5%
if -4.3000000000000003e29 < y.re Initial program 47.7%
fmm-def47.7%
hypot-define47.7%
distribute-rgt-neg-out47.7%
fma-define47.7%
hypot-define79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in y.im around 0 46.9%
unpow246.9%
unpow246.9%
hypot-undefine55.7%
Simplified55.7%
Taylor expanded in y.re around 0 28.3%
unpow228.3%
unpow228.3%
hypot-undefine32.5%
Simplified32.5%
+-commutative32.5%
*-commutative32.5%
hypot-undefine28.3%
+-commutative28.3%
add-cube-cbrt28.3%
fma-define28.3%
Applied egg-rr48.2%
fma-undefine48.2%
unpow248.2%
unpow348.2%
rem-cube-cbrt48.2%
Simplified48.2%
Final simplification51.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 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) {
return 1.0 + log(pow(hypot(x_46_re, x_46_im), y_46_re));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + math.log(math.pow(math.hypot(x_46_re, x_46_im), y_46_re))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)
\end{array}
Initial program 44.1%
fmm-def44.1%
hypot-define44.1%
distribute-rgt-neg-out44.1%
fma-define44.1%
hypot-define81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y.im around 0 55.7%
unpow255.7%
unpow255.7%
hypot-undefine62.4%
Simplified62.4%
Taylor expanded in y.re around 0 23.1%
unpow223.1%
unpow223.1%
hypot-undefine25.7%
Simplified25.7%
+-commutative25.7%
*-commutative25.7%
hypot-undefine23.1%
+-commutative23.1%
add-cube-cbrt23.1%
fma-define23.1%
Applied egg-rr40.9%
fma-undefine40.9%
unpow240.9%
unpow340.9%
rem-cube-cbrt40.9%
Simplified40.9%
Final simplification40.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -8.5e+24)
(+ 1.0 (* y.re (log1p (+ (hypot x.re x.im) -1.0))))
(if (<= y.re 3e+188)
(+ 1.0 (* y.re (log (hypot x.im x.re))))
(+ 1.0 (* y.re (log (+ x.re (* 0.5 (/ (pow x.im 2.0) 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 <= -8.5e+24) {
tmp = 1.0 + (y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0)));
} else if (y_46_re <= 3e+188) {
tmp = 1.0 + (y_46_re * log(hypot(x_46_im, x_46_re)));
} else {
tmp = 1.0 + (y_46_re * log((x_46_re + (0.5 * (pow(x_46_im, 2.0) / 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 <= -8.5e+24) {
tmp = 1.0 + (y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0)));
} else if (y_46_re <= 3e+188) {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re)));
} else {
tmp = 1.0 + (y_46_re * Math.log((x_46_re + (0.5 * (Math.pow(x_46_im, 2.0) / 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 <= -8.5e+24: tmp = 1.0 + (y_46_re * math.log1p((math.hypot(x_46_re, x_46_im) + -1.0))) elif y_46_re <= 3e+188: tmp = 1.0 + (y_46_re * math.log(math.hypot(x_46_im, x_46_re))) else: tmp = 1.0 + (y_46_re * math.log((x_46_re + (0.5 * (math.pow(x_46_im, 2.0) / 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 <= -8.5e+24) tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0)))); elseif (y_46_re <= 3e+188) tmp = Float64(1.0 + Float64(y_46_re * log(hypot(x_46_im, x_46_re)))); else tmp = Float64(1.0 + Float64(y_46_re * log(Float64(x_46_re + Float64(0.5 * Float64((x_46_im ^ 2.0) / x_46_re)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -8.5e+24], N[(1.0 + N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3e+188], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[(x$46$re + N[(0.5 * N[(N[Power[x$46$im, 2.0], $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -8.5 \cdot 10^{+24}:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right)\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{+188}:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(x.re + 0.5 \cdot \frac{{x.im}^{2}}{x.re}\right)\\
\end{array}
\end{array}
if y.re < -8.49999999999999959e24Initial program 31.7%
fmm-def31.7%
hypot-define31.7%
distribute-rgt-neg-out31.7%
fma-define31.7%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.im around 0 85.1%
unpow285.1%
unpow285.1%
hypot-undefine85.1%
Simplified85.1%
Taylor expanded in y.re around 0 7.2%
unpow27.2%
unpow27.2%
hypot-undefine2.7%
Simplified2.7%
log1p-expm1-u15.2%
hypot-undefine15.0%
+-commutative15.0%
expm1-undefine15.0%
add-exp-log15.0%
hypot-define15.2%
Applied egg-rr15.2%
if -8.49999999999999959e24 < y.re < 3.0000000000000001e188Initial program 47.6%
fmm-def47.6%
hypot-define47.6%
distribute-rgt-neg-out47.6%
fma-define47.6%
hypot-define82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in y.im around 0 43.2%
unpow243.2%
unpow243.2%
hypot-undefine53.4%
Simplified53.4%
Taylor expanded in y.re around 0 26.6%
unpow226.6%
unpow226.6%
hypot-undefine37.0%
Simplified37.0%
if 3.0000000000000001e188 < y.re Initial program 50.0%
fmm-def50.0%
hypot-define50.0%
distribute-rgt-neg-out50.0%
fma-define50.0%
hypot-define61.5%
*-commutative61.5%
Simplified61.5%
Taylor expanded in y.im around 0 69.2%
unpow269.2%
unpow269.2%
hypot-undefine69.2%
Simplified69.2%
Taylor expanded in y.re around 0 36.6%
unpow236.6%
unpow236.6%
hypot-undefine4.8%
Simplified4.8%
Taylor expanded in x.im around 0 23.7%
Final simplification30.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -1.9e+24) (+ 1.0 (* y.re (log1p (+ (hypot x.re x.im) -1.0)))) (+ 1.0 (* y.re (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 tmp;
if (y_46_re <= -1.9e+24) {
tmp = 1.0 + (y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0)));
} else {
tmp = 1.0 + (y_46_re * log(hypot(x_46_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 <= -1.9e+24) {
tmp = 1.0 + (y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0)));
} else {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_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.9e+24: tmp = 1.0 + (y_46_re * math.log1p((math.hypot(x_46_re, x_46_im) + -1.0))) else: tmp = 1.0 + (y_46_re * math.log(math.hypot(x_46_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.9e+24) tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0)))); else tmp = Float64(1.0 + Float64(y_46_re * log(hypot(x_46_im, x_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.9e+24], N[(1.0 + N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.9 \cdot 10^{+24}:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\end{array}
\end{array}
if y.re < -1.90000000000000008e24Initial program 31.7%
fmm-def31.7%
hypot-define31.7%
distribute-rgt-neg-out31.7%
fma-define31.7%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.im around 0 85.1%
unpow285.1%
unpow285.1%
hypot-undefine85.1%
Simplified85.1%
Taylor expanded in y.re around 0 7.2%
unpow27.2%
unpow27.2%
hypot-undefine2.7%
Simplified2.7%
log1p-expm1-u15.2%
hypot-undefine15.0%
+-commutative15.0%
expm1-undefine15.0%
add-exp-log15.0%
hypot-define15.2%
Applied egg-rr15.2%
if -1.90000000000000008e24 < y.re Initial program 47.9%
fmm-def47.9%
hypot-define47.9%
distribute-rgt-neg-out47.9%
fma-define47.9%
hypot-define79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in y.im around 0 46.7%
unpow246.7%
unpow246.7%
hypot-undefine55.5%
Simplified55.5%
Taylor expanded in y.re around 0 27.9%
unpow227.9%
unpow227.9%
hypot-undefine32.7%
Simplified32.7%
Final simplification28.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (* y.re (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 1.0 + (y_46_re * 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 1.0 + (y_46_re * 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 1.0 + (y_46_re * 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(1.0 + Float64(y_46_re * 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 = 1.0 + (y_46_re * log(hypot(x_46_im, x_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)
\end{array}
Initial program 44.1%
fmm-def44.1%
hypot-define44.1%
distribute-rgt-neg-out44.1%
fma-define44.1%
hypot-define81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y.im around 0 55.7%
unpow255.7%
unpow255.7%
hypot-undefine62.4%
Simplified62.4%
Taylor expanded in y.re around 0 23.1%
unpow223.1%
unpow223.1%
hypot-undefine25.7%
Simplified25.7%
(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 44.1%
fmm-def44.1%
hypot-define44.1%
distribute-rgt-neg-out44.1%
fma-define44.1%
hypot-define81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y.im around 0 55.7%
unpow255.7%
unpow255.7%
hypot-undefine62.4%
Simplified62.4%
Taylor expanded in y.re around 0 25.2%
herbie shell --seed 2024185
(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)))))