
(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 (* y.re (atan2 x.im x.re))) (t_1 (log (hypot x.re x.im))))
(if (<= y.re 6.5e+14)
(*
(exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_1 y.im t_0)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(fabs (cos (fma y.im (log (hypot x.im x.re)) t_0)))))))
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 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 6.5e+14) {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_1, y_46_im, t_0));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * fabs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)));
}
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 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 6.5e+14) tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_1, y_46_im, t_0))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * abs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)))); 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 6.5e+14], N[(N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 6.5 \cdot 10^{+14}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_1, y.im, t\_0\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 \left|\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right)\right|\\
\end{array}
\end{array}
if y.re < 6.5e14Initial program 42.3%
cancel-sign-sub-inv42.3%
fma-define42.3%
hypot-define42.3%
distribute-lft-neg-in42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define85.6%
*-commutative85.6%
Simplified85.6%
if 6.5e14 < y.re Initial program 34.0%
fma-define34.0%
hypot-define62.0%
*-commutative62.0%
add-sqr-sqrt40.0%
sqrt-unprod80.0%
pow280.0%
Applied egg-rr80.0%
unpow280.0%
rem-sqrt-square80.0%
fma-define80.0%
hypot-undefine44.0%
unpow244.0%
unpow244.0%
+-commutative44.0%
+-commutative44.0%
fma-define44.0%
Simplified80.0%
Final simplification84.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= y.re 2e+21)
(*
(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)))))
(pow (sqrt (+ (pow x.im 2.0) (pow x.re 2.0))) y.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 <= 2e+21) {
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 = pow(sqrt((pow(x_46_im, 2.0) + pow(x_46_re, 2.0))), y_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 <= 2e+21) 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 = sqrt(Float64((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 2e+21], 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[Power[N[Sqrt[N[(N[Power[x$46$im, 2.0], $MachinePrecision] + N[Power[x$46$re, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $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 2 \cdot 10^{+21}:\\
\;\;\;\;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}:\\
\;\;\;\;{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < 2e21Initial program 41.7%
cancel-sign-sub-inv41.7%
fma-define41.7%
hypot-define41.7%
distribute-lft-neg-in41.7%
distribute-rgt-neg-out41.7%
fma-define41.7%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
if 2e21 < y.re Initial program 36.2%
exp-diff34.0%
exp-to-pow34.0%
hypot-define34.0%
*-commutative34.0%
exp-prod34.0%
fma-define34.0%
hypot-define55.3%
*-commutative55.3%
Simplified55.3%
add-cube-cbrt55.3%
pow355.3%
Applied egg-rr55.3%
Taylor expanded in y.re around 0 38.3%
unpow238.3%
unpow238.3%
hypot-undefine66.0%
Simplified66.0%
Taylor expanded in y.im around 0 78.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -3.2e+42)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(cos (* y.re (atan2 x.im x.re))))
(if (<= y.re 7e+14)
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(cos
(*
y.im
(+ (log (hypot x.im x.re)) (* y.re (/ (atan2 x.im x.re) y.im))))))
(pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -3.2e+42) {
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_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 7e+14) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((y_46_im * (log(hypot(x_46_im, x_46_re)) + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -3.2e+42) 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_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 7e+14) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -3.2e+42], 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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7e+14], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.2 \cdot 10^{+42}:\\
\;\;\;\;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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 7 \cdot 10^{+14}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -3.20000000000000002e42Initial program 48.2%
Taylor expanded in y.im around 0 85.8%
if -3.20000000000000002e42 < y.re < 7e14Initial program 40.1%
cancel-sign-sub-inv40.1%
fma-define40.1%
hypot-define40.1%
distribute-lft-neg-in40.1%
distribute-rgt-neg-out40.1%
fma-define40.1%
hypot-define84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in y.im around inf 40.1%
unpow240.1%
unpow240.1%
hypot-undefine84.2%
associate-/l*84.2%
Simplified84.2%
if 7e14 < y.re Initial program 34.0%
exp-diff32.0%
exp-to-pow32.0%
hypot-define32.0%
*-commutative32.0%
exp-prod32.0%
fma-define32.0%
hypot-define56.0%
*-commutative56.0%
Simplified56.0%
add-cube-cbrt56.0%
pow356.0%
Applied egg-rr56.0%
Taylor expanded in y.re around 0 36.0%
unpow236.0%
unpow236.0%
hypot-undefine66.0%
Simplified66.0%
Taylor expanded in y.im around 0 78.1%
unpow278.1%
unpow278.1%
hypot-undefine78.1%
Simplified78.1%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -3e+42)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(cos (* y.re (atan2 x.im x.re))))
(if (<= y.re 2.15e+14)
(*
(cos
(*
y.im
(+ (log (hypot x.im x.re)) (* y.re (/ (atan2 x.im x.re) y.im)))))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (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 (y_46_re <= -3e+42) {
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_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 2.15e+14) {
tmp = cos((y_46_im * (log(hypot(x_46_im, x_46_re)) + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im))))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -3e+42) {
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))) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 2.15e+14) {
tmp = Math.cos((y_46_im * (Math.log(Math.hypot(x_46_im, x_46_re)) + (y_46_re * (Math.atan2(x_46_im, x_46_re) / y_46_im))))) * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -3e+42: 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))) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 2.15e+14: tmp = math.cos((y_46_im * (math.log(math.hypot(x_46_im, x_46_re)) + (y_46_re * (math.atan2(x_46_im, x_46_re) / y_46_im))))) * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -3e+42) 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_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 2.15e+14) tmp = Float64(cos(Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im))))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -3e+42) 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_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 2.15e+14) tmp = cos((y_46_im * (log(hypot(x_46_im, x_46_re)) + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im))))) * ((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -3e+42], 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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.15e+14], N[(N[Cos[N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3 \cdot 10^{+42}:\\
\;\;\;\;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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 2.15 \cdot 10^{+14}:\\
\;\;\;\;\cos \left(y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -3.00000000000000029e42Initial program 48.2%
Taylor expanded in y.im around 0 85.8%
if -3.00000000000000029e42 < y.re < 2.15e14Initial program 40.1%
exp-diff40.1%
exp-to-pow40.1%
hypot-define40.1%
*-commutative40.1%
exp-prod40.0%
fma-define40.0%
hypot-define83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in y.im around inf 40.0%
unpow240.1%
unpow240.1%
hypot-undefine84.2%
associate-/l*84.2%
Simplified83.3%
if 2.15e14 < y.re Initial program 34.0%
exp-diff32.0%
exp-to-pow32.0%
hypot-define32.0%
*-commutative32.0%
exp-prod32.0%
fma-define32.0%
hypot-define56.0%
*-commutative56.0%
Simplified56.0%
add-cube-cbrt56.0%
pow356.0%
Applied egg-rr56.0%
Taylor expanded in y.re around 0 36.0%
unpow236.0%
unpow236.0%
hypot-undefine66.0%
Simplified66.0%
Taylor expanded in y.im around 0 78.1%
unpow278.1%
unpow278.1%
hypot-undefine78.1%
Simplified78.1%
Final simplification82.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re)))))
(t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -3.8e-11)
(*
(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 0.021)
(fabs (* t_1 (/ t_0 (pow (exp (atan2 x.im x.re)) y.im))))
(pow
(pow (* (cos (* y.re (atan2 x.im x.re))) t_1) 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_im * log(hypot(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_re <= -3.8e-11) {
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 <= 0.021) {
tmp = fabs((t_1 * (t_0 / pow(exp(atan2(x_46_im, x_46_re)), y_46_im))));
} else {
tmp = pow(pow((cos((y_46_re * atan2(x_46_im, x_46_re))) * t_1), 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_im * Math.log(Math.hypot(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_re <= -3.8e-11) {
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 <= 0.021) {
tmp = Math.abs((t_1 * (t_0 / Math.pow(Math.exp(Math.atan2(x_46_im, x_46_re)), y_46_im))));
} else {
tmp = Math.pow(Math.pow((Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * t_1), 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_im * math.log(math.hypot(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_re <= -3.8e-11: 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 <= 0.021: tmp = math.fabs((t_1 * (t_0 / math.pow(math.exp(math.atan2(x_46_im, x_46_re)), y_46_im)))) else: tmp = math.pow(math.pow((math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * t_1), 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_im * log(hypot(x_46_im, x_46_re)))) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -3.8e-11) 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 <= 0.021) tmp = abs(Float64(t_1 * Float64(t_0 / (exp(atan(x_46_im, x_46_re)) ^ y_46_im)))); else tmp = (Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * t_1) ^ 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_im * log(hypot(x_46_im, x_46_re)))); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -3.8e-11) 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 <= 0.021) tmp = abs((t_1 * (t_0 / (exp(atan2(x_46_im, x_46_re)) ^ y_46_im)))); else tmp = ((cos((y_46_re * atan2(x_46_im, x_46_re))) * t_1) ^ 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$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $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$re, -3.8e-11], 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, 0.021], N[Abs[N[(t$95$1 * N[(t$95$0 / N[Power[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision], y$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[Power[N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -3.8 \cdot 10^{-11}:\\
\;\;\;\;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 0.021:\\
\;\;\;\;\left|t\_1 \cdot \frac{t\_0}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}\right|\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_1\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.re < -3.7999999999999998e-11Initial program 50.7%
Taylor expanded in y.re around 0 50.7%
*-commutative50.7%
unpow250.7%
unpow250.7%
hypot-undefine88.1%
Simplified88.1%
if -3.7999999999999998e-11 < y.re < 0.0210000000000000013Initial program 38.3%
exp-diff38.3%
exp-to-pow38.3%
hypot-define38.3%
*-commutative38.3%
exp-prod38.2%
fma-define38.2%
hypot-define81.7%
*-commutative81.7%
Simplified81.7%
add-cube-cbrt81.7%
pow381.7%
Applied egg-rr81.7%
Taylor expanded in y.re around 0 38.2%
unpow238.2%
unpow238.2%
hypot-undefine81.5%
Simplified81.5%
add-cube-cbrt81.5%
pow281.5%
rem-cube-cbrt81.5%
rem-cube-cbrt81.5%
Applied egg-rr81.5%
pow-plus81.5%
metadata-eval81.5%
Simplified81.5%
add-sqr-sqrt79.2%
sqrt-unprod85.0%
pow285.0%
*-commutative85.0%
rem-cube-cbrt85.0%
Applied egg-rr85.0%
unpow285.0%
rem-sqrt-square85.0%
exp-prod85.1%
associate-*r/85.1%
*-commutative85.1%
associate-/l*85.1%
Simplified83.6%
if 0.0210000000000000013 < y.re Initial program 34.4%
cancel-sign-sub-inv34.4%
fma-define34.4%
hypot-define34.4%
distribute-lft-neg-in34.4%
distribute-rgt-neg-out34.4%
fma-define34.4%
hypot-define67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in y.im around 0 63.8%
unpow263.8%
unpow263.8%
hypot-undefine63.8%
Simplified63.8%
add-cbrt-cube63.8%
pow1/374.2%
pow374.2%
Applied egg-rr74.2%
Final simplification82.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -9.2e-17)
(*
(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 0.0034)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(pow
(pow
(* (cos (* y.re (atan2 x.im x.re))) (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_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -9.2e-17) {
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 <= 0.0034) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
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);
}
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_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -9.2e-17) {
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 <= 0.0034) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
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);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -9.2e-17: 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 <= 0.0034: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: 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) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -9.2e-17) 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 <= 0.0034) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); 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)) ^ 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_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -9.2e-17) 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 <= 0.0034) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else 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; 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$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -9.2e-17], 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, 0.0034], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -9.2 \cdot 10^{-17}:\\
\;\;\;\;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 0.0034:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\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}\\
\end{array}
\end{array}
if y.re < -9.20000000000000035e-17Initial program 51.5%
Taylor expanded in y.re around 0 51.5%
*-commutative51.5%
unpow251.5%
unpow251.5%
hypot-undefine88.3%
Simplified88.3%
if -9.20000000000000035e-17 < y.re < 0.00339999999999999981Initial program 37.8%
cancel-sign-sub-inv37.8%
fma-define37.8%
hypot-define37.8%
distribute-lft-neg-in37.8%
distribute-rgt-neg-out37.8%
fma-define37.8%
hypot-define81.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in y.re around 0 37.6%
*-commutative37.6%
unpow237.6%
unpow237.6%
hypot-undefine80.8%
neg-mul-180.8%
distribute-rgt-neg-in80.8%
Simplified80.8%
if 0.00339999999999999981 < y.re Initial program 34.4%
cancel-sign-sub-inv34.4%
fma-define34.4%
hypot-define34.4%
distribute-lft-neg-in34.4%
distribute-rgt-neg-out34.4%
fma-define34.4%
hypot-define67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in y.im around 0 63.8%
unpow263.8%
unpow263.8%
hypot-undefine63.8%
Simplified63.8%
add-cbrt-cube63.8%
pow1/374.2%
pow374.2%
Applied egg-rr74.2%
Final simplification81.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -9.2e-17)
(*
(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 0.017)
(*
(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 <= -9.2e-17) {
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 <= 0.017) {
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 <= -9.2e-17) {
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 <= 0.017) {
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 <= -9.2e-17: 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 <= 0.017: 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 <= -9.2e-17) 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 <= 0.017) 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 <= -9.2e-17) 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 <= 0.017) 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, -9.2e-17], 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, 0.017], 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 -9.2 \cdot 10^{-17}:\\
\;\;\;\;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 0.017:\\
\;\;\;\;\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 < -9.20000000000000035e-17Initial program 51.5%
Taylor expanded in y.im around 0 86.8%
if -9.20000000000000035e-17 < y.re < 0.017000000000000001Initial program 37.8%
cancel-sign-sub-inv37.8%
fma-define37.8%
hypot-define37.8%
distribute-lft-neg-in37.8%
distribute-rgt-neg-out37.8%
fma-define37.8%
hypot-define81.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in y.re around 0 37.6%
*-commutative37.6%
unpow237.6%
unpow237.6%
hypot-undefine80.8%
neg-mul-180.8%
distribute-rgt-neg-in80.8%
Simplified80.8%
if 0.017000000000000001 < y.re Initial program 34.4%
cancel-sign-sub-inv34.4%
fma-define34.4%
hypot-define34.4%
distribute-lft-neg-in34.4%
distribute-rgt-neg-out34.4%
fma-define34.4%
hypot-define67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in y.im around 0 63.8%
unpow263.8%
unpow263.8%
hypot-undefine63.8%
Simplified63.8%
add-cbrt-cube63.8%
pow1/374.2%
pow374.2%
Applied egg-rr74.2%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -0.115)
(* t_0 t_1)
(if (<= y.re 0.0255)
(* t_1 (exp (* (atan2 x.im x.re) (- y.im))))
(pow
(pow (* (cos (* y.re (atan2 x.im x.re))) t_0) 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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -0.115) {
tmp = t_0 * t_1;
} else if (y_46_re <= 0.0255) {
tmp = t_1 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(pow((cos((y_46_re * atan2(x_46_im, x_46_re))) * t_0), 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.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_1 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -0.115) {
tmp = t_0 * t_1;
} else if (y_46_re <= 0.0255) {
tmp = t_1 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(Math.pow((Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * t_0), 3.0), 0.3333333333333333);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_1 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -0.115: tmp = t_0 * t_1 elif y_46_re <= 0.0255: tmp = t_1 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(math.pow((math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * t_0), 3.0), 0.3333333333333333) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re t_1 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -0.115) tmp = Float64(t_0 * t_1); elseif (y_46_re <= 0.0255) tmp = Float64(t_1 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = (Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * t_0) ^ 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 = hypot(x_46_im, x_46_re) ^ y_46_re; t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -0.115) tmp = t_0 * t_1; elseif (y_46_re <= 0.0255) tmp = t_1 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = ((cos((y_46_re * atan2(x_46_im, x_46_re))) * t_0) ^ 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.115], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 0.0255], N[(t$95$1 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -0.115:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 0.0255:\\
\;\;\;\;t\_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_0\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.re < -0.115000000000000005Initial program 48.4%
exp-diff37.5%
exp-to-pow37.5%
hypot-define37.5%
*-commutative37.5%
exp-prod37.5%
fma-define37.5%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
add-cube-cbrt71.9%
pow371.9%
Applied egg-rr71.9%
Taylor expanded in y.re around 0 37.5%
unpow237.5%
unpow237.5%
hypot-undefine73.4%
Simplified73.4%
Taylor expanded in y.im around 0 81.4%
unpow281.4%
unpow281.4%
hypot-undefine81.4%
Simplified81.4%
if -0.115000000000000005 < y.re < 0.0254999999999999984Initial program 39.7%
cancel-sign-sub-inv39.7%
fma-define39.7%
hypot-define39.7%
distribute-lft-neg-in39.7%
distribute-rgt-neg-out39.7%
fma-define39.7%
hypot-define82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in y.re around 0 39.4%
*-commutative39.4%
unpow239.4%
unpow239.4%
hypot-undefine81.3%
neg-mul-181.3%
distribute-rgt-neg-in81.3%
Simplified81.3%
if 0.0254999999999999984 < y.re Initial program 34.4%
cancel-sign-sub-inv34.4%
fma-define34.4%
hypot-define34.4%
distribute-lft-neg-in34.4%
distribute-rgt-neg-out34.4%
fma-define34.4%
hypot-define67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in y.im around 0 63.8%
unpow263.8%
unpow263.8%
hypot-undefine63.8%
Simplified63.8%
add-cbrt-cube63.8%
pow1/374.2%
pow374.2%
Applied egg-rr74.2%
Final simplification79.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -1.15)
(* t_0 t_1)
(if (<= y.re 1.05e+14)
(* t_1 (pow (exp y.im) (- (atan2 x.im x.re))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.15) {
tmp = t_0 * t_1;
} else if (y_46_re <= 1.05e+14) {
tmp = t_1 * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_1 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.15) {
tmp = t_0 * t_1;
} else if (y_46_re <= 1.05e+14) {
tmp = t_1 * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_1 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -1.15: tmp = t_0 * t_1 elif y_46_re <= 1.05e+14: tmp = t_1 * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re t_1 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -1.15) tmp = Float64(t_0 * t_1); elseif (y_46_re <= 1.05e+14) tmp = Float64(t_1 * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -1.15) tmp = t_0 * t_1; elseif (y_46_re <= 1.05e+14) tmp = t_1 * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.15], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.05e+14], N[(t$95$1 * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -1.15:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1.05 \cdot 10^{+14}:\\
\;\;\;\;t\_1 \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.1499999999999999Initial program 48.4%
exp-diff37.5%
exp-to-pow37.5%
hypot-define37.5%
*-commutative37.5%
exp-prod37.5%
fma-define37.5%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
add-cube-cbrt71.9%
pow371.9%
Applied egg-rr71.9%
Taylor expanded in y.re around 0 37.5%
unpow237.5%
unpow237.5%
hypot-undefine73.4%
Simplified73.4%
Taylor expanded in y.im around 0 81.4%
unpow281.4%
unpow281.4%
hypot-undefine81.4%
Simplified81.4%
if -1.1499999999999999 < y.re < 1.05e14Initial program 39.5%
cancel-sign-sub-inv39.5%
fma-define39.5%
hypot-define39.5%
distribute-lft-neg-in39.5%
distribute-rgt-neg-out39.5%
fma-define39.5%
hypot-define83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in y.re around 0 37.3%
*-commutative37.3%
unpow237.3%
unpow237.3%
hypot-undefine79.0%
neg-mul-179.0%
distribute-rgt-neg-in79.0%
mul-1-neg79.0%
exp-prod79.4%
mul-1-neg79.4%
Simplified79.4%
if 1.05e14 < y.re Initial program 34.0%
exp-diff32.0%
exp-to-pow32.0%
hypot-define32.0%
*-commutative32.0%
exp-prod32.0%
fma-define32.0%
hypot-define56.0%
*-commutative56.0%
Simplified56.0%
add-cube-cbrt56.0%
pow356.0%
Applied egg-rr56.0%
Taylor expanded in y.re around 0 36.0%
unpow236.0%
unpow236.0%
hypot-undefine66.0%
Simplified66.0%
Taylor expanded in y.im around 0 78.1%
unpow278.1%
unpow278.1%
hypot-undefine78.1%
Simplified78.1%
Final simplification79.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -0.062)
(* t_0 t_1)
(if (<= y.re 6.2e+14) (/ t_1 (pow (exp y.im) (atan2 x.im x.re))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -0.062) {
tmp = t_0 * t_1;
} else if (y_46_re <= 6.2e+14) {
tmp = t_1 / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_1 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -0.062) {
tmp = t_0 * t_1;
} else if (y_46_re <= 6.2e+14) {
tmp = t_1 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_1 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -0.062: tmp = t_0 * t_1 elif y_46_re <= 6.2e+14: tmp = t_1 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re t_1 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -0.062) tmp = Float64(t_0 * t_1); elseif (y_46_re <= 6.2e+14) tmp = Float64(t_1 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -0.062) tmp = t_0 * t_1; elseif (y_46_re <= 6.2e+14) tmp = t_1 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.062], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 6.2e+14], N[(t$95$1 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -0.062:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{t\_1}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.062Initial program 48.4%
exp-diff37.5%
exp-to-pow37.5%
hypot-define37.5%
*-commutative37.5%
exp-prod37.5%
fma-define37.5%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
add-cube-cbrt71.9%
pow371.9%
Applied egg-rr71.9%
Taylor expanded in y.re around 0 37.5%
unpow237.5%
unpow237.5%
hypot-undefine73.4%
Simplified73.4%
Taylor expanded in y.im around 0 81.4%
unpow281.4%
unpow281.4%
hypot-undefine81.4%
Simplified81.4%
if -0.062 < y.re < 6.2e14Initial program 39.5%
exp-diff39.5%
exp-to-pow39.5%
hypot-define39.5%
*-commutative39.5%
exp-prod39.4%
fma-define39.4%
hypot-define82.4%
*-commutative82.4%
Simplified82.4%
add-cube-cbrt82.4%
pow382.4%
Applied egg-rr82.4%
Taylor expanded in y.re around 0 37.3%
unpow237.3%
unpow237.3%
hypot-undefine78.9%
exp-prod79.4%
Simplified79.4%
if 6.2e14 < y.re Initial program 34.0%
exp-diff32.0%
exp-to-pow32.0%
hypot-define32.0%
*-commutative32.0%
exp-prod32.0%
fma-define32.0%
hypot-define56.0%
*-commutative56.0%
Simplified56.0%
add-cube-cbrt56.0%
pow356.0%
Applied egg-rr56.0%
Taylor expanded in y.re around 0 36.0%
unpow236.0%
unpow236.0%
hypot-undefine66.0%
Simplified66.0%
Taylor expanded in y.im around 0 78.1%
unpow278.1%
unpow278.1%
hypot-undefine78.1%
Simplified78.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -1.25)
(* (pow (hypot x.im x.re) y.re) t_0)
(if (<= y.re 0.062)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(pow (sqrt (+ (pow x.im 2.0) (pow x.re 2.0))) 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_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.25) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
} else if (y_46_re <= 0.062) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(sqrt((pow(x_46_im, 2.0) + pow(x_46_re, 2.0))), 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_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.25) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * t_0;
} else if (y_46_re <= 0.062) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(Math.sqrt((Math.pow(x_46_im, 2.0) + Math.pow(x_46_re, 2.0))), 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_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -1.25: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * t_0 elif y_46_re <= 0.062: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(math.sqrt((math.pow(x_46_im, 2.0) + math.pow(x_46_re, 2.0))), 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_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -1.25) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= 0.062) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = sqrt(Float64((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ 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_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -1.25) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * t_0; elseif (y_46_re <= 0.062) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = sqrt(((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ 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$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.25], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 0.062], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[N[(N[Power[x$46$im, 2.0], $MachinePrecision] + N[Power[x$46$re, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -1.25:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 0.062:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.25Initial program 48.4%
exp-diff37.5%
exp-to-pow37.5%
hypot-define37.5%
*-commutative37.5%
exp-prod37.5%
fma-define37.5%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
add-cube-cbrt71.9%
pow371.9%
Applied egg-rr71.9%
Taylor expanded in y.re around 0 37.5%
unpow237.5%
unpow237.5%
hypot-undefine73.4%
Simplified73.4%
Taylor expanded in y.im around 0 81.4%
unpow281.4%
unpow281.4%
hypot-undefine81.4%
Simplified81.4%
if -1.25 < y.re < 0.062Initial program 39.7%
cancel-sign-sub-inv39.7%
fma-define39.7%
hypot-define39.7%
distribute-lft-neg-in39.7%
distribute-rgt-neg-out39.7%
fma-define39.7%
hypot-define82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in y.re around 0 39.4%
*-commutative39.4%
unpow239.4%
unpow239.4%
hypot-undefine81.3%
neg-mul-181.3%
distribute-rgt-neg-in81.3%
Simplified81.3%
if 0.062 < y.re Initial program 34.4%
exp-diff32.7%
exp-to-pow32.7%
hypot-define32.7%
*-commutative32.7%
exp-prod32.7%
fma-define32.7%
hypot-define60.3%
*-commutative60.3%
Simplified60.3%
add-cube-cbrt60.3%
pow360.3%
Applied egg-rr60.3%
Taylor expanded in y.re around 0 35.0%
unpow235.0%
unpow235.0%
hypot-undefine67.7%
Simplified67.7%
Taylor expanded in y.im around 0 73.0%
Final simplification79.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.85e+64)
(pow (sqrt (+ (pow x.im 2.0) (pow x.re 2.0))) y.re)
(if (<= y.im 4.8e-10)
(* (pow (hypot x.im x.re) y.re) (cos (* y.im (log (hypot x.im x.re)))))
(/ (cos (* y.im (log x.im))) (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_im <= -1.85e+64) {
tmp = pow(sqrt((pow(x_46_im, 2.0) + pow(x_46_re, 2.0))), y_46_re);
} else if (y_46_im <= 4.8e-10) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = cos((y_46_im * log(x_46_im))) / 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_im <= -1.85e+64) {
tmp = Math.pow(Math.sqrt((Math.pow(x_46_im, 2.0) + Math.pow(x_46_re, 2.0))), y_46_re);
} else if (y_46_im <= 4.8e-10) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
} else {
tmp = Math.cos((y_46_im * Math.log(x_46_im))) / 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_im <= -1.85e+64: tmp = math.pow(math.sqrt((math.pow(x_46_im, 2.0) + math.pow(x_46_re, 2.0))), y_46_re) elif y_46_im <= 4.8e-10: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) else: tmp = math.cos((y_46_im * math.log(x_46_im))) / 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_im <= -1.85e+64) tmp = sqrt(Float64((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re; elseif (y_46_im <= 4.8e-10) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(cos(Float64(y_46_im * log(x_46_im))) / exp(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_im <= -1.85e+64) tmp = sqrt(((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re; elseif (y_46_im <= 4.8e-10) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((y_46_im * log(hypot(x_46_im, x_46_re)))); else tmp = cos((y_46_im * log(x_46_im))) / 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[LessEqual[y$46$im, -1.85e+64], N[Power[N[Sqrt[N[(N[Power[x$46$im, 2.0], $MachinePrecision] + N[Power[x$46$re, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision], If[LessEqual[y$46$im, 4.8e-10], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[x$46$im], $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.im \leq -1.85 \cdot 10^{+64}:\\
\;\;\;\;{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 4.8 \cdot 10^{-10}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log x.im\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\end{array}
\end{array}
if y.im < -1.84999999999999992e64Initial program 35.9%
exp-diff30.3%
exp-to-pow30.3%
hypot-define30.3%
*-commutative30.3%
exp-prod30.3%
fma-define30.3%
hypot-define54.8%
*-commutative54.8%
Simplified54.8%
add-cube-cbrt54.8%
pow354.8%
Applied egg-rr54.8%
Taylor expanded in y.re around 0 32.2%
unpow232.2%
unpow232.2%
hypot-undefine56.7%
Simplified56.7%
Taylor expanded in y.im around 0 52.0%
if -1.84999999999999992e64 < y.im < 4.8e-10Initial program 41.4%
exp-diff40.6%
exp-to-pow40.7%
hypot-define40.7%
*-commutative40.7%
exp-prod40.7%
fma-define40.7%
hypot-define88.1%
*-commutative88.1%
Simplified88.1%
add-cube-cbrt88.1%
pow388.1%
Applied egg-rr88.1%
Taylor expanded in y.re around 0 41.6%
unpow241.6%
unpow241.6%
hypot-undefine91.8%
Simplified91.8%
Taylor expanded in y.im around 0 65.7%
unpow265.7%
unpow265.7%
hypot-undefine89.9%
Simplified89.9%
if 4.8e-10 < y.im Initial program 43.0%
exp-diff37.1%
exp-to-pow37.1%
hypot-define37.1%
*-commutative37.1%
exp-prod36.8%
fma-define36.8%
hypot-define63.3%
*-commutative63.3%
Simplified63.3%
add-cube-cbrt63.3%
pow363.3%
Applied egg-rr63.3%
Taylor expanded in y.re around 0 35.3%
unpow235.3%
unpow235.3%
hypot-undefine61.8%
Simplified61.8%
Taylor expanded in x.re around 0 40.6%
Taylor expanded in y.re around 0 46.6%
Final simplification70.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -7.5e+21)
(pow (sqrt (+ (pow x.im 2.0) (pow x.re 2.0))) y.re)
(if (<= y.im 7.1e+31)
(pow (hypot x.im x.re) y.re)
(/ (cos (* y.im (log x.im))) (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_im <= -7.5e+21) {
tmp = pow(sqrt((pow(x_46_im, 2.0) + pow(x_46_re, 2.0))), y_46_re);
} else if (y_46_im <= 7.1e+31) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = cos((y_46_im * log(x_46_im))) / 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_im <= -7.5e+21) {
tmp = Math.pow(Math.sqrt((Math.pow(x_46_im, 2.0) + Math.pow(x_46_re, 2.0))), y_46_re);
} else if (y_46_im <= 7.1e+31) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.cos((y_46_im * Math.log(x_46_im))) / 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_im <= -7.5e+21: tmp = math.pow(math.sqrt((math.pow(x_46_im, 2.0) + math.pow(x_46_re, 2.0))), y_46_re) elif y_46_im <= 7.1e+31: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.cos((y_46_im * math.log(x_46_im))) / 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_im <= -7.5e+21) tmp = sqrt(Float64((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re; elseif (y_46_im <= 7.1e+31) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = Float64(cos(Float64(y_46_im * log(x_46_im))) / exp(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_im <= -7.5e+21) tmp = sqrt(((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re; elseif (y_46_im <= 7.1e+31) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = cos((y_46_im * log(x_46_im))) / 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[LessEqual[y$46$im, -7.5e+21], N[Power[N[Sqrt[N[(N[Power[x$46$im, 2.0], $MachinePrecision] + N[Power[x$46$re, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision], If[LessEqual[y$46$im, 7.1e+31], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[x$46$im], $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.im \leq -7.5 \cdot 10^{+21}:\\
\;\;\;\;{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 7.1 \cdot 10^{+31}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log x.im\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\end{array}
\end{array}
if y.im < -7.5e21Initial program 37.2%
exp-diff30.7%
exp-to-pow30.7%
hypot-define30.7%
*-commutative30.7%
exp-prod30.7%
fma-define30.7%
hypot-define56.5%
*-commutative56.5%
Simplified56.5%
add-cube-cbrt56.5%
pow356.5%
Applied egg-rr56.5%
Taylor expanded in y.re around 0 32.3%
unpow232.3%
unpow232.3%
hypot-undefine58.1%
Simplified58.1%
Taylor expanded in y.im around 0 52.6%
if -7.5e21 < y.im < 7.09999999999999961e31Initial program 41.6%
exp-diff41.6%
exp-to-pow41.6%
hypot-define41.6%
*-commutative41.6%
exp-prod41.6%
fma-define41.6%
hypot-define89.3%
*-commutative89.3%
Simplified89.3%
add-cube-cbrt89.3%
pow389.3%
Applied egg-rr89.3%
Taylor expanded in y.re around 0 42.6%
unpow242.6%
unpow242.6%
hypot-undefine93.1%
Simplified93.1%
Taylor expanded in y.im around 0 62.5%
unpow262.5%
unpow262.5%
hypot-undefine89.0%
Simplified89.0%
if 7.09999999999999961e31 < y.im Initial program 42.3%
exp-diff35.8%
exp-to-pow35.8%
hypot-define35.8%
*-commutative35.8%
exp-prod35.5%
fma-define35.5%
hypot-define61.4%
*-commutative61.4%
Simplified61.4%
add-cube-cbrt61.4%
pow361.4%
Applied egg-rr61.4%
Taylor expanded in y.re around 0 33.9%
unpow233.9%
unpow233.9%
hypot-undefine59.8%
Simplified59.8%
Taylor expanded in x.re around 0 39.7%
Taylor expanded in y.re around 0 46.2%
Final simplification69.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -3.5e+21)
(pow (sqrt (+ (pow x.im 2.0) (pow x.re 2.0))) y.re)
(if (<= y.im 8.2e+31)
(pow (hypot x.im x.re) y.re)
(/ (pow x.im y.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_im <= -3.5e+21) {
tmp = pow(sqrt((pow(x_46_im, 2.0) + pow(x_46_re, 2.0))), y_46_re);
} else if (y_46_im <= 8.2e+31) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow(x_46_im, y_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_im <= -3.5e+21) {
tmp = Math.pow(Math.sqrt((Math.pow(x_46_im, 2.0) + Math.pow(x_46_re, 2.0))), y_46_re);
} else if (y_46_im <= 8.2e+31) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.pow(x_46_im, y_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_im <= -3.5e+21: tmp = math.pow(math.sqrt((math.pow(x_46_im, 2.0) + math.pow(x_46_re, 2.0))), y_46_re) elif y_46_im <= 8.2e+31: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.pow(x_46_im, y_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_im <= -3.5e+21) tmp = sqrt(Float64((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re; elseif (y_46_im <= 8.2e+31) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = Float64((x_46_im ^ y_46_re) / exp(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_im <= -3.5e+21) tmp = sqrt(((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re; elseif (y_46_im <= 8.2e+31) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = (x_46_im ^ y_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[LessEqual[y$46$im, -3.5e+21], N[Power[N[Sqrt[N[(N[Power[x$46$im, 2.0], $MachinePrecision] + N[Power[x$46$re, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision], If[LessEqual[y$46$im, 8.2e+31], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $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.im \leq -3.5 \cdot 10^{+21}:\\
\;\;\;\;{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 8.2 \cdot 10^{+31}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{{x.im}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\end{array}
\end{array}
if y.im < -3.5e21Initial program 37.2%
exp-diff30.7%
exp-to-pow30.7%
hypot-define30.7%
*-commutative30.7%
exp-prod30.7%
fma-define30.7%
hypot-define56.5%
*-commutative56.5%
Simplified56.5%
add-cube-cbrt56.5%
pow356.5%
Applied egg-rr56.5%
Taylor expanded in y.re around 0 32.3%
unpow232.3%
unpow232.3%
hypot-undefine58.1%
Simplified58.1%
Taylor expanded in y.im around 0 52.6%
if -3.5e21 < y.im < 8.2000000000000003e31Initial program 41.6%
exp-diff41.6%
exp-to-pow41.6%
hypot-define41.6%
*-commutative41.6%
exp-prod41.6%
fma-define41.6%
hypot-define89.3%
*-commutative89.3%
Simplified89.3%
add-cube-cbrt89.3%
pow389.3%
Applied egg-rr89.3%
Taylor expanded in y.re around 0 42.6%
unpow242.6%
unpow242.6%
hypot-undefine93.1%
Simplified93.1%
Taylor expanded in y.im around 0 62.5%
unpow262.5%
unpow262.5%
hypot-undefine89.0%
Simplified89.0%
if 8.2000000000000003e31 < y.im Initial program 42.3%
exp-diff35.8%
exp-to-pow35.8%
hypot-define35.8%
*-commutative35.8%
exp-prod35.5%
fma-define35.5%
hypot-define61.4%
*-commutative61.4%
Simplified61.4%
add-cube-cbrt61.4%
pow361.4%
Applied egg-rr61.4%
Taylor expanded in y.re around 0 33.9%
unpow233.9%
unpow233.9%
hypot-undefine59.8%
Simplified59.8%
Taylor expanded in x.re around 0 39.7%
Taylor expanded in y.im around 0 42.7%
Final simplification69.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im 1.12e-243) (pow (hypot x.im x.re) y.re) (/ (pow x.im y.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 (x_46_im <= 1.12e-243) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow(x_46_im, y_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 (x_46_im <= 1.12e-243) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.pow(x_46_im, y_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 x_46_im <= 1.12e-243: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.pow(x_46_im, y_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 (x_46_im <= 1.12e-243) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = Float64((x_46_im ^ y_46_re) / exp(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 (x_46_im <= 1.12e-243) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = (x_46_im ^ y_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[LessEqual[x$46$im, 1.12e-243], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $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}\;x.im \leq 1.12 \cdot 10^{-243}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{{x.im}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\end{array}
\end{array}
if x.im < 1.12000000000000005e-243Initial program 38.5%
exp-diff36.3%
exp-to-pow36.3%
hypot-define36.3%
*-commutative36.3%
exp-prod36.2%
fma-define36.2%
hypot-define74.6%
*-commutative74.6%
Simplified74.6%
add-cube-cbrt74.6%
pow374.6%
Applied egg-rr74.6%
Taylor expanded in y.re around 0 35.0%
unpow235.0%
unpow235.0%
hypot-undefine74.8%
Simplified74.8%
Taylor expanded in y.im around 0 55.4%
unpow255.4%
unpow255.4%
hypot-undefine62.5%
Simplified62.5%
if 1.12000000000000005e-243 < x.im Initial program 43.2%
exp-diff39.0%
exp-to-pow39.0%
hypot-define39.0%
*-commutative39.0%
exp-prod39.0%
fma-define39.0%
hypot-define74.6%
*-commutative74.6%
Simplified74.6%
add-cube-cbrt74.5%
pow374.5%
Applied egg-rr74.5%
Taylor expanded in y.re around 0 41.5%
unpow241.5%
unpow241.5%
hypot-undefine78.6%
Simplified78.6%
Taylor expanded in x.re around 0 70.4%
Taylor expanded in y.im around 0 71.1%
Final simplification66.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow (hypot x.im x.re) y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return hypot(x_46_im, x_46_re) ^ y_46_re end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 40.7%
exp-diff37.5%
exp-to-pow37.6%
hypot-define37.6%
*-commutative37.6%
exp-prod37.5%
fma-define37.5%
hypot-define74.6%
*-commutative74.6%
Simplified74.6%
add-cube-cbrt74.6%
pow374.6%
Applied egg-rr74.6%
Taylor expanded in y.re around 0 38.0%
unpow238.0%
unpow238.0%
hypot-undefine76.6%
Simplified76.6%
Taylor expanded in y.im around 0 53.5%
unpow253.5%
unpow253.5%
hypot-undefine62.0%
Simplified62.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 40.7%
cancel-sign-sub-inv40.7%
fma-define40.7%
hypot-define40.7%
distribute-lft-neg-in40.7%
distribute-rgt-neg-out40.7%
fma-define40.7%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.im around 0 51.8%
unpow251.8%
unpow251.8%
hypot-undefine60.4%
Simplified60.4%
Taylor expanded in y.re around 0 23.1%
unpow223.1%
unpow223.1%
hypot-undefine27.5%
Simplified27.5%
Taylor expanded in y.re around 0 26.7%
herbie shell --seed 2024139
(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)))))