
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -2.2e+17)
t_0
(if (<= y.re 1.6e-55)
(*
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))
(cos
(pow
(cbrt (fma (atan2 x.im x.re) y.re (* y.im (log (hypot x.re x.im)))))
3.0)))
(* t_0 (cos (* y.im (log (hypot x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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)));
double tmp;
if (y_46_re <= -2.2e+17) {
tmp = t_0;
} else if (y_46_re <= 1.6e-55) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re))) * cos(pow(cbrt(fma(atan2(x_46_im, x_46_re), y_46_re, (y_46_im * log(hypot(x_46_re, x_46_im))))), 3.0));
} else {
tmp = t_0 * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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))) tmp = 0.0 if (y_46_re <= -2.2e+17) tmp = t_0; elseif (y_46_re <= 1.6e-55) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) * cos((cbrt(fma(atan(x_46_im, x_46_re), y_46_re, Float64(y_46_im * log(hypot(x_46_re, x_46_im))))) ^ 3.0))); else tmp = Float64(t_0 * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[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]}, If[LessEqual[y$46$re, -2.2e+17], t$95$0, If[LessEqual[y$46$re, 1.6e-55], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[Power[N[Power[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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}\\
\mathbf{if}\;y.re \leq -2.2 \cdot 10^{+17}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-55}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -2.2e17Initial program 44.9%
Taylor expanded in y.im around 0 84.7%
Taylor expanded in y.re around 0 88.5%
if -2.2e17 < y.re < 1.6000000000000001e-55Initial program 37.2%
exp-diff37.2%
exp-to-pow37.2%
hypot-define37.2%
*-commutative37.2%
exp-prod36.4%
fma-define36.4%
hypot-define87.0%
*-commutative87.0%
Simplified87.0%
add-cube-cbrt90.4%
pow390.5%
hypot-define39.0%
*-commutative39.0%
fma-define39.0%
+-commutative39.0%
fma-define39.0%
*-commutative39.0%
hypot-define90.5%
Applied egg-rr90.5%
if 1.6000000000000001e-55 < y.re Initial program 38.1%
Taylor expanded in y.re around 0 44.4%
*-commutative44.4%
unpow244.4%
unpow244.4%
hypot-undefine77.8%
Simplified77.8%
Final simplification86.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= y.re 1.06e+40)
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(cos (* y.im (log (hypot x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 1.06e+40) {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} 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))) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 1.06e+40) tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); 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))) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 1.06e+40], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 1.06 \cdot 10^{+40}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\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 \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < 1.05999999999999996e40Initial program 41.6%
fmm-def41.6%
hypot-define41.6%
distribute-rgt-neg-out41.6%
fma-define41.6%
hypot-define87.3%
*-commutative87.3%
Simplified87.3%
if 1.05999999999999996e40 < y.re Initial program 32.7%
Taylor expanded in y.re around 0 38.5%
*-commutative38.5%
unpow238.5%
unpow238.5%
hypot-undefine76.9%
Simplified76.9%
Final simplification85.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(t_1 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -4.5e-24)
t_0
(if (<= y.re 5.4e-56)
(* t_1 (exp (* y.im (- (log1p (expm1 (atan2 x.im x.re)))))))
(* t_0 t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -4.5e-24) {
tmp = t_0;
} else if (y_46_re <= 5.4e-56) {
tmp = t_1 * exp((y_46_im * -log1p(expm1(atan2(x_46_im, x_46_re)))));
} else {
tmp = t_0 * 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.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -4.5e-24) {
tmp = t_0;
} else if (y_46_re <= 5.4e-56) {
tmp = t_1 * Math.exp((y_46_im * -Math.log1p(Math.expm1(Math.atan2(x_46_im, x_46_re)))));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) t_1 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -4.5e-24: tmp = t_0 elif y_46_re <= 5.4e-56: tmp = t_1 * math.exp((y_46_im * -math.log1p(math.expm1(math.atan2(x_46_im, x_46_re))))) else: tmp = t_0 * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_1 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -4.5e-24) tmp = t_0; elseif (y_46_re <= 5.4e-56) tmp = Float64(t_1 * exp(Float64(y_46_im * Float64(-log1p(expm1(atan(x_46_im, x_46_re))))))); else tmp = Float64(t_0 * t_1); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -4.5e-24], t$95$0, If[LessEqual[y$46$re, 5.4e-56], N[(t$95$1 * N[Exp[N[(y$46$im * (-N[Log[1 + N[(Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-24}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5.4 \cdot 10^{-56}:\\
\;\;\;\;t\_1 \cdot e^{y.im \cdot \left(-\mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\end{array}
\end{array}
if y.re < -4.4999999999999997e-24Initial program 46.3%
Taylor expanded in y.im around 0 84.2%
Taylor expanded in y.re around 0 87.9%
if -4.4999999999999997e-24 < y.re < 5.3999999999999999e-56Initial program 36.2%
fmm-def36.2%
hypot-define36.2%
distribute-rgt-neg-out36.2%
fma-define36.2%
hypot-define89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y.re around 0 36.2%
*-commutative36.2%
unpow236.2%
unpow236.2%
hypot-undefine89.1%
*-commutative89.1%
neg-mul-189.1%
distribute-rgt-neg-in89.1%
Simplified89.1%
log1p-expm1-u89.1%
Applied egg-rr89.1%
if 5.3999999999999999e-56 < y.re Initial program 37.5%
Taylor expanded in y.re around 0 43.8%
*-commutative43.8%
unpow243.8%
unpow243.8%
hypot-undefine76.6%
Simplified76.6%
Final simplification85.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -4.5e-24)
t_0
(if (<= y.re 5.4e-56)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* y.im (- (log1p (expm1 (atan2 x.im x.re)))))))
(if (<= y.re 2e+159)
t_0
(*
(cos (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(pow (hypot x.im x.re) y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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)));
double tmp;
if (y_46_re <= -4.5e-24) {
tmp = t_0;
} else if (y_46_re <= 5.4e-56) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((y_46_im * -log1p(expm1(atan2(x_46_im, x_46_re)))));
} else if (y_46_re <= 2e+159) {
tmp = t_0;
} else {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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))) tmp = 0.0 if (y_46_re <= -4.5e-24) tmp = t_0; elseif (y_46_re <= 5.4e-56) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(y_46_im * Float64(-log1p(expm1(atan(x_46_im, x_46_re))))))); elseif (y_46_re <= 2e+159) tmp = t_0; else tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -4.5e-24], t$95$0, If[LessEqual[y$46$re, 5.4e-56], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(y$46$im * (-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, 2e+159], t$95$0, N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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}\\
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-24}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5.4 \cdot 10^{-56}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.im \cdot \left(-\mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)}\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{+159}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -4.4999999999999997e-24 or 5.3999999999999999e-56 < y.re < 1.9999999999999999e159Initial program 45.2%
Taylor expanded in y.im around 0 75.7%
Taylor expanded in y.re around 0 84.4%
if -4.4999999999999997e-24 < y.re < 5.3999999999999999e-56Initial program 36.2%
fmm-def36.2%
hypot-define36.2%
distribute-rgt-neg-out36.2%
fma-define36.2%
hypot-define89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y.re around 0 36.2%
*-commutative36.2%
unpow236.2%
unpow236.2%
hypot-undefine89.1%
*-commutative89.1%
neg-mul-189.1%
distribute-rgt-neg-in89.1%
Simplified89.1%
log1p-expm1-u89.1%
Applied egg-rr89.1%
if 1.9999999999999999e159 < y.re Initial program 32.3%
fmm-def32.3%
hypot-define32.3%
distribute-rgt-neg-out32.3%
fma-define32.3%
hypot-define67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in y.im around 0 64.6%
unpow264.6%
unpow264.6%
hypot-undefine64.6%
Simplified64.6%
Final simplification84.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -4.5e-24) (not (<= y.re 5.4e-56)))
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* y.im (- (log1p (expm1 (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.5e-24) || !(y_46_re <= 5.4e-56)) {
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)));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((y_46_im * -log1p(expm1(atan2(x_46_im, x_46_re)))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.5e-24) || !(y_46_re <= 5.4e-56)) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((y_46_im * -Math.log1p(Math.expm1(Math.atan2(x_46_im, x_46_re)))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -4.5e-24) or not (y_46_re <= 5.4e-56): tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((y_46_im * -math.log1p(math.expm1(math.atan2(x_46_im, x_46_re))))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -4.5e-24) || !(y_46_re <= 5.4e-56)) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(y_46_im * Float64(-log1p(expm1(atan(x_46_im, x_46_re))))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -4.5e-24], N[Not[LessEqual[y$46$re, 5.4e-56]], $MachinePrecision]], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(y$46$im * (-N[Log[1 + N[(Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-24} \lor \neg \left(y.re \leq 5.4 \cdot 10^{-56}\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}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.im \cdot \left(-\mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)}\\
\end{array}
\end{array}
if y.re < -4.4999999999999997e-24 or 5.3999999999999999e-56 < y.re Initial program 42.5%
Taylor expanded in y.im around 0 72.7%
Taylor expanded in y.re around 0 77.5%
if -4.4999999999999997e-24 < y.re < 5.3999999999999999e-56Initial program 36.2%
fmm-def36.2%
hypot-define36.2%
distribute-rgt-neg-out36.2%
fma-define36.2%
hypot-define89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y.re around 0 36.2%
*-commutative36.2%
unpow236.2%
unpow236.2%
hypot-undefine89.1%
*-commutative89.1%
neg-mul-189.1%
distribute-rgt-neg-in89.1%
Simplified89.1%
log1p-expm1-u89.1%
Applied egg-rr89.1%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -4.5e-24) (not (<= y.re 5.4e-56)))
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.5e-24) || !(y_46_re <= 5.4e-56)) {
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)));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.5e-24) || !(y_46_re <= 5.4e-56)) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -4.5e-24) or not (y_46_re <= 5.4e-56): tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -4.5e-24) || !(y_46_re <= 5.4e-56)) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -4.5e-24) || ~((y_46_re <= 5.4e-56))) 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))); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -4.5e-24], N[Not[LessEqual[y$46$re, 5.4e-56]], $MachinePrecision]], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-24} \lor \neg \left(y.re \leq 5.4 \cdot 10^{-56}\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}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -4.4999999999999997e-24 or 5.3999999999999999e-56 < y.re Initial program 42.5%
Taylor expanded in y.im around 0 72.7%
Taylor expanded in y.re around 0 77.5%
if -4.4999999999999997e-24 < y.re < 5.3999999999999999e-56Initial program 36.2%
fmm-def36.2%
hypot-define36.2%
distribute-rgt-neg-out36.2%
fma-define36.2%
hypot-define89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y.re around 0 36.2%
*-commutative36.2%
unpow236.2%
unpow236.2%
hypot-undefine89.1%
*-commutative89.1%
neg-mul-189.1%
distribute-rgt-neg-in89.1%
Simplified89.1%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (or (<= y.re -4.5e-24) (not (<= y.re 5.4e-56)))
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(/ (cos (* y.im (log (hypot x.im x.re)))) (exp t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if ((y_46_re <= -4.5e-24) || !(y_46_re <= 5.4e-56)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) / exp(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.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if ((y_46_re <= -4.5e-24) || !(y_46_re <= 5.4e-56)) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / Math.exp(t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if (y_46_re <= -4.5e-24) or not (y_46_re <= 5.4e-56): tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) / math.exp(t_0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if ((y_46_re <= -4.5e-24) || !(y_46_re <= 5.4e-56)) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / exp(t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if ((y_46_re <= -4.5e-24) || ~((y_46_re <= 5.4e-56))) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) / exp(t_0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -4.5e-24], N[Not[LessEqual[y$46$re, 5.4e-56]], $MachinePrecision]], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-24} \lor \neg \left(y.re \leq 5.4 \cdot 10^{-56}\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{e^{t\_0}}\\
\end{array}
\end{array}
if y.re < -4.4999999999999997e-24 or 5.3999999999999999e-56 < y.re Initial program 42.5%
Taylor expanded in y.im around 0 72.7%
Taylor expanded in y.re around 0 77.5%
if -4.4999999999999997e-24 < y.re < 5.3999999999999999e-56Initial program 36.2%
exp-diff36.2%
exp-to-pow36.2%
hypot-define36.2%
*-commutative36.2%
exp-prod35.4%
fma-define35.4%
hypot-define88.2%
*-commutative88.2%
Simplified88.2%
add-cube-cbrt90.9%
pow390.1%
hypot-define37.1%
*-commutative37.1%
fma-define37.1%
+-commutative37.1%
fma-define37.1%
*-commutative37.1%
hypot-define90.1%
Applied egg-rr90.1%
Taylor expanded in y.re around 0 36.2%
unpow236.2%
unpow236.2%
hypot-undefine89.1%
Simplified89.1%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -2.3e+27) (not (<= y.im 7e-5)))
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -2.3e+27) || !(y_46_im <= 7e-5)) {
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)));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -2.3e+27) || !(y_46_im <= 7e-5)) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -2.3e+27) or not (y_46_im <= 7e-5): tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -2.3e+27) || !(y_46_im <= 7e-5)) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -2.3e+27) || ~((y_46_im <= 7e-5))) 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))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -2.3e+27], N[Not[LessEqual[y$46$im, 7e-5]], $MachinePrecision]], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.3 \cdot 10^{+27} \lor \neg \left(y.im \leq 7 \cdot 10^{-5}\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}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -2.3000000000000001e27 or 6.9999999999999994e-5 < y.im Initial program 45.0%
Taylor expanded in y.im around 0 66.3%
Taylor expanded in y.re around 0 63.8%
if -2.3000000000000001e27 < y.im < 6.9999999999999994e-5Initial program 35.2%
fmm-def35.2%
hypot-define35.2%
distribute-rgt-neg-out35.2%
fma-define35.2%
hypot-define85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in y.im around 0 56.0%
unpow256.0%
unpow256.0%
hypot-undefine83.7%
Simplified83.7%
Taylor expanded in y.re around 0 91.1%
Final simplification78.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -25.0)
(pow (log (exp (hypot x.re x.im))) y.re)
(if (<= y.im 1.6e+180)
(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 <= -25.0) {
tmp = pow(log(exp(hypot(x_46_re, x_46_im))), y_46_re);
} else if (y_46_im <= 1.6e+180) {
tmp = 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 <= -25.0) {
tmp = Math.pow(Math.log(Math.exp(Math.hypot(x_46_re, x_46_im))), y_46_re);
} else if (y_46_im <= 1.6e+180) {
tmp = 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 <= -25.0: tmp = math.pow(math.log(math.exp(math.hypot(x_46_re, x_46_im))), y_46_re) elif y_46_im <= 1.6e+180: tmp = 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 <= -25.0) tmp = log(exp(hypot(x_46_re, x_46_im))) ^ y_46_re; elseif (y_46_im <= 1.6e+180) tmp = 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 <= -25.0) tmp = log(exp(hypot(x_46_re, x_46_im))) ^ y_46_re; elseif (y_46_im <= 1.6e+180) tmp = 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, -25.0], N[Power[N[Log[N[Exp[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision], If[LessEqual[y$46$im, 1.6e+180], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $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 -25:\\
\;\;\;\;{\log \left(e^{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{+180}:\\
\;\;\;\;{\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 < -25Initial program 51.4%
fmm-def51.4%
hypot-define51.4%
distribute-rgt-neg-out51.4%
fma-define51.4%
hypot-define76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in y.im around 0 49.3%
unpow249.3%
unpow249.3%
hypot-undefine36.4%
Simplified36.4%
Taylor expanded in y.re around 0 31.4%
hypot-undefine44.3%
+-commutative44.3%
hypot-undefine31.4%
add-log-exp53.8%
Applied egg-rr53.8%
if -25 < y.im < 1.59999999999999997e180Initial program 37.4%
fmm-def37.4%
hypot-define37.4%
distribute-rgt-neg-out37.4%
fma-define37.4%
hypot-define83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in y.im around 0 54.3%
unpow254.3%
unpow254.3%
hypot-undefine76.1%
Simplified76.1%
Taylor expanded in y.re around 0 81.9%
if 1.59999999999999997e180 < y.im Initial program 27.3%
fmm-def27.3%
hypot-define27.3%
distribute-rgt-neg-out27.3%
fma-define27.3%
hypot-define86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in y.re around 0 27.3%
*-commutative27.3%
unpow227.3%
unpow227.3%
hypot-undefine77.6%
*-commutative77.6%
neg-mul-177.6%
distribute-rgt-neg-in77.6%
Simplified77.6%
Taylor expanded in x.im around inf 60.1%
Final simplification73.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -25.0) (pow (log (exp (hypot x.re x.im))) y.re) (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -25.0) {
tmp = pow(log(exp(hypot(x_46_re, x_46_im))), y_46_re);
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -25.0) {
tmp = Math.pow(Math.log(Math.exp(Math.hypot(x_46_re, x_46_im))), y_46_re);
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -25.0: tmp = math.pow(math.log(math.exp(math.hypot(x_46_re, x_46_im))), y_46_re) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -25.0) tmp = log(exp(hypot(x_46_re, x_46_im))) ^ y_46_re; else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -25.0) tmp = log(exp(hypot(x_46_re, x_46_im))) ^ y_46_re; else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -25.0], N[Power[N[Log[N[Exp[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -25:\\
\;\;\;\;{\log \left(e^{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -25Initial program 51.4%
fmm-def51.4%
hypot-define51.4%
distribute-rgt-neg-out51.4%
fma-define51.4%
hypot-define76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in y.im around 0 49.3%
unpow249.3%
unpow249.3%
hypot-undefine36.4%
Simplified36.4%
Taylor expanded in y.re around 0 31.4%
hypot-undefine44.3%
+-commutative44.3%
hypot-undefine31.4%
add-log-exp53.8%
Applied egg-rr53.8%
if -25 < y.im Initial program 36.2%
fmm-def36.2%
hypot-define36.2%
distribute-rgt-neg-out36.2%
fma-define36.2%
hypot-define83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in y.im around 0 50.9%
unpow250.9%
unpow250.9%
hypot-undefine69.9%
Simplified69.9%
Taylor expanded in y.re around 0 75.0%
Final simplification70.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -6.8e+27) (pow (pow (hypot x.re x.im) 2.0) (* y.re 0.5)) (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -6.8e+27) {
tmp = pow(pow(hypot(x_46_re, x_46_im), 2.0), (y_46_re * 0.5));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -6.8e+27) {
tmp = Math.pow(Math.pow(Math.hypot(x_46_re, x_46_im), 2.0), (y_46_re * 0.5));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -6.8e+27: tmp = math.pow(math.pow(math.hypot(x_46_re, x_46_im), 2.0), (y_46_re * 0.5)) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -6.8e+27) tmp = (hypot(x_46_re, x_46_im) ^ 2.0) ^ Float64(y_46_re * 0.5); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -6.8e+27) tmp = (hypot(x_46_re, x_46_im) ^ 2.0) ^ (y_46_re * 0.5); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -6.8e+27], N[Power[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -6.8 \cdot 10^{+27}:\\
\;\;\;\;{\left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{2}\right)}^{\left(y.re \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -6.8e27Initial program 52.7%
fmm-def52.7%
hypot-define52.7%
distribute-rgt-neg-out52.7%
fma-define52.7%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in y.im around 0 51.9%
unpow251.9%
unpow251.9%
hypot-undefine37.8%
Simplified37.8%
Taylor expanded in y.re around 0 32.4%
*-un-lft-identity32.4%
sqr-pow32.4%
pow-prod-down46.5%
hypot-undefine46.5%
hypot-undefine46.5%
add-sqr-sqrt46.5%
+-commutative46.5%
add-sqr-sqrt46.5%
hypot-undefine46.5%
hypot-undefine46.5%
pow246.5%
div-inv46.5%
metadata-eval46.5%
Applied egg-rr46.5%
if -6.8e27 < y.im Initial program 36.2%
fmm-def36.2%
hypot-define36.2%
distribute-rgt-neg-out36.2%
fma-define36.2%
hypot-define83.0%
*-commutative83.0%
Simplified83.0%
Taylor expanded in y.im around 0 50.2%
unpow250.2%
unpow250.2%
hypot-undefine68.7%
Simplified68.7%
Taylor expanded in y.re around 0 73.7%
Final simplification67.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -2.1e+28) (pow (+ x.re (* (pow x.im 2.0) (/ 0.5 x.re))) y.re) (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -2.1e+28) {
tmp = pow((x_46_re + (pow(x_46_im, 2.0) * (0.5 / x_46_re))), y_46_re);
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -2.1e+28) {
tmp = Math.pow((x_46_re + (Math.pow(x_46_im, 2.0) * (0.5 / x_46_re))), y_46_re);
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -2.1e+28: tmp = math.pow((x_46_re + (math.pow(x_46_im, 2.0) * (0.5 / x_46_re))), y_46_re) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -2.1e+28) tmp = Float64(x_46_re + Float64((x_46_im ^ 2.0) * Float64(0.5 / x_46_re))) ^ y_46_re; else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -2.1e+28) tmp = (x_46_re + ((x_46_im ^ 2.0) * (0.5 / x_46_re))) ^ y_46_re; else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -2.1e+28], N[Power[N[(x$46$re + N[(N[Power[x$46$im, 2.0], $MachinePrecision] * N[(0.5 / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.1 \cdot 10^{+28}:\\
\;\;\;\;{\left(x.re + {x.im}^{2} \cdot \frac{0.5}{x.re}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -2.09999999999999989e28Initial program 52.7%
fmm-def52.7%
hypot-define52.7%
distribute-rgt-neg-out52.7%
fma-define52.7%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in y.im around 0 51.9%
unpow251.9%
unpow251.9%
hypot-undefine37.8%
Simplified37.8%
Taylor expanded in y.re around 0 32.4%
Taylor expanded in x.im around 0 40.5%
*-commutative40.5%
associate-*l/40.5%
associate-*r/40.5%
Simplified40.5%
if -2.09999999999999989e28 < y.im Initial program 36.2%
fmm-def36.2%
hypot-define36.2%
distribute-rgt-neg-out36.2%
fma-define36.2%
hypot-define83.0%
*-commutative83.0%
Simplified83.0%
Taylor expanded in y.im around 0 50.2%
unpow250.2%
unpow250.2%
hypot-undefine68.7%
Simplified68.7%
Taylor expanded in y.re around 0 73.7%
Final simplification66.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow (hypot x.im x.re) y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return hypot(x_46_im, x_46_re) ^ y_46_re end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 39.8%
fmm-def39.8%
hypot-define39.8%
distribute-rgt-neg-out39.8%
fma-define39.8%
hypot-define82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in y.im around 0 50.6%
unpow250.6%
unpow250.6%
hypot-undefine62.1%
Simplified62.1%
Taylor expanded in y.re around 0 64.8%
Final simplification64.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.2e-5) (not (<= y.re 1500000000000.0))) (pow x.re y.re) 1.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 <= -3.2e-5) || !(y_46_re <= 1500000000000.0)) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = 1.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) :: tmp
if ((y_46re <= (-3.2d-5)) .or. (.not. (y_46re <= 1500000000000.0d0))) then
tmp = x_46re ** y_46re
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.2e-5) || !(y_46_re <= 1500000000000.0)) {
tmp = Math.pow(x_46_re, y_46_re);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -3.2e-5) or not (y_46_re <= 1500000000000.0): tmp = math.pow(x_46_re, y_46_re) else: tmp = 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -3.2e-5) || !(y_46_re <= 1500000000000.0)) tmp = x_46_re ^ y_46_re; else tmp = 1.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 <= -3.2e-5) || ~((y_46_re <= 1500000000000.0))) tmp = x_46_re ^ y_46_re; else tmp = 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3.2e-5], N[Not[LessEqual[y$46$re, 1500000000000.0]], $MachinePrecision]], N[Power[x$46$re, y$46$re], $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.2 \cdot 10^{-5} \lor \neg \left(y.re \leq 1500000000000\right):\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y.re < -3.19999999999999986e-5 or 1.5e12 < y.re Initial program 40.4%
fmm-def40.4%
hypot-define40.4%
distribute-rgt-neg-out40.4%
fma-define40.4%
hypot-define76.5%
*-commutative76.5%
Simplified76.5%
Taylor expanded in y.im around 0 67.1%
unpow267.1%
unpow267.1%
hypot-undefine67.1%
Simplified67.1%
Taylor expanded in y.re around 0 72.2%
Taylor expanded in x.im around 0 59.2%
if -3.19999999999999986e-5 < y.re < 1.5e12Initial program 39.0%
fmm-def39.0%
hypot-define39.0%
distribute-rgt-neg-out39.0%
fma-define39.0%
hypot-define88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in y.im around 0 31.8%
unpow231.8%
unpow231.8%
hypot-undefine56.4%
Simplified56.4%
Taylor expanded in y.re around 0 56.4%
Taylor expanded in x.re around 0 28.5%
Taylor expanded in y.re around 0 55.6%
Final simplification57.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.7e+17) (not (<= y.re 1500000000000.0))) (pow x.im y.re) 1.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.7e+17) || !(y_46_re <= 1500000000000.0)) {
tmp = pow(x_46_im, y_46_re);
} else {
tmp = 1.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) :: tmp
if ((y_46re <= (-1.7d+17)) .or. (.not. (y_46re <= 1500000000000.0d0))) then
tmp = x_46im ** y_46re
else
tmp = 1.0d0
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.7e+17) || !(y_46_re <= 1500000000000.0)) {
tmp = Math.pow(x_46_im, y_46_re);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.7e+17) or not (y_46_re <= 1500000000000.0): tmp = math.pow(x_46_im, y_46_re) else: tmp = 1.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.7e+17) || !(y_46_re <= 1500000000000.0)) tmp = x_46_im ^ y_46_re; else tmp = 1.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 <= -1.7e+17) || ~((y_46_re <= 1500000000000.0))) tmp = x_46_im ^ y_46_re; else tmp = 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.7e+17], N[Not[LessEqual[y$46$re, 1500000000000.0]], $MachinePrecision]], N[Power[x$46$im, y$46$re], $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.7 \cdot 10^{+17} \lor \neg \left(y.re \leq 1500000000000\right):\\
\;\;\;\;{x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y.re < -1.7e17 or 1.5e12 < y.re Initial program 40.0%
fmm-def40.0%
hypot-define40.0%
distribute-rgt-neg-out40.0%
fma-define40.0%
hypot-define76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in y.im around 0 66.8%
unpow266.8%
unpow266.8%
hypot-undefine66.8%
Simplified66.8%
Taylor expanded in y.re around 0 72.0%
Taylor expanded in x.re around 0 53.8%
if -1.7e17 < y.re < 1.5e12Initial program 39.5%
fmm-def39.5%
hypot-define39.5%
distribute-rgt-neg-out39.5%
fma-define39.5%
hypot-define88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in y.im around 0 32.4%
unpow232.4%
unpow232.4%
hypot-undefine56.8%
Simplified56.8%
Taylor expanded in y.re around 0 56.8%
Taylor expanded in x.re around 0 28.3%
Taylor expanded in y.re around 0 55.2%
Final simplification54.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -7.5e-19) (pow (- x.re) y.re) (if (<= x.re 5.8e-6) (pow x.im y.re) (pow x.re y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -7.5e-19) {
tmp = pow(-x_46_re, y_46_re);
} else if (x_46_re <= 5.8e-6) {
tmp = pow(x_46_im, y_46_re);
} else {
tmp = 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) :: tmp
if (x_46re <= (-7.5d-19)) then
tmp = -x_46re ** y_46re
else if (x_46re <= 5.8d-6) then
tmp = x_46im ** y_46re
else
tmp = 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 tmp;
if (x_46_re <= -7.5e-19) {
tmp = Math.pow(-x_46_re, y_46_re);
} else if (x_46_re <= 5.8e-6) {
tmp = Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -7.5e-19: tmp = math.pow(-x_46_re, y_46_re) elif x_46_re <= 5.8e-6: tmp = math.pow(x_46_im, y_46_re) else: tmp = math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -7.5e-19) tmp = Float64(-x_46_re) ^ y_46_re; elseif (x_46_re <= 5.8e-6) tmp = x_46_im ^ y_46_re; else tmp = x_46_re ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_re <= -7.5e-19) tmp = -x_46_re ^ y_46_re; elseif (x_46_re <= 5.8e-6) tmp = x_46_im ^ y_46_re; else tmp = x_46_re ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -7.5e-19], N[Power[(-x$46$re), y$46$re], $MachinePrecision], If[LessEqual[x$46$re, 5.8e-6], N[Power[x$46$im, y$46$re], $MachinePrecision], N[Power[x$46$re, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -7.5 \cdot 10^{-19}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 5.8 \cdot 10^{-6}:\\
\;\;\;\;{x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -7.49999999999999957e-19Initial program 25.1%
fmm-def25.1%
hypot-define25.1%
distribute-rgt-neg-out25.1%
fma-define25.1%
hypot-define79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.im around 0 46.7%
unpow246.7%
unpow246.7%
hypot-undefine64.8%
Simplified64.8%
Taylor expanded in y.re around 0 69.9%
Taylor expanded in x.re around -inf 69.9%
mul-1-neg69.9%
Simplified69.9%
if -7.49999999999999957e-19 < x.re < 5.8000000000000004e-6Initial program 51.2%
fmm-def51.2%
hypot-define51.2%
distribute-rgt-neg-out51.2%
fma-define51.2%
hypot-define80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in y.im around 0 48.6%
unpow248.6%
unpow248.6%
hypot-undefine56.2%
Simplified56.2%
Taylor expanded in y.re around 0 60.4%
Taylor expanded in x.re around 0 53.4%
if 5.8000000000000004e-6 < x.re Initial program 33.3%
fmm-def33.3%
hypot-define33.3%
distribute-rgt-neg-out33.3%
fma-define33.3%
hypot-define86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in y.im around 0 56.5%
unpow256.5%
unpow256.5%
hypot-undefine69.0%
Simplified69.0%
Taylor expanded in y.re around 0 67.7%
Taylor expanded in x.im around 0 67.7%
Final simplification61.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -5.1e-204) (pow (- x.im) y.re) (if (<= x.im 3.1e-28) (pow x.re y.re) (pow 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 (x_46_im <= -5.1e-204) {
tmp = pow(-x_46_im, y_46_re);
} else if (x_46_im <= 3.1e-28) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46im <= (-5.1d-204)) then
tmp = -x_46im ** y_46re
else if (x_46im <= 3.1d-28) then
tmp = x_46re ** y_46re
else
tmp = x_46im ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -5.1e-204) {
tmp = Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 3.1e-28) {
tmp = Math.pow(x_46_re, y_46_re);
} else {
tmp = Math.pow(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 x_46_im <= -5.1e-204: tmp = math.pow(-x_46_im, y_46_re) elif x_46_im <= 3.1e-28: tmp = math.pow(x_46_re, y_46_re) else: tmp = math.pow(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 (x_46_im <= -5.1e-204) tmp = Float64(-x_46_im) ^ y_46_re; elseif (x_46_im <= 3.1e-28) tmp = x_46_re ^ y_46_re; else tmp = 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 (x_46_im <= -5.1e-204) tmp = -x_46_im ^ y_46_re; elseif (x_46_im <= 3.1e-28) tmp = x_46_re ^ y_46_re; else tmp = 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[x$46$im, -5.1e-204], N[Power[(-x$46$im), y$46$re], $MachinePrecision], If[LessEqual[x$46$im, 3.1e-28], N[Power[x$46$re, y$46$re], $MachinePrecision], N[Power[x$46$im, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -5.1 \cdot 10^{-204}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 3.1 \cdot 10^{-28}:\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -5.10000000000000027e-204Initial program 37.5%
fmm-def37.5%
hypot-define37.5%
distribute-rgt-neg-out37.5%
fma-define37.5%
hypot-define85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in y.im around 0 45.6%
unpow245.6%
unpow245.6%
hypot-undefine59.5%
Simplified59.5%
Taylor expanded in y.re around 0 61.6%
Taylor expanded in x.im around -inf 58.5%
mul-1-neg58.5%
Simplified58.5%
if -5.10000000000000027e-204 < x.im < 3.09999999999999992e-28Initial program 44.8%
fmm-def44.8%
hypot-define44.8%
distribute-rgt-neg-out44.8%
fma-define44.8%
hypot-define80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in y.im around 0 55.3%
unpow255.3%
unpow255.3%
hypot-undefine64.6%
Simplified64.6%
Taylor expanded in y.re around 0 69.0%
Taylor expanded in x.im around 0 58.2%
if 3.09999999999999992e-28 < x.im Initial program 36.2%
fmm-def36.2%
hypot-define36.2%
distribute-rgt-neg-out36.2%
fma-define36.2%
hypot-define78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in y.im around 0 51.1%
unpow251.1%
unpow251.1%
hypot-undefine62.2%
Simplified62.2%
Taylor expanded in y.re around 0 63.7%
Taylor expanded in x.re around 0 62.3%
Final simplification59.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 39.8%
fmm-def39.8%
hypot-define39.8%
distribute-rgt-neg-out39.8%
fma-define39.8%
hypot-define82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in y.im around 0 50.6%
unpow250.6%
unpow250.6%
hypot-undefine62.1%
Simplified62.1%
Taylor expanded in y.re around 0 64.8%
Taylor expanded in x.re around 0 41.8%
Taylor expanded in y.re around 0 27.5%
herbie shell --seed 2024131
(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)))))