
(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
(if (<= y.re -2.1e+50)
(* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(if (<= y.re 7.2)
(/
(cos (* y.im (log (hypot x.im x.re))))
(/ (exp (* y.im (atan2 x.im x.re))) (pow (hypot x.re x.im) y.re)))
(pow (+ (* x.re x.re) (* x.im x.im)) (/ y.re 2.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 <= -2.1e+50) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 7.2) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp((y_46_im * atan2(x_46_im, x_46_re))) / pow(hypot(x_46_re, x_46_im), y_46_re));
} else {
tmp = pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -2.1e+50) {
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 if (y_46_re <= 7.2) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / (Math.exp((y_46_im * Math.atan2(x_46_im, x_46_re))) / Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
} else {
tmp = Math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -2.1e+50: 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) elif y_46_re <= 7.2: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) / (math.exp((y_46_im * math.atan2(x_46_im, x_46_re))) / math.pow(math.hypot(x_46_re, x_46_im), y_46_re)) else: tmp = math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -2.1e+50) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 7.2) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / Float64(exp(Float64(y_46_im * atan(x_46_im, x_46_re))) / (hypot(x_46_re, x_46_im) ^ y_46_re))); else tmp = Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) ^ Float64(y_46_re / 2.0); 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 <= -2.1e+50) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 7.2) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp((y_46_im * atan2(x_46_im, x_46_re))) / (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = ((x_46_re * x_46_re) + (x_46_im * x_46_im)) ^ (y_46_re / 2.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -2.1e+50], 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], If[LessEqual[y$46$re, 7.2], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[Exp[N[(y$46$im * 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]), $MachinePrecision], N[Power[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{+50}:\\
\;\;\;\;\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{elif}\;y.re \leq 7.2:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\
\end{array}
\end{array}
if y.re < -2.1e50Initial program 41.2%
Taylor expanded in y.im around 0
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f64N/A
pow-lowering-pow.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6488.3%
Simplified88.3%
if -2.1e50 < y.re < 7.20000000000000018Initial program 41.7%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified82.8%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6483.5%
Simplified83.5%
if 7.20000000000000018 < y.re Initial program 44.6%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified55.4%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6464.6%
Simplified64.6%
Taylor expanded in y.im around 0
Simplified69.2%
*-commutativeN/A
clear-numN/A
frac-2negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-pow2N/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6458.5%
Applied egg-rr58.5%
Taylor expanded in y.im around 0
Simplified77.0%
Final simplification82.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re 10.6)
(/
(cos (+ (* (log (hypot x.re x.im)) y.im) (* y.re (atan2 x.im x.re))))
(/ (exp (* y.im (atan2 x.im x.re))) (pow (hypot x.re x.im) y.re)))
(pow (+ (* x.re x.re) (* x.im x.im)) (/ y.re 2.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 <= 10.6) {
tmp = cos(((log(hypot(x_46_re, x_46_im)) * y_46_im) + (y_46_re * atan2(x_46_im, x_46_re)))) / (exp((y_46_im * atan2(x_46_im, x_46_re))) / pow(hypot(x_46_re, x_46_im), y_46_re));
} else {
tmp = pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
}
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 <= 10.6) {
tmp = Math.cos(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im) + (y_46_re * Math.atan2(x_46_im, x_46_re)))) / (Math.exp((y_46_im * Math.atan2(x_46_im, x_46_re))) / Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
} else {
tmp = Math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= 10.6: tmp = math.cos(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im) + (y_46_re * math.atan2(x_46_im, x_46_re)))) / (math.exp((y_46_im * math.atan2(x_46_im, x_46_re))) / math.pow(math.hypot(x_46_re, x_46_im), y_46_re)) else: tmp = math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 10.6) tmp = Float64(cos(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im) + Float64(y_46_re * atan(x_46_im, x_46_re)))) / Float64(exp(Float64(y_46_im * atan(x_46_im, x_46_re))) / (hypot(x_46_re, x_46_im) ^ y_46_re))); else tmp = Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) ^ Float64(y_46_re / 2.0); 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 <= 10.6) tmp = cos(((log(hypot(x_46_re, x_46_im)) * y_46_im) + (y_46_re * atan2(x_46_im, x_46_re)))) / (exp((y_46_im * atan2(x_46_im, x_46_re))) / (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = ((x_46_re * x_46_re) + (x_46_im * x_46_im)) ^ (y_46_re / 2.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 10.6], N[(N[Cos[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[Exp[N[(y$46$im * 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]), $MachinePrecision], N[Power[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 10.6:\\
\;\;\;\;\frac{\cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\
\end{array}
\end{array}
if y.re < 10.5999999999999996Initial program 41.6%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified83.2%
if 10.5999999999999996 < y.re Initial program 44.6%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified55.4%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6464.6%
Simplified64.6%
Taylor expanded in y.im around 0
Simplified69.2%
*-commutativeN/A
clear-numN/A
frac-2negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-pow2N/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6458.5%
Applied egg-rr58.5%
Taylor expanded in y.im around 0
Simplified77.0%
Final simplification81.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* y.im (atan2 x.im x.re)))))
(if (<= y.im 7.5e+47)
(/ 1.0 (/ t_0 (pow (hypot x.re x.im) y.re)))
(/ (cos (* y.im (log (hypot x.im x.re)))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((y_46_im * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= 7.5e+47) {
tmp = 1.0 / (t_0 / pow(hypot(x_46_re, x_46_im), y_46_re));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) / 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.exp((y_46_im * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= 7.5e+47) {
tmp = 1.0 / (t_0 / Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((y_46_im * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= 7.5e+47: tmp = 1.0 / (t_0 / math.pow(math.hypot(x_46_re, x_46_im), y_46_re)) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) / t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(y_46_im * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= 7.5e+47) tmp = Float64(1.0 / Float64(t_0 / (hypot(x_46_re, x_46_im) ^ y_46_re))); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((y_46_im * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= 7.5e+47) tmp = 1.0 / (t_0 / (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) / 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[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, 7.5e+47], N[(1.0 / N[(t$95$0 / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq 7.5 \cdot 10^{+47}:\\
\;\;\;\;\frac{1}{\frac{t\_0}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{t\_0}\\
\end{array}
\end{array}
if y.im < 7.4999999999999999e47Initial program 43.3%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified76.9%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6478.9%
Simplified78.9%
Taylor expanded in y.im around 0
Simplified80.8%
if 7.4999999999999999e47 < y.im Initial program 38.5%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified73.1%
Taylor expanded in y.re around 0
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6480.9%
Simplified80.9%
Final simplification80.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -2.9e+50)
(* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(if (<= y.re 1.2e-5)
(/ 1.0 (/ (exp (* y.im (atan2 x.im x.re))) t_0))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -2.9e+50) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1.2e-5) {
tmp = 1.0 / (exp((y_46_im * atan2(x_46_im, x_46_re))) / t_0);
} 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.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -2.9e+50) {
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 if (y_46_re <= 1.2e-5) {
tmp = 1.0 / (Math.exp((y_46_im * Math.atan2(x_46_im, x_46_re))) / t_0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -2.9e+50: 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) elif y_46_re <= 1.2e-5: tmp = 1.0 / (math.exp((y_46_im * math.atan2(x_46_im, x_46_re))) / t_0) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -2.9e+50) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 1.2e-5) tmp = Float64(1.0 / Float64(exp(Float64(y_46_im * atan(x_46_im, x_46_re))) / t_0)); 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 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -2.9e+50) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 1.2e-5) tmp = 1.0 / (exp((y_46_im * atan2(x_46_im, x_46_re))) / t_0); 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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -2.9e+50], 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], If[LessEqual[y$46$re, 1.2e-5], N[(1.0 / N[(N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -2.9 \cdot 10^{+50}:\\
\;\;\;\;\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{elif}\;y.re \leq 1.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{t\_0}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.9e50Initial program 41.2%
Taylor expanded in y.im around 0
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f64N/A
pow-lowering-pow.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6488.3%
Simplified88.3%
if -2.9e50 < y.re < 1.2e-5Initial program 41.9%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified82.5%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6483.2%
Simplified83.2%
Taylor expanded in y.im around 0
Simplified82.5%
if 1.2e-5 < y.re Initial program 44.1%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified57.3%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6466.2%
Simplified66.2%
Taylor expanded in y.im around 0
Simplified68.8%
Taylor expanded in y.im around 0
pow-lowering-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6476.3%
Simplified76.3%
Final simplification82.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -5.8e+31)
(* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(if (<= y.re 9e-7)
(/ 1.0 (exp (* y.im (atan2 x.im x.re))))
(pow (hypot x.re x.im) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -5.8e+31) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 9e-7) {
tmp = 1.0 / exp((y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 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 <= -5.8e+31) {
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 if (y_46_re <= 9e-7) {
tmp = 1.0 / Math.exp((y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = 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 <= -5.8e+31: 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) elif y_46_re <= 9e-7: tmp = 1.0 / math.exp((y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = 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 <= -5.8e+31) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 9e-7) tmp = Float64(1.0 / exp(Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = 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 <= -5.8e+31) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 9e-7) tmp = 1.0 / exp((y_46_im * atan2(x_46_im, x_46_re))); else tmp = 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, -5.8e+31], 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], If[LessEqual[y$46$re, 9e-7], N[(1.0 / N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5.8 \cdot 10^{+31}:\\
\;\;\;\;\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{elif}\;y.re \leq 9 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -5.8000000000000001e31Initial program 40.4%
Taylor expanded in y.im around 0
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f64N/A
pow-lowering-pow.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6488.6%
Simplified88.6%
if -5.8000000000000001e31 < y.re < 8.99999999999999959e-7Initial program 42.2%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified82.3%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6483.1%
Simplified83.1%
Taylor expanded in y.im around 0
Simplified82.3%
Taylor expanded in y.re around 0
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6481.3%
Simplified81.3%
if 8.99999999999999959e-7 < y.re Initial program 44.1%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified57.3%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6466.2%
Simplified66.2%
Taylor expanded in y.im around 0
Simplified68.8%
Taylor expanded in y.im around 0
pow-lowering-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6476.3%
Simplified76.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ 1.0 (exp (* y.im (atan2 x.im x.re))))))
(if (<= y.im -2.45e+61)
t_0
(if (<= y.im 55000.0) (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 = 1.0 / exp((y_46_im * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -2.45e+61) {
tmp = t_0;
} else if (y_46_im <= 55000.0) {
tmp = 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 = 1.0 / Math.exp((y_46_im * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -2.45e+61) {
tmp = t_0;
} else if (y_46_im <= 55000.0) {
tmp = 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 = 1.0 / math.exp((y_46_im * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= -2.45e+61: tmp = t_0 elif y_46_im <= 55000.0: tmp = 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(1.0 / exp(Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -2.45e+61) tmp = t_0; elseif (y_46_im <= 55000.0) tmp = 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 = 1.0 / exp((y_46_im * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= -2.45e+61) tmp = t_0; elseif (y_46_im <= 55000.0) tmp = 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[(1.0 / N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.45e+61], t$95$0, If[LessEqual[y$46$im, 55000.0], N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{if}\;y.im \leq -2.45 \cdot 10^{+61}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 55000:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -2.45000000000000013e61 or 55000 < y.im Initial program 34.9%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified65.9%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6463.4%
Simplified63.4%
Taylor expanded in y.im around 0
Simplified63.5%
Taylor expanded in y.re around 0
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6468.7%
Simplified68.7%
if -2.45000000000000013e61 < y.im < 55000Initial program 48.7%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified84.9%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6489.2%
Simplified89.2%
Taylor expanded in y.im around 0
Simplified89.7%
Taylor expanded in y.im around 0
pow-lowering-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6490.2%
Simplified90.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (+ (* x.re x.re) (* x.im x.im)) (/ y.re 2.0))))
(if (<= y.im -4.6e+76)
t_0
(if (<= y.im 8e-5) (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 = pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
double tmp;
if (y_46_im <= -4.6e+76) {
tmp = t_0;
} else if (y_46_im <= 8e-5) {
tmp = 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.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
double tmp;
if (y_46_im <= -4.6e+76) {
tmp = t_0;
} else if (y_46_im <= 8e-5) {
tmp = 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.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0)) tmp = 0 if y_46_im <= -4.6e+76: tmp = t_0 elif y_46_im <= 8e-5: tmp = 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(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) ^ Float64(y_46_re / 2.0) tmp = 0.0 if (y_46_im <= -4.6e+76) tmp = t_0; elseif (y_46_im <= 8e-5) tmp = 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 = ((x_46_re * x_46_re) + (x_46_im * x_46_im)) ^ (y_46_re / 2.0); tmp = 0.0; if (y_46_im <= -4.6e+76) tmp = t_0; elseif (y_46_im <= 8e-5) tmp = 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[Power[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -4.6e+76], t$95$0, If[LessEqual[y$46$im, 8e-5], N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\
\mathbf{if}\;y.im \leq -4.6 \cdot 10^{+76}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 8 \cdot 10^{-5}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -4.60000000000000002e76 or 8.00000000000000065e-5 < y.im Initial program 33.5%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified66.5%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6463.8%
Simplified63.8%
Taylor expanded in y.im around 0
Simplified63.1%
*-commutativeN/A
clear-numN/A
frac-2negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-pow2N/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6451.3%
Applied egg-rr51.3%
Taylor expanded in y.im around 0
Simplified44.3%
if -4.60000000000000002e76 < y.im < 8.00000000000000065e-5Initial program 49.4%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified83.9%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6488.1%
Simplified88.1%
Taylor expanded in y.im around 0
Simplified89.3%
Taylor expanded in y.im around 0
pow-lowering-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6487.0%
Simplified87.0%
Final simplification68.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (+ (* x.re x.re) (* x.im x.im)) (/ y.re 2.0))))
(if (<= y.re -7.5e-136)
t_0
(if (<= y.re 2.2e-102) (- 1.0 (* y.im (atan2 x.im x.re))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
double tmp;
if (y_46_re <= -7.5e-136) {
tmp = t_0;
} else if (y_46_re <= 2.2e-102) {
tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = ((x_46re * x_46re) + (x_46im * x_46im)) ** (y_46re / 2.0d0)
if (y_46re <= (-7.5d-136)) then
tmp = t_0
else if (y_46re <= 2.2d-102) then
tmp = 1.0d0 - (y_46im * atan2(x_46im, x_46re))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
double tmp;
if (y_46_re <= -7.5e-136) {
tmp = t_0;
} else if (y_46_re <= 2.2e-102) {
tmp = 1.0 - (y_46_im * Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0)) tmp = 0 if y_46_re <= -7.5e-136: tmp = t_0 elif y_46_re <= 2.2e-102: tmp = 1.0 - (y_46_im * math.atan2(x_46_im, x_46_re)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) ^ Float64(y_46_re / 2.0) tmp = 0.0 if (y_46_re <= -7.5e-136) tmp = t_0; elseif (y_46_re <= 2.2e-102) tmp = Float64(1.0 - Float64(y_46_im * atan(x_46_im, x_46_re))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_re * x_46_re) + (x_46_im * x_46_im)) ^ (y_46_re / 2.0); tmp = 0.0; if (y_46_re <= -7.5e-136) tmp = t_0; elseif (y_46_re <= 2.2e-102) tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7.5e-136], t$95$0, If[LessEqual[y$46$re, 2.2e-102], N[(1.0 - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\
\mathbf{if}\;y.re \leq -7.5 \cdot 10^{-136}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.2 \cdot 10^{-102}:\\
\;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -7.5000000000000003e-136 or 2.20000000000000013e-102 < y.re Initial program 40.7%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified73.6%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6475.3%
Simplified75.3%
Taylor expanded in y.im around 0
Simplified75.2%
*-commutativeN/A
clear-numN/A
frac-2negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-pow2N/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6464.5%
Applied egg-rr64.5%
Taylor expanded in y.im around 0
Simplified70.5%
if -7.5000000000000003e-136 < y.re < 2.20000000000000013e-102Initial program 45.8%
Taylor expanded in x.im around 0
exp-diffN/A
*-commutativeN/A
exp-to-powN/A
associate-/l*N/A
/-lowering-/.f64N/A
Simplified45.3%
Taylor expanded in y.re around 0
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6445.3%
Simplified45.3%
Taylor expanded in y.im around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6445.7%
Simplified45.7%
Final simplification62.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 2.15e-102) (- 1.0 (* y.im (atan2 x.im x.re))) (+ 1.0 (* y.re (* (log (+ (* x.re x.re) (* x.im x.im))) 0.5)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 2.15e-102) {
tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
} else {
tmp = 1.0 + (y_46_re * (log(((x_46_re * x_46_re) + (x_46_im * x_46_im))) * 0.5));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= 2.15d-102) then
tmp = 1.0d0 - (y_46im * atan2(x_46im, x_46re))
else
tmp = 1.0d0 + (y_46re * (log(((x_46re * x_46re) + (x_46im * x_46im))) * 0.5d0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 2.15e-102) {
tmp = 1.0 - (y_46_im * Math.atan2(x_46_im, x_46_re));
} else {
tmp = 1.0 + (y_46_re * (Math.log(((x_46_re * x_46_re) + (x_46_im * x_46_im))) * 0.5));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= 2.15e-102: tmp = 1.0 - (y_46_im * math.atan2(x_46_im, x_46_re)) else: tmp = 1.0 + (y_46_re * (math.log(((x_46_re * x_46_re) + (x_46_im * x_46_im))) * 0.5)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 2.15e-102) tmp = Float64(1.0 - Float64(y_46_im * atan(x_46_im, x_46_re))); else tmp = Float64(1.0 + Float64(y_46_re * Float64(log(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) * 0.5))); 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 <= 2.15e-102) tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re)); else tmp = 1.0 + (y_46_re * (log(((x_46_re * x_46_re) + (x_46_im * x_46_im))) * 0.5)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 2.15e-102], N[(1.0 - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[(N[Log[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 2.15 \cdot 10^{-102}:\\
\;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \left(\log \left(x.re \cdot x.re + x.im \cdot x.im\right) \cdot 0.5\right)\\
\end{array}
\end{array}
if y.re < 2.1499999999999999e-102Initial program 41.3%
Taylor expanded in x.im around 0
exp-diffN/A
*-commutativeN/A
exp-to-powN/A
associate-/l*N/A
/-lowering-/.f64N/A
Simplified41.7%
Taylor expanded in y.re around 0
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6435.4%
Simplified35.4%
Taylor expanded in y.im around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6429.5%
Simplified29.5%
if 2.1499999999999999e-102 < y.re Initial program 44.2%
Taylor expanded in y.im around 0
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f64N/A
pow-lowering-pow.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6454.1%
Simplified54.1%
Taylor expanded in y.re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6433.8%
Simplified33.8%
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
pow1/2N/A
+-commutativeN/A
pow-to-expN/A
rem-log-expN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6433.8%
Applied egg-rr33.8%
Final simplification31.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 1.8e-23) (- 1.0 (* y.im (atan2 x.im x.re))) (+ 1.0 (* y.re (log (+ x.re (/ (* (* x.im x.im) 0.5) 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.8e-23) {
tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
} else {
tmp = 1.0 + (y_46_re * log((x_46_re + (((x_46_im * x_46_im) * 0.5) / x_46_re))));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= 1.8d-23) then
tmp = 1.0d0 - (y_46im * atan2(x_46im, x_46re))
else
tmp = 1.0d0 + (y_46re * log((x_46re + (((x_46im * x_46im) * 0.5d0) / x_46re))))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 1.8e-23) {
tmp = 1.0 - (y_46_im * Math.atan2(x_46_im, x_46_re));
} else {
tmp = 1.0 + (y_46_re * Math.log((x_46_re + (((x_46_im * x_46_im) * 0.5) / 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.8e-23: tmp = 1.0 - (y_46_im * math.atan2(x_46_im, x_46_re)) else: tmp = 1.0 + (y_46_re * math.log((x_46_re + (((x_46_im * x_46_im) * 0.5) / 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.8e-23) tmp = Float64(1.0 - Float64(y_46_im * atan(x_46_im, x_46_re))); else tmp = Float64(1.0 + Float64(y_46_re * log(Float64(x_46_re + Float64(Float64(Float64(x_46_im * x_46_im) * 0.5) / x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= 1.8e-23) tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re)); else tmp = 1.0 + (y_46_re * log((x_46_re + (((x_46_im * x_46_im) * 0.5) / x_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, 1.8e-23], N[(1.0 - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[(x$46$re + N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] * 0.5), $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 1.8 \cdot 10^{-23}:\\
\;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(x.re + \frac{\left(x.im \cdot x.im\right) \cdot 0.5}{x.re}\right)\\
\end{array}
\end{array}
if y.re < 1.7999999999999999e-23Initial program 41.6%
Taylor expanded in x.im around 0
exp-diffN/A
*-commutativeN/A
exp-to-powN/A
associate-/l*N/A
/-lowering-/.f64N/A
Simplified40.9%
Taylor expanded in y.re around 0
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6435.2%
Simplified35.2%
Taylor expanded in y.im around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6430.6%
Simplified30.6%
if 1.7999999999999999e-23 < y.re Initial program 44.3%
Taylor expanded in y.im around 0
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f64N/A
pow-lowering-pow.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6458.5%
Simplified58.5%
Taylor expanded in y.re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6430.9%
Simplified30.9%
Taylor expanded in x.im around 0
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6418.5%
Simplified18.5%
Final simplification27.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 2.6e+82) (- 1.0 (* y.im (atan2 x.im x.re))) (+ 1.0 (* y.re (log (+ x.im (/ (* (* x.re x.re) 0.5) x.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 2.6e+82) {
tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
} else {
tmp = 1.0 + (y_46_re * log((x_46_im + (((x_46_re * x_46_re) * 0.5) / x_46_im))));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= 2.6d+82) then
tmp = 1.0d0 - (y_46im * atan2(x_46im, x_46re))
else
tmp = 1.0d0 + (y_46re * log((x_46im + (((x_46re * x_46re) * 0.5d0) / x_46im))))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 2.6e+82) {
tmp = 1.0 - (y_46_im * Math.atan2(x_46_im, x_46_re));
} else {
tmp = 1.0 + (y_46_re * Math.log((x_46_im + (((x_46_re * x_46_re) * 0.5) / x_46_im))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= 2.6e+82: tmp = 1.0 - (y_46_im * math.atan2(x_46_im, x_46_re)) else: tmp = 1.0 + (y_46_re * math.log((x_46_im + (((x_46_re * x_46_re) * 0.5) / x_46_im)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 2.6e+82) tmp = Float64(1.0 - Float64(y_46_im * atan(x_46_im, x_46_re))); else tmp = Float64(1.0 + Float64(y_46_re * log(Float64(x_46_im + Float64(Float64(Float64(x_46_re * x_46_re) * 0.5) / 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_re <= 2.6e+82) tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re)); else tmp = 1.0 + (y_46_re * log((x_46_im + (((x_46_re * x_46_re) * 0.5) / 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$re, 2.6e+82], N[(1.0 - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[(x$46$im + N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * 0.5), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 2.6 \cdot 10^{+82}:\\
\;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(x.im + \frac{\left(x.re \cdot x.re\right) \cdot 0.5}{x.im}\right)\\
\end{array}
\end{array}
if y.re < 2.5999999999999998e82Initial program 41.5%
Taylor expanded in x.im around 0
exp-diffN/A
*-commutativeN/A
exp-to-powN/A
associate-/l*N/A
/-lowering-/.f64N/A
Simplified40.4%
Taylor expanded in y.re around 0
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6433.2%
Simplified33.2%
Taylor expanded in y.im around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6428.2%
Simplified28.2%
if 2.5999999999999998e82 < y.re Initial program 45.8%
Taylor expanded in y.im around 0
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f64N/A
pow-lowering-pow.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6458.4%
Simplified58.4%
Taylor expanded in y.re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.6%
Simplified27.6%
Taylor expanded in x.re around 0
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.3%
Simplified12.3%
Final simplification25.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (- 1.0 (* y.im (atan2 x.im x.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 - (y_46_im * atan2(x_46_im, x_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
code = 1.0d0 - (y_46im * atan2(x_46im, x_46re))
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 - (y_46_im * Math.atan2(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_im * math.atan2(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_im * atan(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_im * atan2(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$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 42.3%
Taylor expanded in x.im around 0
exp-diffN/A
*-commutativeN/A
exp-to-powN/A
associate-/l*N/A
/-lowering-/.f64N/A
Simplified36.8%
Taylor expanded in y.re around 0
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6428.3%
Simplified28.3%
Taylor expanded in y.im around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6423.4%
Simplified23.4%
(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 42.3%
Taylor expanded in y.im around 0
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f64N/A
pow-lowering-pow.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6456.7%
Simplified56.7%
Taylor expanded in y.re around 0
Simplified23.2%
herbie shell --seed 2024154
(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)))))