
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (log (hypot x.im x.re)))
(t_2 (* t_1 y.im)))
(if (<= y.re 5e+35)
(* (exp (- (* y.re t_1) t_0)) (cos (fma y.re (atan2 x.im x.re) t_2)))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(cos t_2)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = t_1 * y_46_im;
double tmp;
if (y_46_re <= 5e+35) {
tmp = exp(((y_46_re * t_1) - t_0)) * cos(fma(y_46_re, atan2(x_46_im, x_46_re), t_2));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * cos(t_2);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(t_1 * y_46_im) tmp = 0.0 if (y_46_re <= 5e+35) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - t_0)) * cos(fma(y_46_re, atan(x_46_im, x_46_re), t_2))); 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))))) - t_0)) * cos(t_2)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, 5e+35], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + t$95$2), $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] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := t\_1 \cdot y.im\\
\mathbf{if}\;y.re \leq 5 \cdot 10^{+35}:\\
\;\;\;\;e^{y.re \cdot t\_1 - t\_0} \cdot \cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \cos t\_2\\
\end{array}
\end{array}
if y.re < 5.00000000000000021e35Initial program 44.9%
fmm-def44.9%
hypot-define44.9%
distribute-rgt-neg-out44.9%
fma-define44.9%
hypot-define86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in y.re around inf 44.9%
*-commutative44.9%
Simplified86.3%
if 5.00000000000000021e35 < y.re Initial program 56.1%
Taylor expanded in y.re around 0 61.4%
*-commutative61.4%
unpow261.4%
unpow261.4%
hypot-undefine82.5%
Simplified82.5%
Final simplification85.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re))))
(t_1
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))))
(if (<= y.re -0.28)
(* t_1 t_0)
(if (<= y.re 8.6e+14)
(* t_0 (exp (* y.im (- (atan2 x.im x.re)))))
(* t_1 (cos (* (log (hypot 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 t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -0.28) {
tmp = t_1 * t_0;
} else if (y_46_re <= 8.6e+14) {
tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = t_1 * cos((log(hypot(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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -0.28) {
tmp = t_1 * t_0;
} else if (y_46_re <= 8.6e+14) {
tmp = t_0 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_1 * Math.cos((Math.log(Math.hypot(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): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -0.28: tmp = t_1 * t_0 elif y_46_re <= 8.6e+14: tmp = t_0 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) else: tmp = t_1 * math.cos((math.log(math.hypot(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) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -0.28) tmp = Float64(t_1 * t_0); elseif (y_46_re <= 8.6e+14) tmp = Float64(t_0 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(t_1 * cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -0.28) tmp = t_1 * t_0; elseif (y_46_re <= 8.6e+14) tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re))); else tmp = t_1 * cos((log(hypot(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_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.28], N[(t$95$1 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 8.6e+14], N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -0.28:\\
\;\;\;\;t\_1 \cdot t\_0\\
\mathbf{elif}\;y.re \leq 8.6 \cdot 10^{+14}:\\
\;\;\;\;t\_0 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -0.28000000000000003Initial program 42.4%
Taylor expanded in y.im around 0 89.9%
if -0.28000000000000003 < y.re < 8.6e14Initial program 46.2%
fmm-def46.2%
hypot-define46.2%
distribute-rgt-neg-out46.2%
fma-define46.2%
hypot-define84.2%
*-commutative84.2%
Simplified84.2%
add-cube-cbrt81.9%
pow382.7%
hypot-define46.2%
*-commutative46.2%
fma-define46.2%
+-commutative46.2%
*-commutative46.2%
fma-define46.2%
*-commutative46.2%
hypot-define82.7%
Applied egg-rr82.7%
Taylor expanded in y.re around 0 80.1%
neg-mul-180.1%
distribute-rgt-neg-in80.1%
Simplified80.1%
Taylor expanded in y.im around 0 84.2%
if 8.6e14 < y.re Initial program 54.8%
Taylor expanded in y.re around 0 59.7%
*-commutative59.7%
unpow259.7%
unpow259.7%
hypot-undefine82.3%
Simplified82.3%
Final simplification85.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -0.26)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
t_0)
(if (<= y.re 8.6e+14)
(* t_0 (exp (* y.im (- (atan2 x.im x.re)))))
(*
(cos (* (log (hypot 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 t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -0.26) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * t_0;
} else if (y_46_re <= 8.6e+14) {
tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * 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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -0.26) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re)))) * t_0;
} else if (y_46_re <= 8.6e+14) {
tmp = t_0 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * 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): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -0.26: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) * t_0 elif y_46_re <= 8.6e+14: tmp = t_0 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) else: tmp = math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * 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) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -0.26) 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(y_46_im * atan(x_46_im, x_46_re)))) * t_0); elseif (y_46_re <= 8.6e+14) tmp = Float64(t_0 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * (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) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -0.26) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * t_0; elseif (y_46_re <= 8.6e+14) tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re))); else tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * (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_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.26], 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 8.6e+14], N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $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 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -0.26:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 8.6 \cdot 10^{+14}:\\
\;\;\;\;t\_0 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -0.26000000000000001Initial program 42.4%
Taylor expanded in y.im around 0 89.9%
if -0.26000000000000001 < y.re < 8.6e14Initial program 46.2%
fmm-def46.2%
hypot-define46.2%
distribute-rgt-neg-out46.2%
fma-define46.2%
hypot-define84.2%
*-commutative84.2%
Simplified84.2%
add-cube-cbrt81.9%
pow382.7%
hypot-define46.2%
*-commutative46.2%
fma-define46.2%
+-commutative46.2%
*-commutative46.2%
fma-define46.2%
*-commutative46.2%
hypot-define82.7%
Applied egg-rr82.7%
Taylor expanded in y.re around 0 80.1%
neg-mul-180.1%
distribute-rgt-neg-in80.1%
Simplified80.1%
Taylor expanded in y.im around 0 84.2%
if 8.6e14 < y.re Initial program 54.8%
fmm-def54.8%
hypot-define54.8%
distribute-rgt-neg-out54.8%
fma-define54.8%
hypot-define74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in y.im around inf 43.5%
unpow243.5%
unpow243.5%
hypot-undefine61.3%
associate-/l*61.3%
Simplified61.3%
Taylor expanded in y.im around 0 58.1%
unpow258.1%
unpow258.1%
hypot-undefine58.1%
Simplified58.1%
expm1-log1p-u33.9%
expm1-undefine33.9%
+-commutative33.9%
fma-define33.9%
Applied egg-rr33.9%
expm1-define33.9%
Simplified33.9%
Taylor expanded in y.im around inf 58.1%
*-commutative58.1%
unpow258.1%
unpow258.1%
hypot-undefine80.7%
Simplified80.7%
Final simplification84.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -1.1)
(* t_0 (pow (+ x.re (* 0.5 (/ (pow x.im 2.0) x.re))) y.re))
(if (<= y.re 1.9e+16)
(* t_0 (exp (* y.im (- (atan2 x.im x.re)))))
(*
(cos (* (log (hypot 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 t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.1) {
tmp = t_0 * pow((x_46_re + (0.5 * (pow(x_46_im, 2.0) / x_46_re))), y_46_re);
} else if (y_46_re <= 1.9e+16) {
tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * 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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.1) {
tmp = t_0 * Math.pow((x_46_re + (0.5 * (Math.pow(x_46_im, 2.0) / x_46_re))), y_46_re);
} else if (y_46_re <= 1.9e+16) {
tmp = t_0 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * 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): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -1.1: tmp = t_0 * math.pow((x_46_re + (0.5 * (math.pow(x_46_im, 2.0) / x_46_re))), y_46_re) elif y_46_re <= 1.9e+16: tmp = t_0 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) else: tmp = math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * 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) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -1.1) tmp = Float64(t_0 * (Float64(x_46_re + Float64(0.5 * Float64((x_46_im ^ 2.0) / x_46_re))) ^ y_46_re)); elseif (y_46_re <= 1.9e+16) tmp = Float64(t_0 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * (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) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -1.1) tmp = t_0 * ((x_46_re + (0.5 * ((x_46_im ^ 2.0) / x_46_re))) ^ y_46_re); elseif (y_46_re <= 1.9e+16) tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re))); else tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * (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_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.1], N[(t$95$0 * N[Power[N[(x$46$re + N[(0.5 * N[(N[Power[x$46$im, 2.0], $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.9e+16], N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $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 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -1.1:\\
\;\;\;\;t\_0 \cdot {\left(x.re + 0.5 \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{+16}:\\
\;\;\;\;t\_0 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.1000000000000001Initial program 42.4%
fmm-def42.4%
hypot-define42.4%
distribute-rgt-neg-out42.4%
fma-define42.4%
hypot-define89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in y.im around 0 83.3%
unpow283.3%
unpow283.3%
hypot-undefine83.3%
Simplified83.3%
Taylor expanded in x.im around 0 84.9%
if -1.1000000000000001 < y.re < 1.9e16Initial program 46.2%
fmm-def46.2%
hypot-define46.2%
distribute-rgt-neg-out46.2%
fma-define46.2%
hypot-define84.2%
*-commutative84.2%
Simplified84.2%
add-cube-cbrt81.9%
pow382.7%
hypot-define46.2%
*-commutative46.2%
fma-define46.2%
+-commutative46.2%
*-commutative46.2%
fma-define46.2%
*-commutative46.2%
hypot-define82.7%
Applied egg-rr82.7%
Taylor expanded in y.re around 0 80.1%
neg-mul-180.1%
distribute-rgt-neg-in80.1%
Simplified80.1%
Taylor expanded in y.im around 0 84.2%
if 1.9e16 < y.re Initial program 54.8%
fmm-def54.8%
hypot-define54.8%
distribute-rgt-neg-out54.8%
fma-define54.8%
hypot-define74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in y.im around inf 43.5%
unpow243.5%
unpow243.5%
hypot-undefine61.3%
associate-/l*61.3%
Simplified61.3%
Taylor expanded in y.im around 0 58.1%
unpow258.1%
unpow258.1%
hypot-undefine58.1%
Simplified58.1%
expm1-log1p-u33.9%
expm1-undefine33.9%
+-commutative33.9%
fma-define33.9%
Applied egg-rr33.9%
expm1-define33.9%
Simplified33.9%
Taylor expanded in y.im around inf 58.1%
*-commutative58.1%
unpow258.1%
unpow258.1%
hypot-undefine80.7%
Simplified80.7%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (or (<= y.re -0.075) (not (<= y.re 3.5e-25)))
(* t_0 (pow (hypot x.im x.re) y.re))
(* t_0 (exp (* y.im (- (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_re <= -0.075) || !(y_46_re <= 3.5e-25)) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_re <= -0.075) || !(y_46_re <= 3.5e-25)) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_re <= -0.075) or not (y_46_re <= 3.5e-25): tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_re <= -0.075) || !(y_46_re <= 3.5e-25)) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if ((y_46_re <= -0.075) || ~((y_46_re <= 3.5e-25))) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -0.075], N[Not[LessEqual[y$46$re, 3.5e-25]], $MachinePrecision]], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -0.075 \lor \neg \left(y.re \leq 3.5 \cdot 10^{-25}\right):\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -0.0749999999999999972 or 3.5000000000000002e-25 < y.re Initial program 47.1%
fmm-def47.1%
hypot-define47.1%
distribute-rgt-neg-out47.1%
fma-define47.1%
hypot-define81.1%
*-commutative81.1%
Simplified81.1%
Taylor expanded in y.im around 0 73.0%
unpow273.0%
unpow273.0%
hypot-undefine75.1%
Simplified75.1%
if -0.0749999999999999972 < y.re < 3.5000000000000002e-25Initial program 47.7%
fmm-def47.7%
hypot-define47.7%
distribute-rgt-neg-out47.7%
fma-define47.7%
hypot-define85.2%
*-commutative85.2%
Simplified85.2%
add-cube-cbrt82.7%
pow383.7%
hypot-define47.0%
*-commutative47.0%
fma-define47.0%
+-commutative47.0%
*-commutative47.0%
fma-define47.0%
*-commutative47.0%
hypot-define83.7%
Applied egg-rr83.7%
Taylor expanded in y.re around 0 83.7%
neg-mul-183.7%
distribute-rgt-neg-in83.7%
Simplified83.7%
Taylor expanded in y.im around 0 86.5%
Final simplification80.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -7.6)
(* t_0 (pow (+ x.re (* 0.5 (/ (pow x.im 2.0) x.re))) y.re))
(if (<= y.re 3.5e-25)
(* t_0 (exp (* y.im (- (atan2 x.im x.re)))))
(* t_0 (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 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -7.6) {
tmp = t_0 * pow((x_46_re + (0.5 * (pow(x_46_im, 2.0) / x_46_re))), y_46_re);
} else if (y_46_re <= 3.5e-25) {
tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * 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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -7.6) {
tmp = t_0 * Math.pow((x_46_re + (0.5 * (Math.pow(x_46_im, 2.0) / x_46_re))), y_46_re);
} else if (y_46_re <= 3.5e-25) {
tmp = t_0 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * 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): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -7.6: tmp = t_0 * math.pow((x_46_re + (0.5 * (math.pow(x_46_im, 2.0) / x_46_re))), y_46_re) elif y_46_re <= 3.5e-25: tmp = t_0 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) else: tmp = t_0 * 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) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -7.6) tmp = Float64(t_0 * (Float64(x_46_re + Float64(0.5 * Float64((x_46_im ^ 2.0) / x_46_re))) ^ y_46_re)); elseif (y_46_re <= 3.5e-25) tmp = Float64(t_0 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(t_0 * (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) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -7.6) tmp = t_0 * ((x_46_re + (0.5 * ((x_46_im ^ 2.0) / x_46_re))) ^ y_46_re); elseif (y_46_re <= 3.5e-25) tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re))); else tmp = t_0 * (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_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7.6], N[(t$95$0 * N[Power[N[(x$46$re + N[(0.5 * N[(N[Power[x$46$im, 2.0], $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.5e-25], N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 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 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -7.6:\\
\;\;\;\;t\_0 \cdot {\left(x.re + 0.5 \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 3.5 \cdot 10^{-25}:\\
\;\;\;\;t\_0 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -7.5999999999999996Initial program 42.4%
fmm-def42.4%
hypot-define42.4%
distribute-rgt-neg-out42.4%
fma-define42.4%
hypot-define89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in y.im around 0 83.3%
unpow283.3%
unpow283.3%
hypot-undefine83.3%
Simplified83.3%
Taylor expanded in x.im around 0 84.9%
if -7.5999999999999996 < y.re < 3.5000000000000002e-25Initial program 47.4%
fmm-def47.4%
hypot-define47.4%
distribute-rgt-neg-out47.4%
fma-define47.4%
hypot-define85.2%
*-commutative85.2%
Simplified85.2%
add-cube-cbrt82.8%
pow383.7%
hypot-define46.7%
*-commutative46.7%
fma-define46.7%
+-commutative46.7%
*-commutative46.7%
fma-define46.7%
*-commutative46.7%
hypot-define83.7%
Applied egg-rr83.7%
Taylor expanded in y.re around 0 83.1%
neg-mul-183.1%
distribute-rgt-neg-in83.1%
Simplified83.1%
Taylor expanded in y.im around 0 85.9%
if 3.5000000000000002e-25 < y.re Initial program 51.6%
fmm-def51.6%
hypot-define51.6%
distribute-rgt-neg-out51.6%
fma-define51.6%
hypot-define73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in y.im around 0 65.5%
unpow265.5%
unpow265.5%
hypot-undefine68.2%
Simplified68.2%
Final simplification80.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 47.4%
fmm-def47.4%
hypot-define47.4%
distribute-rgt-neg-out47.4%
fma-define47.4%
hypot-define83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in y.im around 0 59.6%
unpow259.6%
unpow259.6%
hypot-undefine63.7%
Simplified63.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -0.00028)
(* t_0 (pow (+ x.im (* 0.5 (* x.re (/ x.re x.im)))) y.re))
(if (<= y.re 7.5e-10)
(cos (* (log (hypot x.im x.re)) y.im))
(* t_0 (pow x.re y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -0.00028) {
tmp = t_0 * pow((x_46_im + (0.5 * (x_46_re * (x_46_re / x_46_im)))), y_46_re);
} else if (y_46_re <= 7.5e-10) {
tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = t_0 * pow(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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -0.00028) {
tmp = t_0 * Math.pow((x_46_im + (0.5 * (x_46_re * (x_46_re / x_46_im)))), y_46_re);
} else if (y_46_re <= 7.5e-10) {
tmp = Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -0.00028: tmp = t_0 * math.pow((x_46_im + (0.5 * (x_46_re * (x_46_re / x_46_im)))), y_46_re) elif y_46_re <= 7.5e-10: tmp = math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) else: tmp = t_0 * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -0.00028) tmp = Float64(t_0 * (Float64(x_46_im + Float64(0.5 * Float64(x_46_re * Float64(x_46_re / x_46_im)))) ^ y_46_re)); elseif (y_46_re <= 7.5e-10) tmp = cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = Float64(t_0 * (x_46_re ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -0.00028) tmp = t_0 * ((x_46_im + (0.5 * (x_46_re * (x_46_re / x_46_im)))) ^ y_46_re); elseif (y_46_re <= 7.5e-10) tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = t_0 * (x_46_re ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.00028], N[(t$95$0 * N[Power[N[(x$46$im + N[(0.5 * N[(x$46$re * N[(x$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.5e-10], N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -0.00028:\\
\;\;\;\;t\_0 \cdot {\left(x.im + 0.5 \cdot \left(x.re \cdot \frac{x.re}{x.im}\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 7.5 \cdot 10^{-10}:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.7999999999999998e-4Initial program 41.0%
fmm-def41.0%
hypot-define41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in y.im around 0 82.2%
unpow282.2%
unpow282.2%
hypot-undefine82.2%
Simplified82.2%
Taylor expanded in x.re around 0 72.5%
unpow272.5%
*-un-lft-identity72.5%
times-frac74.1%
Applied egg-rr74.1%
if -2.7999999999999998e-4 < y.re < 7.49999999999999995e-10Initial program 47.9%
fmm-def47.9%
hypot-define47.9%
distribute-rgt-neg-out47.9%
fma-define47.9%
hypot-define84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in y.im around inf 47.9%
unpow247.9%
unpow247.9%
hypot-undefine84.7%
associate-/l*84.7%
Simplified84.7%
Taylor expanded in y.im around 0 40.6%
unpow240.6%
unpow240.6%
hypot-undefine53.3%
Simplified53.3%
expm1-log1p-u52.2%
expm1-undefine52.2%
+-commutative52.2%
fma-define52.2%
Applied egg-rr52.2%
expm1-define52.2%
Simplified52.2%
Taylor expanded in y.re around 0 30.8%
*-commutative30.8%
unpow230.8%
unpow230.8%
hypot-undefine53.1%
Simplified53.1%
if 7.49999999999999995e-10 < y.re Initial program 52.2%
fmm-def52.2%
hypot-define52.2%
distribute-rgt-neg-out52.2%
fma-define52.2%
hypot-define73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in y.im around 0 66.8%
unpow266.8%
unpow266.8%
hypot-undefine68.2%
Simplified68.2%
Taylor expanded in x.im around 0 64.6%
Final simplification61.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -0.26) (not (<= y.re 8e-10))) (* (cos (* y.re (atan2 x.im x.re))) (pow x.re y.re)) (cos (* (log (hypot 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 <= -0.26) || !(y_46_re <= 8e-10)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_re, y_46_re);
} else {
tmp = cos((log(hypot(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 <= -0.26) || !(y_46_re <= 8e-10)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_re, y_46_re);
} else {
tmp = Math.cos((Math.log(Math.hypot(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 <= -0.26) or not (y_46_re <= 8e-10): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_re, y_46_re) else: tmp = math.cos((math.log(math.hypot(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 <= -0.26) || !(y_46_re <= 8e-10)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_re ^ y_46_re)); else tmp = cos(Float64(log(hypot(x_46_im, x_46_re)) * 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 <= -0.26) || ~((y_46_re <= 8e-10))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_re ^ y_46_re); else tmp = cos((log(hypot(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, -0.26], N[Not[LessEqual[y$46$re, 8e-10]], $MachinePrecision]], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.26 \lor \neg \left(y.re \leq 8 \cdot 10^{-10}\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -0.26000000000000001 or 8.00000000000000029e-10 < y.re Initial program 47.7%
fmm-def47.7%
hypot-define47.7%
distribute-rgt-neg-out47.7%
fma-define47.7%
hypot-define81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in y.im around 0 74.4%
unpow274.4%
unpow274.4%
hypot-undefine75.1%
Simplified75.1%
Taylor expanded in x.im around 0 66.3%
if -0.26000000000000001 < y.re < 8.00000000000000029e-10Initial program 47.2%
fmm-def47.2%
hypot-define47.2%
distribute-rgt-neg-out47.2%
fma-define47.2%
hypot-define84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in y.im around inf 47.2%
unpow247.2%
unpow247.2%
hypot-undefine84.9%
associate-/l*84.9%
Simplified84.9%
Taylor expanded in y.im around 0 40.8%
unpow240.8%
unpow240.8%
hypot-undefine53.3%
Simplified53.3%
expm1-log1p-u52.2%
expm1-undefine52.2%
+-commutative52.2%
fma-define52.2%
Applied egg-rr52.2%
expm1-define52.2%
Simplified52.2%
Taylor expanded in y.re around 0 30.3%
*-commutative30.3%
unpow230.3%
unpow230.3%
hypot-undefine52.4%
Simplified52.4%
Final simplification59.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -0.072) (not (<= y.re 2.4e-8))) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (cos (* (log (hypot 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 <= -0.072) || !(y_46_re <= 2.4e-8)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = cos((log(hypot(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 <= -0.072) || !(y_46_re <= 2.4e-8)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.cos((Math.log(Math.hypot(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 <= -0.072) or not (y_46_re <= 2.4e-8): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) else: tmp = math.cos((math.log(math.hypot(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 <= -0.072) || !(y_46_re <= 2.4e-8)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = cos(Float64(log(hypot(x_46_im, x_46_re)) * 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 <= -0.072) || ~((y_46_re <= 2.4e-8))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = cos((log(hypot(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, -0.072], N[Not[LessEqual[y$46$re, 2.4e-8]], $MachinePrecision]], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.072 \lor \neg \left(y.re \leq 2.4 \cdot 10^{-8}\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -0.0719999999999999946 or 2.39999999999999998e-8 < y.re Initial program 47.2%
fmm-def47.2%
hypot-define47.2%
distribute-rgt-neg-out47.2%
fma-define47.2%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.im around 0 74.2%
unpow274.2%
unpow274.2%
hypot-undefine74.9%
Simplified74.9%
Taylor expanded in x.im around inf 55.6%
if -0.0719999999999999946 < y.re < 2.39999999999999998e-8Initial program 47.6%
fmm-def47.6%
hypot-define47.6%
distribute-rgt-neg-out47.6%
fma-define47.6%
hypot-define85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in y.im around inf 47.6%
unpow247.6%
unpow247.6%
hypot-undefine85.1%
associate-/l*85.1%
Simplified85.1%
Taylor expanded in y.im around 0 41.2%
unpow241.2%
unpow241.2%
hypot-undefine53.6%
Simplified53.6%
expm1-log1p-u52.6%
expm1-undefine52.6%
+-commutative52.6%
fma-define52.6%
Applied egg-rr52.6%
expm1-define52.6%
Simplified52.6%
Taylor expanded in y.re around 0 30.5%
*-commutative30.5%
unpow230.5%
unpow230.5%
hypot-undefine52.7%
Simplified52.7%
Final simplification54.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.7) (not (<= y.re 1.05e-9))) (+ 1.0 (log (pow x.re y.re))) (cos (* (log (hypot 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 <= -3.7) || !(y_46_re <= 1.05e-9)) {
tmp = 1.0 + log(pow(x_46_re, y_46_re));
} else {
tmp = cos((log(hypot(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 <= -3.7) || !(y_46_re <= 1.05e-9)) {
tmp = 1.0 + Math.log(Math.pow(x_46_re, y_46_re));
} else {
tmp = Math.cos((Math.log(Math.hypot(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 <= -3.7) or not (y_46_re <= 1.05e-9): tmp = 1.0 + math.log(math.pow(x_46_re, y_46_re)) else: tmp = math.cos((math.log(math.hypot(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 <= -3.7) || !(y_46_re <= 1.05e-9)) tmp = Float64(1.0 + log((x_46_re ^ y_46_re))); else tmp = cos(Float64(log(hypot(x_46_im, x_46_re)) * 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 <= -3.7) || ~((y_46_re <= 1.05e-9))) tmp = 1.0 + log((x_46_re ^ y_46_re)); else tmp = cos((log(hypot(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, -3.7], N[Not[LessEqual[y$46$re, 1.05e-9]], $MachinePrecision]], N[(1.0 + N[Log[N[Power[x$46$re, y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.7 \lor \neg \left(y.re \leq 1.05 \cdot 10^{-9}\right):\\
\;\;\;\;1 + \log \left({x.re}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -3.7000000000000002 or 1.0500000000000001e-9 < y.re Initial program 47.7%
fmm-def47.7%
hypot-define47.7%
distribute-rgt-neg-out47.7%
fma-define47.7%
hypot-define81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in y.im around 0 74.4%
unpow274.4%
unpow274.4%
hypot-undefine75.1%
Simplified75.1%
Taylor expanded in x.re around inf 38.8%
associate-*r*38.8%
exp-prod38.6%
mul-1-neg38.6%
log-rec38.6%
Simplified38.6%
Taylor expanded in y.re around 0 3.2%
add-log-exp22.4%
*-commutative22.4%
exp-to-pow30.6%
Applied egg-rr30.6%
if -3.7000000000000002 < y.re < 1.0500000000000001e-9Initial program 47.2%
fmm-def47.2%
hypot-define47.2%
distribute-rgt-neg-out47.2%
fma-define47.2%
hypot-define84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in y.im around inf 47.2%
unpow247.2%
unpow247.2%
hypot-undefine84.9%
associate-/l*84.9%
Simplified84.9%
Taylor expanded in y.im around 0 40.8%
unpow240.8%
unpow240.8%
hypot-undefine53.3%
Simplified53.3%
expm1-log1p-u52.2%
expm1-undefine52.2%
+-commutative52.2%
fma-define52.2%
Applied egg-rr52.2%
expm1-define52.2%
Simplified52.2%
Taylor expanded in y.re around 0 30.3%
*-commutative30.3%
unpow230.3%
unpow230.3%
hypot-undefine52.4%
Simplified52.4%
Final simplification41.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= x.re 4.4e-297)
(* t_0 (pow (- x.re) y.re))
(* t_0 (pow x.re y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= 4.4e-297) {
tmp = t_0 * pow(-x_46_re, y_46_re);
} else {
tmp = t_0 * pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = cos((y_46re * atan2(x_46im, x_46re)))
if (x_46re <= 4.4d-297) then
tmp = t_0 * (-x_46re ** y_46re)
else
tmp = t_0 * (x_46re ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= 4.4e-297) {
tmp = t_0 * Math.pow(-x_46_re, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= 4.4e-297: tmp = t_0 * math.pow(-x_46_re, y_46_re) else: tmp = t_0 * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= 4.4e-297) tmp = Float64(t_0 * (Float64(-x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * (x_46_re ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= 4.4e-297) tmp = t_0 * (-x_46_re ^ y_46_re); else tmp = t_0 * (x_46_re ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 4.4e-297], N[(t$95$0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq 4.4 \cdot 10^{-297}:\\
\;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < 4.3999999999999997e-297Initial program 43.0%
fmm-def43.0%
hypot-define43.0%
distribute-rgt-neg-out43.0%
fma-define43.0%
hypot-define84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in y.im around 0 57.9%
unpow257.9%
unpow257.9%
hypot-undefine62.4%
Simplified62.4%
Taylor expanded in x.re around -inf 56.4%
mul-1-neg56.4%
Simplified56.4%
if 4.3999999999999997e-297 < x.re Initial program 51.8%
fmm-def51.8%
hypot-define51.8%
distribute-rgt-neg-out51.8%
fma-define51.8%
hypot-define81.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in y.im around 0 61.4%
unpow261.4%
unpow261.4%
hypot-undefine64.9%
Simplified64.9%
Taylor expanded in x.im around 0 61.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -5.2) (not (<= y.re 2.7e-5))) (+ 1.0 (log (pow x.re y.re))) (+ (* y.re (log (hypot x.im x.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 <= -5.2) || !(y_46_re <= 2.7e-5)) {
tmp = 1.0 + log(pow(x_46_re, y_46_re));
} else {
tmp = (y_46_re * log(hypot(x_46_im, x_46_re))) + 1.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 <= -5.2) || !(y_46_re <= 2.7e-5)) {
tmp = 1.0 + Math.log(Math.pow(x_46_re, y_46_re));
} else {
tmp = (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re))) + 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -5.2) or not (y_46_re <= 2.7e-5): tmp = 1.0 + math.log(math.pow(x_46_re, y_46_re)) else: tmp = (y_46_re * math.log(math.hypot(x_46_im, x_46_re))) + 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 <= -5.2) || !(y_46_re <= 2.7e-5)) tmp = Float64(1.0 + log((x_46_re ^ y_46_re))); else tmp = Float64(Float64(y_46_re * log(hypot(x_46_im, x_46_re))) + 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 <= -5.2) || ~((y_46_re <= 2.7e-5))) tmp = 1.0 + log((x_46_re ^ y_46_re)); else tmp = (y_46_re * log(hypot(x_46_im, x_46_re))) + 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, -5.2], N[Not[LessEqual[y$46$re, 2.7e-5]], $MachinePrecision]], N[(1.0 + N[Log[N[Power[x$46$re, y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5.2 \lor \neg \left(y.re \leq 2.7 \cdot 10^{-5}\right):\\
\;\;\;\;1 + \log \left({x.re}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) + 1\\
\end{array}
\end{array}
if y.re < -5.20000000000000018 or 2.6999999999999999e-5 < y.re Initial program 47.2%
fmm-def47.2%
hypot-define47.2%
distribute-rgt-neg-out47.2%
fma-define47.2%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around 0 74.6%
unpow274.6%
unpow274.6%
hypot-undefine74.6%
Simplified74.6%
Taylor expanded in x.re around inf 37.8%
associate-*r*37.8%
exp-prod37.8%
mul-1-neg37.8%
log-rec37.8%
Simplified37.8%
Taylor expanded in y.re around 0 1.6%
add-log-exp21.2%
*-commutative21.2%
exp-to-pow29.6%
Applied egg-rr29.6%
if -5.20000000000000018 < y.re < 2.6999999999999999e-5Initial program 47.6%
fmm-def47.6%
hypot-define47.6%
distribute-rgt-neg-out47.6%
fma-define47.6%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y.im around 0 45.3%
unpow245.3%
unpow245.3%
hypot-undefine53.3%
Simplified53.3%
Taylor expanded in y.re around 0 40.3%
unpow240.3%
unpow240.3%
hypot-undefine52.1%
Simplified52.1%
Final simplification41.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.75) (not (<= y.re 3.3e-11))) (+ 1.0 (log (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 <= -1.75) || !(y_46_re <= 3.3e-11)) {
tmp = 1.0 + log(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 <= (-1.75d0)) .or. (.not. (y_46re <= 3.3d-11))) then
tmp = 1.0d0 + log((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 <= -1.75) || !(y_46_re <= 3.3e-11)) {
tmp = 1.0 + Math.log(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 <= -1.75) or not (y_46_re <= 3.3e-11): tmp = 1.0 + math.log(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 <= -1.75) || !(y_46_re <= 3.3e-11)) tmp = Float64(1.0 + log((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 <= -1.75) || ~((y_46_re <= 3.3e-11))) tmp = 1.0 + log((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, -1.75], N[Not[LessEqual[y$46$re, 3.3e-11]], $MachinePrecision]], N[(1.0 + N[Log[N[Power[x$46$re, y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.75 \lor \neg \left(y.re \leq 3.3 \cdot 10^{-11}\right):\\
\;\;\;\;1 + \log \left({x.re}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y.re < -1.75 or 3.3000000000000002e-11 < y.re Initial program 47.4%
fmm-def47.4%
hypot-define47.4%
distribute-rgt-neg-out47.4%
fma-define47.4%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around 0 73.8%
unpow273.8%
unpow273.8%
hypot-undefine74.6%
Simplified74.6%
Taylor expanded in x.re around inf 38.5%
associate-*r*38.5%
exp-prod38.4%
mul-1-neg38.4%
log-rec38.4%
Simplified38.4%
Taylor expanded in y.re around 0 3.2%
add-log-exp22.2%
*-commutative22.2%
exp-to-pow30.4%
Applied egg-rr30.4%
if -1.75 < y.re < 3.3000000000000002e-11Initial program 47.4%
fmm-def47.4%
hypot-define47.4%
distribute-rgt-neg-out47.4%
fma-define47.4%
hypot-define85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in y.im around 0 45.2%
unpow245.2%
unpow245.2%
hypot-undefine52.6%
Simplified52.6%
Taylor expanded in y.re around 0 51.7%
Final simplification40.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -2e+28) (+ 1.0 (* y.re (log1p (+ x.re -1.0)))) 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_im <= -2e+28) {
tmp = 1.0 + (y_46_re * log1p((x_46_re + -1.0)));
} else {
tmp = 1.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_im <= -2e+28) {
tmp = 1.0 + (y_46_re * Math.log1p((x_46_re + -1.0)));
} 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_im <= -2e+28: tmp = 1.0 + (y_46_re * math.log1p((x_46_re + -1.0))) 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_im <= -2e+28) tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(x_46_re + -1.0)))); else tmp = 1.0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -2e+28], N[(1.0 + N[(y$46$re * N[Log[1 + N[(x$46$re + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2 \cdot 10^{+28}:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(x.re + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y.im < -1.99999999999999992e28Initial program 46.9%
fmm-def46.9%
hypot-define46.9%
distribute-rgt-neg-out46.9%
fma-define46.9%
hypot-define69.6%
*-commutative69.6%
Simplified69.6%
Taylor expanded in y.im around 0 40.8%
unpow240.8%
unpow240.8%
hypot-undefine25.8%
Simplified25.8%
Taylor expanded in x.re around inf 16.0%
associate-*r*16.0%
exp-prod17.1%
mul-1-neg17.1%
log-rec17.1%
Simplified17.1%
Taylor expanded in y.re around 0 1.2%
log1p-expm1-u9.3%
expm1-undefine9.3%
add-exp-log18.1%
Applied egg-rr18.1%
if -1.99999999999999992e28 < y.im Initial program 47.6%
fmm-def47.6%
hypot-define47.6%
distribute-rgt-neg-out47.6%
fma-define47.6%
hypot-define87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in y.im around 0 65.1%
unpow265.1%
unpow265.1%
hypot-undefine74.8%
Simplified74.8%
Taylor expanded in y.re around 0 34.9%
Final simplification31.1%
(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 47.4%
fmm-def47.4%
hypot-define47.4%
distribute-rgt-neg-out47.4%
fma-define47.4%
hypot-define83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in y.im around 0 59.6%
unpow259.6%
unpow259.6%
hypot-undefine63.7%
Simplified63.7%
Taylor expanded in y.re around 0 27.5%
herbie shell --seed 2024177
(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)))))