
(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 17 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 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (hypot x.im x.re)))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))))
(if (<= y.re -1.16e-5)
(* t_3 (cos t_1))
(if (<= y.re 3600.0)
(*
(cos (+ t_1 (* y.im (pow (cbrt (log (hypot x.re x.im))) 3.0))))
(exp (- (* y.re (fabs t_2)) t_0)))
(* t_3 (cos (* y.im t_2)))))))
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 t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(hypot(x_46_im, x_46_re));
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double tmp;
if (y_46_re <= -1.16e-5) {
tmp = t_3 * cos(t_1);
} else if (y_46_re <= 3600.0) {
tmp = cos((t_1 + (y_46_im * pow(cbrt(log(hypot(x_46_re, x_46_im))), 3.0)))) * exp(((y_46_re * fabs(t_2)) - t_0));
} else {
tmp = t_3 * cos((y_46_im * t_2));
}
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 t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_3 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double tmp;
if (y_46_re <= -1.16e-5) {
tmp = t_3 * Math.cos(t_1);
} else if (y_46_re <= 3600.0) {
tmp = Math.cos((t_1 + (y_46_im * Math.pow(Math.cbrt(Math.log(Math.hypot(x_46_re, x_46_im))), 3.0)))) * Math.exp(((y_46_re * Math.abs(t_2)) - t_0));
} else {
tmp = t_3 * Math.cos((y_46_im * t_2));
}
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) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(hypot(x_46_im, x_46_re)) t_3 = 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)) tmp = 0.0 if (y_46_re <= -1.16e-5) tmp = Float64(t_3 * cos(t_1)); elseif (y_46_re <= 3600.0) tmp = Float64(cos(Float64(t_1 + Float64(y_46_im * (cbrt(log(hypot(x_46_re, x_46_im))) ^ 3.0)))) * exp(Float64(Float64(y_46_re * abs(t_2)) - t_0))); else tmp = Float64(t_3 * cos(Float64(y_46_im * t_2))); end return 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]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = 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]}, If[LessEqual[y$46$re, -1.16e-5], N[(t$95$3 * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3600.0], N[(N[Cos[N[(t$95$1 + N[(y$46$im * N[Power[N[Power[N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Abs[t$95$2], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Cos[N[(y$46$im * t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
\mathbf{if}\;y.re \leq -1.16 \cdot 10^{-5}:\\
\;\;\;\;t\_3 \cdot \cos t\_1\\
\mathbf{elif}\;y.re \leq 3600:\\
\;\;\;\;\cos \left(t\_1 + y.im \cdot {\left(\sqrt[3]{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right)}^{3}\right) \cdot e^{y.re \cdot \left|t\_2\right| - t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \cos \left(y.im \cdot t\_2\right)\\
\end{array}
\end{array}
if y.re < -1.1600000000000001e-5Initial program 38.2%
Taylor expanded in y.im around 0 84.8%
if -1.1600000000000001e-5 < y.re < 3600Initial program 50.5%
hypot-define50.5%
add-sqr-sqrt28.7%
sqrt-unprod50.5%
pow250.5%
Applied egg-rr50.5%
hypot-undefine50.5%
unpow250.5%
unpow250.5%
+-commutative50.5%
unpow250.5%
rem-sqrt-square50.5%
unpow250.5%
unpow250.5%
hypot-undefine50.5%
Simplified50.5%
hypot-define90.0%
add-cube-cbrt90.7%
pow391.5%
Applied egg-rr91.5%
if 3600 < y.re Initial program 35.4%
Taylor expanded in y.re around 0 44.6%
*-commutative44.6%
unpow244.6%
unpow244.6%
hypot-undefine78.5%
Simplified78.5%
Final simplification86.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= y.re 9.5e-35)
(*
(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 <= 9.5e-35) {
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 <= 9.5e-35) 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, 9.5e-35], 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 9.5 \cdot 10^{-35}:\\
\;\;\;\;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 < 9.5000000000000003e-35Initial program 46.4%
fmm-def46.4%
hypot-define46.4%
distribute-rgt-neg-out46.4%
fma-define46.4%
hypot-define87.5%
*-commutative87.5%
Simplified87.5%
if 9.5000000000000003e-35 < y.re Initial program 37.1%
Taylor expanded in y.re around 0 45.7%
*-commutative45.7%
unpow245.7%
unpow245.7%
hypot-undefine78.6%
Simplified78.6%
Final simplification85.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))
(t_2 (log (hypot x.im x.re)))
(t_3 (cos (* y.im t_2))))
(if (<= y.re -0.175)
(* t_1 (cos (* y.re (atan2 x.im x.re))))
(if (<= y.re 7.6e+81)
(* t_3 (exp (- (* y.re (fabs t_2)) t_0)))
(* t_1 t_3)))))
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 t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double t_2 = log(hypot(x_46_im, x_46_re));
double t_3 = cos((y_46_im * t_2));
double tmp;
if (y_46_re <= -0.175) {
tmp = t_1 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 7.6e+81) {
tmp = t_3 * exp(((y_46_re * fabs(t_2)) - t_0));
} else {
tmp = t_1 * t_3;
}
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 t_1 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double t_2 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_3 = Math.cos((y_46_im * t_2));
double tmp;
if (y_46_re <= -0.175) {
tmp = t_1 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 7.6e+81) {
tmp = t_3 * Math.exp(((y_46_re * Math.abs(t_2)) - t_0));
} else {
tmp = t_1 * t_3;
}
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 t_1 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) t_2 = math.log(math.hypot(x_46_im, x_46_re)) t_3 = math.cos((y_46_im * t_2)) tmp = 0 if y_46_re <= -0.175: tmp = t_1 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 7.6e+81: tmp = t_3 * math.exp(((y_46_re * math.fabs(t_2)) - t_0)) else: tmp = t_1 * t_3 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) 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))))) - t_0)) t_2 = log(hypot(x_46_im, x_46_re)) t_3 = cos(Float64(y_46_im * t_2)) tmp = 0.0 if (y_46_re <= -0.175) tmp = Float64(t_1 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 7.6e+81) tmp = Float64(t_3 * exp(Float64(Float64(y_46_re * abs(t_2)) - t_0))); else tmp = Float64(t_1 * t_3); 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; t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)); t_2 = log(hypot(x_46_im, x_46_re)); t_3 = cos((y_46_im * t_2)); tmp = 0.0; if (y_46_re <= -0.175) tmp = t_1 * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 7.6e+81) tmp = t_3 * exp(((y_46_re * abs(t_2)) - t_0)); else tmp = t_1 * t_3; 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]}, 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] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(y$46$im * t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.175], N[(t$95$1 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.6e+81], N[(t$95$3 * N[Exp[N[(N[(y$46$re * N[Abs[t$95$2], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$3), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_3 := \cos \left(y.im \cdot t\_2\right)\\
\mathbf{if}\;y.re \leq -0.175:\\
\;\;\;\;t\_1 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 7.6 \cdot 10^{+81}:\\
\;\;\;\;t\_3 \cdot e^{y.re \cdot \left|t\_2\right| - t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_3\\
\end{array}
\end{array}
if y.re < -0.17499999999999999Initial program 37.5%
Taylor expanded in y.im around 0 85.8%
if -0.17499999999999999 < y.re < 7.599999999999999e81Initial program 47.6%
hypot-define47.6%
add-sqr-sqrt28.0%
sqrt-unprod47.6%
pow247.6%
Applied egg-rr47.6%
hypot-undefine47.6%
unpow247.6%
unpow247.6%
+-commutative47.6%
unpow247.6%
rem-sqrt-square47.6%
unpow247.6%
unpow247.6%
hypot-undefine47.6%
Simplified47.6%
Taylor expanded in y.re around 0 48.9%
*-commutative48.9%
unpow248.9%
unpow248.9%
hypot-undefine62.0%
Simplified88.2%
if 7.599999999999999e81 < y.re Initial program 39.1%
Taylor expanded in y.re around 0 47.8%
*-commutative47.8%
unpow247.8%
unpow247.8%
hypot-undefine80.4%
Simplified80.4%
Final simplification86.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -2150000000000.0)
(* t_1 (cos t_0))
(if (<= y.re 7400000000.0)
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_1 (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 = 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))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -2150000000000.0) {
tmp = t_1 * cos(t_0);
} else if (y_46_re <= 7400000000.0) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_1 * 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 = 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(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -2150000000000.0) tmp = Float64(t_1 * cos(t_0)); elseif (y_46_re <= 7400000000.0) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_1 * 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2150000000000.0], N[(t$95$1 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7400000000.0], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := 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 -2150000000000:\\
\;\;\;\;t\_1 \cdot \cos t\_0\\
\mathbf{elif}\;y.re \leq 7400000000:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \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.15e12Initial program 37.7%
Taylor expanded in y.im around 0 86.9%
if -2.15e12 < y.re < 7.4e9Initial program 49.9%
fmm-def49.9%
hypot-define49.9%
distribute-rgt-neg-out49.9%
fma-define49.9%
hypot-define89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in y.re around 0 88.6%
neg-mul-188.6%
distribute-rgt-neg-in88.6%
Simplified88.6%
if 7.4e9 < y.re Initial program 35.5%
Taylor expanded in y.re around 0 45.2%
*-commutative45.2%
unpow245.2%
unpow245.2%
hypot-undefine79.1%
Simplified79.1%
Final simplification85.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (cos t_0)))
(if (<= y.re -2150000000000.0)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
t_1)
(if (<= y.re 12200000000.0)
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(pow
(pow (* t_1 (pow (hypot x.im x.re) y.re)) 3.0)
0.3333333333333333)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = cos(t_0);
double tmp;
if (y_46_re <= -2150000000000.0) {
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))) * t_1;
} else if (y_46_re <= 12200000000.0) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(pow((t_1 * pow(hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = cos(t_0) tmp = 0.0 if (y_46_re <= -2150000000000.0) 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))) * t_1); elseif (y_46_re <= 12200000000.0) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = (Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -2150000000000.0], 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] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 12200000000.0], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \cos t\_0\\
\mathbf{if}\;y.re \leq -2150000000000:\\
\;\;\;\;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 t\_1\\
\mathbf{elif}\;y.re \leq 12200000000:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.re < -2.15e12Initial program 37.7%
Taylor expanded in y.im around 0 86.9%
if -2.15e12 < y.re < 1.22e10Initial program 49.9%
fmm-def49.9%
hypot-define49.9%
distribute-rgt-neg-out49.9%
fma-define49.9%
hypot-define89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in y.re around 0 88.6%
neg-mul-188.6%
distribute-rgt-neg-in88.6%
Simplified88.6%
if 1.22e10 < y.re Initial program 35.5%
fmm-def35.5%
hypot-define35.5%
distribute-rgt-neg-out35.5%
fma-define35.5%
hypot-define61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in y.im around 0 51.7%
unpow251.7%
unpow251.7%
hypot-undefine51.7%
Simplified51.7%
add-cbrt-cube51.7%
pow1/369.5%
pow369.5%
Applied egg-rr69.5%
Final simplification83.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -0.00043)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
t_0)
(if (<= y.re 7400000000.0)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(pow
(pow (* t_0 (pow (hypot x.im x.re) y.re)) 3.0)
0.3333333333333333)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -0.00043) {
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))) * t_0;
} else if (y_46_re <= 7400000000.0) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(pow((t_0 * pow(hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -0.00043) {
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))) * t_0;
} else if (y_46_re <= 7400000000.0) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(Math.pow((t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -0.00043: 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))) * t_0 elif y_46_re <= 7400000000.0: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(math.pow((t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -0.00043) 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))) * t_0); elseif (y_46_re <= 7400000000.0) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = (Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -0.00043) 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))) * t_0; elseif (y_46_re <= 7400000000.0) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = ((t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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.00043], 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] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 7400000000.0], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -0.00043:\\
\;\;\;\;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 t\_0\\
\mathbf{elif}\;y.re \leq 7400000000:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.re < -4.29999999999999989e-4Initial program 37.5%
Taylor expanded in y.im around 0 85.8%
if -4.29999999999999989e-4 < y.re < 7.4e9Initial program 50.3%
fmm-def50.3%
hypot-define50.3%
distribute-rgt-neg-out50.3%
fma-define50.3%
hypot-define89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in y.re around 0 50.3%
*-commutative50.3%
unpow250.3%
unpow250.3%
hypot-undefine89.0%
neg-mul-189.0%
distribute-rgt-neg-in89.0%
Simplified89.0%
if 7.4e9 < y.re Initial program 35.5%
fmm-def35.5%
hypot-define35.5%
distribute-rgt-neg-out35.5%
fma-define35.5%
hypot-define61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in y.im around 0 51.7%
unpow251.7%
unpow251.7%
hypot-undefine51.7%
Simplified51.7%
add-cbrt-cube51.7%
pow1/369.5%
pow369.5%
Applied egg-rr69.5%
Final simplification83.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -3.4e+39) (not (<= y.re 1e+77)))
(pow
(pow (* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)) 3.0)
0.3333333333333333)
(exp
(- (* y.re (fabs (log (hypot x.im x.re)))) (* (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 <= -3.4e+39) || !(y_46_re <= 1e+77)) {
tmp = pow(pow((cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333);
} else {
tmp = exp(((y_46_re * fabs(log(hypot(x_46_im, x_46_re)))) - (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 <= -3.4e+39) || !(y_46_re <= 1e+77)) {
tmp = Math.pow(Math.pow((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)), 3.0), 0.3333333333333333);
} else {
tmp = Math.exp(((y_46_re * Math.abs(Math.log(Math.hypot(x_46_im, x_46_re)))) - (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 <= -3.4e+39) or not (y_46_re <= 1e+77): tmp = math.pow(math.pow((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)), 3.0), 0.3333333333333333) else: tmp = math.exp(((y_46_re * math.fabs(math.log(math.hypot(x_46_im, x_46_re)))) - (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 <= -3.4e+39) || !(y_46_re <= 1e+77)) tmp = (Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; else tmp = exp(Float64(Float64(y_46_re * abs(log(hypot(x_46_im, x_46_re)))) - Float64(atan(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.4e+39) || ~((y_46_re <= 1e+77))) tmp = ((cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; else tmp = exp(((y_46_re * abs(log(hypot(x_46_im, x_46_re)))) - (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, -3.4e+39], N[Not[LessEqual[y$46$re, 1e+77]], $MachinePrecision]], N[Power[N[Power[N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Abs[N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 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 -3.4 \cdot 10^{+39} \lor \neg \left(y.re \leq 10^{+77}\right):\\
\;\;\;\;{\left({\left(\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}\right)}^{3}\right)}^{0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \left|\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right| - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if y.re < -3.3999999999999999e39 or 9.99999999999999983e76 < y.re Initial program 36.2%
fmm-def36.2%
hypot-define36.2%
distribute-rgt-neg-out36.2%
fma-define36.2%
hypot-define71.3%
*-commutative71.3%
Simplified71.3%
Taylor expanded in y.im around 0 68.2%
unpow268.2%
unpow268.2%
hypot-undefine68.2%
Simplified68.2%
add-cbrt-cube68.2%
pow1/378.8%
pow378.8%
Applied egg-rr78.8%
if -3.3999999999999999e39 < y.re < 9.99999999999999983e76Initial program 48.4%
hypot-define48.4%
add-sqr-sqrt27.9%
sqrt-unprod48.4%
pow248.4%
Applied egg-rr48.4%
hypot-undefine48.4%
unpow248.4%
unpow248.4%
+-commutative48.4%
unpow248.4%
rem-sqrt-square48.4%
unpow248.4%
unpow248.4%
hypot-undefine48.4%
Simplified48.4%
Taylor expanded in y.re around 0 49.6%
*-commutative49.6%
unpow249.6%
unpow249.6%
hypot-undefine61.5%
Simplified86.9%
expm1-log1p-u86.9%
expm1-undefine86.9%
*-commutative86.9%
Applied egg-rr86.9%
Taylor expanded in y.im around 0 85.7%
Final simplification83.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -9.6e+66)
(*
(pow (hypot x.im x.re) y.re)
(cos (pow (cbrt (* y.re (atan2 x.im x.re))) 3.0)))
(exp
(- (* y.re (fabs (log (hypot x.im x.re)))) (* (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 <= -9.6e+66) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * cos(pow(cbrt((y_46_re * atan2(x_46_im, x_46_re))), 3.0));
} else {
tmp = exp(((y_46_re * fabs(log(hypot(x_46_im, x_46_re)))) - (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 <= -9.6e+66) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos(Math.pow(Math.cbrt((y_46_re * Math.atan2(x_46_im, x_46_re))), 3.0));
} else {
tmp = Math.exp(((y_46_re * Math.abs(Math.log(Math.hypot(x_46_im, x_46_re)))) - (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 <= -9.6e+66) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos((cbrt(Float64(y_46_re * atan(x_46_im, x_46_re))) ^ 3.0))); else tmp = exp(Float64(Float64(y_46_re * abs(log(hypot(x_46_im, x_46_re)))) - Float64(atan(x_46_im, x_46_re) * y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -9.6e+66], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Abs[N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 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 -9.6 \cdot 10^{+66}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left({\left(\sqrt[3]{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \left|\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right| - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if y.re < -9.6000000000000007e66Initial program 36.4%
fmm-def36.4%
hypot-define36.4%
distribute-rgt-neg-out36.4%
fma-define36.4%
hypot-define84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in y.im around 0 84.2%
unpow284.2%
unpow284.2%
hypot-undefine84.2%
Simplified84.2%
add-cube-cbrt86.5%
pow386.5%
Applied egg-rr86.5%
if -9.6000000000000007e66 < y.re Initial program 45.5%
hypot-define45.5%
add-sqr-sqrt25.6%
sqrt-unprod42.7%
pow242.7%
Applied egg-rr42.7%
hypot-undefine42.7%
unpow242.7%
unpow242.7%
+-commutative42.7%
unpow242.7%
rem-sqrt-square42.7%
unpow242.7%
unpow242.7%
hypot-undefine42.7%
Simplified42.7%
Taylor expanded in y.re around 0 45.5%
*-commutative48.3%
unpow248.3%
unpow248.3%
hypot-undefine65.9%
Simplified81.1%
expm1-log1p-u81.1%
expm1-undefine81.1%
*-commutative81.1%
Applied egg-rr81.1%
Taylor expanded in y.im around 0 78.8%
Final simplification80.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -2150000000000.0) (not (<= y.re 34000000000000.0)))
(* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2150000000000.0) || !(y_46_re <= 34000000000000.0)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2150000000000.0) || !(y_46_re <= 34000000000000.0)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -2150000000000.0) or not (y_46_re <= 34000000000000.0): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -2150000000000.0) || !(y_46_re <= 34000000000000.0)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -2150000000000.0) || ~((y_46_re <= 34000000000000.0))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2150000000000.0], N[Not[LessEqual[y$46$re, 34000000000000.0]], $MachinePrecision]], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2150000000000 \lor \neg \left(y.re \leq 34000000000000\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -2.15e12 or 3.4e13 < y.re Initial program 36.5%
fmm-def36.5%
hypot-define36.5%
distribute-rgt-neg-out36.5%
fma-define36.5%
hypot-define70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in y.im around 0 63.7%
unpow263.7%
unpow263.7%
hypot-undefine63.7%
Simplified63.7%
if -2.15e12 < y.re < 3.4e13Initial program 49.9%
fmm-def49.9%
hypot-define49.9%
distribute-rgt-neg-out49.9%
fma-define49.9%
hypot-define89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in y.re around 0 49.9%
*-commutative49.9%
unpow249.9%
unpow249.9%
hypot-undefine88.5%
neg-mul-188.5%
distribute-rgt-neg-in88.5%
Simplified88.5%
Final simplification77.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -4e+39)
(* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(exp
(- (* y.re (fabs (log (hypot x.im x.re)))) (* (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 <= -4e+39) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = exp(((y_46_re * fabs(log(hypot(x_46_im, x_46_re)))) - (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 <= -4e+39) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.exp(((y_46_re * Math.abs(Math.log(Math.hypot(x_46_im, x_46_re)))) - (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 <= -4e+39: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.exp(((y_46_re * math.fabs(math.log(math.hypot(x_46_im, x_46_re)))) - (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 <= -4e+39) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = exp(Float64(Float64(y_46_re * abs(log(hypot(x_46_im, x_46_re)))) - Float64(atan(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 <= -4e+39) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = exp(((y_46_re * abs(log(hypot(x_46_im, x_46_re)))) - (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[LessEqual[y$46$re, -4e+39], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Abs[N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 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 \cdot 10^{+39}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \left|\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right| - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if y.re < -3.99999999999999976e39Initial program 34.8%
fmm-def34.8%
hypot-define34.8%
distribute-rgt-neg-out34.8%
fma-define34.8%
hypot-define84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in y.im around 0 84.9%
unpow284.9%
unpow284.9%
hypot-undefine84.9%
Simplified84.9%
if -3.99999999999999976e39 < y.re Initial program 45.9%
hypot-define45.9%
add-sqr-sqrt25.8%
sqrt-unprod43.1%
pow243.1%
Applied egg-rr43.1%
hypot-undefine43.1%
unpow243.1%
unpow243.1%
+-commutative43.1%
unpow243.1%
rem-sqrt-square43.1%
unpow243.1%
unpow243.1%
hypot-undefine43.1%
Simplified43.1%
Taylor expanded in y.re around 0 45.9%
*-commutative48.7%
unpow248.7%
unpow248.7%
hypot-undefine65.5%
Simplified81.4%
expm1-log1p-u81.4%
expm1-undefine81.4%
*-commutative81.4%
Applied egg-rr81.4%
Taylor expanded in y.im around 0 79.0%
Final simplification80.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= x.re -5.8e-64) (not (<= x.re 2.95e+25))) (pow (exp y.re) (fabs (log (hypot x.im x.re)))) (* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((x_46_re <= -5.8e-64) || !(x_46_re <= 2.95e+25)) {
tmp = pow(exp(y_46_re), fabs(log(hypot(x_46_im, x_46_re))));
} else {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((x_46_re <= -5.8e-64) || !(x_46_re <= 2.95e+25)) {
tmp = Math.pow(Math.exp(y_46_re), Math.abs(Math.log(Math.hypot(x_46_im, x_46_re))));
} else {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (x_46_re <= -5.8e-64) or not (x_46_re <= 2.95e+25): tmp = math.pow(math.exp(y_46_re), math.fabs(math.log(math.hypot(x_46_im, x_46_re)))) else: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((x_46_re <= -5.8e-64) || !(x_46_re <= 2.95e+25)) tmp = exp(y_46_re) ^ abs(log(hypot(x_46_im, x_46_re))); else tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((x_46_re <= -5.8e-64) || ~((x_46_re <= 2.95e+25))) tmp = exp(y_46_re) ^ abs(log(hypot(x_46_im, x_46_re))); else tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[x$46$re, -5.8e-64], N[Not[LessEqual[x$46$re, 2.95e+25]], $MachinePrecision]], N[Power[N[Exp[y$46$re], $MachinePrecision], N[Abs[N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -5.8 \cdot 10^{-64} \lor \neg \left(x.re \leq 2.95 \cdot 10^{+25}\right):\\
\;\;\;\;{\left(e^{y.re}\right)}^{\left(\left|\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right|\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if x.re < -5.7999999999999998e-64 or 2.95e25 < x.re Initial program 32.7%
hypot-define32.7%
add-sqr-sqrt30.5%
sqrt-unprod32.7%
pow232.7%
Applied egg-rr32.7%
hypot-undefine32.7%
unpow232.7%
unpow232.7%
+-commutative32.7%
unpow232.7%
rem-sqrt-square32.7%
unpow232.7%
unpow232.7%
hypot-undefine32.7%
Simplified32.7%
Taylor expanded in y.re around 0 34.2%
*-commutative35.0%
unpow235.0%
unpow235.0%
hypot-undefine61.6%
Simplified85.2%
expm1-log1p-u85.2%
expm1-undefine85.2%
*-commutative85.2%
Applied egg-rr85.2%
Taylor expanded in y.im around 0 57.1%
exp-prod65.9%
unpow265.9%
unpow265.9%
hypot-undefine65.9%
Simplified65.9%
if -5.7999999999999998e-64 < x.re < 2.95e25Initial program 56.3%
fmm-def56.3%
hypot-define56.3%
distribute-rgt-neg-out56.3%
fma-define56.3%
hypot-define82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in y.im around 0 55.7%
unpow255.7%
unpow255.7%
hypot-undefine55.9%
Simplified55.9%
Final simplification61.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.im -65000000000000.0)
(* -0.5 (* t_1 (pow t_0 2.0)))
(* (cos 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -65000000000000.0) {
tmp = -0.5 * (t_1 * pow(t_0, 2.0));
} else {
tmp = cos(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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -65000000000000.0) {
tmp = -0.5 * (t_1 * Math.pow(t_0, 2.0));
} else {
tmp = Math.cos(t_0) * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_im <= -65000000000000.0: tmp = -0.5 * (t_1 * math.pow(t_0, 2.0)) else: tmp = math.cos(t_0) * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_im <= -65000000000000.0) tmp = Float64(-0.5 * Float64(t_1 * (t_0 ^ 2.0))); else tmp = Float64(cos(t_0) * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_im <= -65000000000000.0) tmp = -0.5 * (t_1 * (t_0 ^ 2.0)); else tmp = cos(t_0) * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$im, -65000000000000.0], N[(-0.5 * N[(t$95$1 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -65000000000000:\\
\;\;\;\;-0.5 \cdot \left(t\_1 \cdot {t\_0}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos t\_0 \cdot t\_1\\
\end{array}
\end{array}
if y.im < -6.5e13Initial program 32.5%
fmm-def32.5%
hypot-define32.5%
distribute-rgt-neg-out32.5%
fma-define32.5%
hypot-define77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in y.im around 0 42.6%
unpow242.6%
unpow242.6%
hypot-undefine29.0%
Simplified29.0%
Taylor expanded in y.re around 0 18.3%
Taylor expanded in y.re around inf 34.7%
associate-*r*32.9%
unpow232.9%
unpow232.9%
swap-sqr32.9%
unpow232.9%
unpow232.9%
unpow232.9%
hypot-undefine36.8%
Simplified36.8%
if -6.5e13 < y.im Initial program 47.1%
fmm-def47.1%
hypot-define47.1%
distribute-rgt-neg-out47.1%
fma-define47.1%
hypot-define81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in y.im around 0 55.4%
unpow255.4%
unpow255.4%
hypot-undefine65.2%
Simplified65.2%
Final simplification59.0%
(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 43.9%
fmm-def43.9%
hypot-define43.9%
distribute-rgt-neg-out43.9%
fma-define43.9%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around 0 52.6%
unpow252.6%
unpow252.6%
hypot-undefine57.3%
Simplified57.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -11200000000000.0) (not (<= y.re 1900000.0))) (* (cos (* y.re (atan2 x.im x.re))) (pow x.re y.re)) (+ 1.0 (* y.re (log (hypot x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -11200000000000.0) || !(y_46_re <= 1900000.0)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_re, y_46_re);
} else {
tmp = 1.0 + (y_46_re * log(hypot(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -11200000000000.0) || !(y_46_re <= 1900000.0)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_re, y_46_re);
} else {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -11200000000000.0) or not (y_46_re <= 1900000.0): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_re, y_46_re) else: tmp = 1.0 + (y_46_re * math.log(math.hypot(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -11200000000000.0) || !(y_46_re <= 1900000.0)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_re ^ y_46_re)); else tmp = Float64(1.0 + Float64(y_46_re * log(hypot(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) tmp = 0.0; if ((y_46_re <= -11200000000000.0) || ~((y_46_re <= 1900000.0))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_re ^ y_46_re); else tmp = 1.0 + (y_46_re * log(hypot(x_46_im, x_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$re, -11200000000000.0], N[Not[LessEqual[y$46$re, 1900000.0]], $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[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -11200000000000 \lor \neg \left(y.re \leq 1900000\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\end{array}
\end{array}
if y.re < -1.12e13 or 1.9e6 < y.re Initial program 36.2%
fmm-def36.2%
hypot-define36.2%
distribute-rgt-neg-out36.2%
fma-define36.2%
hypot-define69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in y.im around 0 62.3%
unpow262.3%
unpow262.3%
hypot-undefine62.3%
Simplified62.3%
Taylor expanded in x.im around 0 53.9%
if -1.12e13 < y.re < 1.9e6Initial program 50.3%
fmm-def50.3%
hypot-define50.3%
distribute-rgt-neg-out50.3%
fma-define50.3%
hypot-define89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in y.im around 0 44.5%
unpow244.5%
unpow244.5%
hypot-undefine53.1%
Simplified53.1%
Taylor expanded in y.re around 0 38.6%
unpow238.6%
unpow238.6%
hypot-undefine51.8%
Simplified51.8%
Final simplification52.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -0.0015) (not (<= y.re 20500000.0))) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (+ 1.0 (* y.re (log (hypot x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -0.0015) || !(y_46_re <= 20500000.0)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + (y_46_re * log(hypot(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -0.0015) || !(y_46_re <= 20500000.0)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -0.0015) or not (y_46_re <= 20500000.0): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) else: tmp = 1.0 + (y_46_re * math.log(math.hypot(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -0.0015) || !(y_46_re <= 20500000.0)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = Float64(1.0 + Float64(y_46_re * log(hypot(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) tmp = 0.0; if ((y_46_re <= -0.0015) || ~((y_46_re <= 20500000.0))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = 1.0 + (y_46_re * log(hypot(x_46_im, x_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$re, -0.0015], N[Not[LessEqual[y$46$re, 20500000.0]], $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[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.0015 \lor \neg \left(y.re \leq 20500000\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\end{array}
\end{array}
if y.re < -0.0015 or 2.05e7 < y.re Initial program 36.1%
fmm-def36.1%
hypot-define36.1%
distribute-rgt-neg-out36.1%
fma-define36.1%
hypot-define70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in y.im around 0 62.4%
unpow262.4%
unpow262.4%
hypot-undefine62.4%
Simplified62.4%
Taylor expanded in x.re around 0 45.9%
if -0.0015 < y.re < 2.05e7Initial program 50.6%
fmm-def50.6%
hypot-define50.6%
distribute-rgt-neg-out50.6%
fma-define50.6%
hypot-define89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in y.im around 0 44.0%
unpow244.0%
unpow244.0%
hypot-undefine52.8%
Simplified52.8%
Taylor expanded in y.re around 0 38.7%
unpow238.7%
unpow238.7%
hypot-undefine52.8%
Simplified52.8%
Final simplification49.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (* y.re (log (hypot x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + (y_46_re * log(hypot(x_46_im, x_46_re)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + (y_46_re * math.log(math.hypot(x_46_im, x_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + Float64(y_46_re * log(hypot(x_46_im, x_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + (y_46_re * log(hypot(x_46_im, x_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)
\end{array}
Initial program 43.9%
fmm-def43.9%
hypot-define43.9%
distribute-rgt-neg-out43.9%
fma-define43.9%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around 0 52.6%
unpow252.6%
unpow252.6%
hypot-undefine57.3%
Simplified57.3%
Taylor expanded in y.re around 0 29.4%
unpow229.4%
unpow229.4%
hypot-undefine30.0%
Simplified30.0%
(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 43.9%
fmm-def43.9%
hypot-define43.9%
distribute-rgt-neg-out43.9%
fma-define43.9%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around 0 52.6%
unpow252.6%
unpow252.6%
hypot-undefine57.3%
Simplified57.3%
Taylor expanded in y.re around 0 29.5%
herbie shell --seed 2024181
(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)))))