
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (log (hypot x.re x.im))))
(if (<= y.re 1.95e+15)
(*
(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 <= 1.95e+15) {
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 <= 1.95e+15) 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, 1.95e+15], 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 1.95 \cdot 10^{+15}:\\
\;\;\;\;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 < 1.95e15Initial 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-define85.1%
*-commutative85.1%
Simplified85.1%
if 1.95e15 < y.re Initial program 30.3%
fma-define30.3%
hypot-define53.1%
*-commutative53.1%
add-sqr-sqrt37.9%
sqrt-unprod77.3%
pow277.3%
Applied egg-rr77.3%
unpow277.3%
rem-sqrt-square77.3%
fma-define77.3%
hypot-undefine40.9%
unpow240.9%
unpow240.9%
+-commutative40.9%
+-commutative40.9%
fma-define40.9%
Simplified77.3%
Final simplification83.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= y.re 7.5e+70)
(*
(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 (hypot x.im x.re) y.re) (pow (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 t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 7.5e+70) {
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(hypot(x_46_im, x_46_re), y_46_re) / pow(exp(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) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 7.5e+70) 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((hypot(x_46_im, x_46_re) ^ y_46_re) / (exp(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_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 7.5e+70], 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision], y$46$im], $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 7.5 \cdot 10^{+70}:\\
\;\;\;\;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}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}\\
\end{array}
\end{array}
if y.re < 7.50000000000000031e70Initial program 39.4%
cancel-sign-sub-inv39.4%
fma-define39.4%
hypot-define39.4%
distribute-lft-neg-in39.4%
distribute-rgt-neg-out39.4%
fma-define39.4%
hypot-define83.4%
*-commutative83.4%
Simplified83.4%
if 7.50000000000000031e70 < y.re Initial program 30.0%
exp-diff28.0%
exp-to-pow28.0%
hypot-define28.0%
*-commutative28.0%
exp-prod24.0%
fma-define24.0%
hypot-define44.0%
*-commutative44.0%
Simplified44.0%
add-cube-cbrt44.0%
exp-prod44.0%
pow244.0%
Applied egg-rr44.0%
Taylor expanded in y.re around 0 32.0%
unpow232.0%
unpow232.0%
hypot-undefine60.0%
Simplified60.0%
Taylor expanded in y.im around 0 68.0%
+-commutative68.0%
unpow268.0%
unpow268.0%
hypot-undefine68.0%
hypot-undefine68.0%
unpow268.0%
unpow268.0%
+-commutative68.0%
unpow268.0%
unpow268.0%
hypot-undefine68.0%
*-commutative68.0%
exp-prod70.0%
Simplified70.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (<= y.re -2.1e-16)
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(cos (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_0 y.re))))))
(if (<= y.re 1.8e-51)
(/ (cos (* y.im t_0)) (exp (* (atan2 x.im x.re) y.im)))
(/ (pow (hypot x.im x.re) y.re) (pow (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 t_0 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -2.1e-16) {
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_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re)))));
} else if (y_46_re <= 1.8e-51) {
tmp = cos((y_46_im * t_0)) / exp((atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) / pow(exp(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) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -2.1e-16) 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_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(t_0 / y_46_re)))))); elseif (y_46_re <= 1.8e-51) tmp = Float64(cos(Float64(y_46_im * t_0)) / exp(Float64(atan(x_46_im, x_46_re) * y_46_im))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) / (exp(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_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.1e-16], 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$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(t$95$0 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.8e-51], N[(N[Cos[N[(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[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision], y$46$im], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{-16}:\\
\;\;\;\;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.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{t\_0}{y.re}\right)\right)\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-51}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot t\_0\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}\\
\end{array}
\end{array}
if y.re < -2.1000000000000001e-16Initial program 33.3%
cancel-sign-sub-inv33.3%
fma-define33.3%
hypot-define33.3%
distribute-lft-neg-in33.3%
distribute-rgt-neg-out33.3%
fma-define33.3%
hypot-define79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in y.re around inf 33.3%
+-commutative33.3%
associate-/l*33.3%
unpow233.3%
unpow233.3%
hypot-undefine81.1%
Simplified81.1%
if -2.1000000000000001e-16 < y.re < 1.8e-51Initial program 45.3%
exp-diff45.3%
exp-to-pow45.3%
hypot-define45.3%
*-commutative45.3%
exp-prod45.1%
fma-define45.1%
hypot-define88.8%
*-commutative88.8%
Simplified88.8%
add-cube-cbrt88.8%
exp-prod88.8%
pow288.8%
Applied egg-rr88.8%
Taylor expanded in y.re around 0 45.1%
unpow245.1%
unpow245.1%
hypot-undefine88.8%
Simplified88.8%
Taylor expanded in y.re around 0 45.3%
unpow245.3%
unpow245.3%
hypot-undefine89.0%
Simplified89.0%
if 1.8e-51 < y.re Initial program 30.3%
exp-diff25.0%
exp-to-pow25.0%
hypot-define25.0%
*-commutative25.0%
exp-prod22.4%
fma-define22.4%
hypot-define48.7%
*-commutative48.7%
Simplified48.7%
add-cube-cbrt48.7%
exp-prod48.7%
pow248.7%
Applied egg-rr48.7%
Taylor expanded in y.re around 0 27.6%
unpow227.6%
unpow227.6%
hypot-undefine56.6%
Simplified56.6%
Taylor expanded in y.im around 0 63.3%
+-commutative63.3%
unpow263.3%
unpow263.3%
hypot-undefine67.1%
hypot-undefine63.3%
unpow263.3%
unpow263.3%
+-commutative63.3%
unpow263.3%
unpow263.3%
hypot-undefine67.1%
*-commutative67.1%
exp-prod68.4%
Simplified68.4%
Final simplification80.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -2.4e-7)
(* t_0 (cos (pow (cbrt (* y.re (atan2 x.im x.re))) 3.0)))
(if (<= y.re 3.4e-51)
(/
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) y.im)))
(/ t_0 (pow (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 t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -2.4e-7) {
tmp = t_0 * cos(pow(cbrt((y_46_re * atan2(x_46_im, x_46_re))), 3.0));
} else if (y_46_re <= 3.4e-51) {
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 / pow(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 t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -2.4e-7) {
tmp = t_0 * Math.cos(Math.pow(Math.cbrt((y_46_re * Math.atan2(x_46_im, x_46_re))), 3.0));
} else if (y_46_re <= 3.4e-51) {
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 = t_0 / Math.pow(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) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -2.4e-7) tmp = Float64(t_0 * cos((cbrt(Float64(y_46_re * atan(x_46_im, x_46_re))) ^ 3.0))); elseif (y_46_re <= 3.4e-51) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / exp(Float64(atan(x_46_im, x_46_re) * y_46_im))); else tmp = Float64(t_0 / (exp(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_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -2.4e-7], N[(t$95$0 * 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], If[LessEqual[y$46$re, 3.4e-51], 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[(t$95$0 / N[Power[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision], y$46$im], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -2.4 \cdot 10^{-7}:\\
\;\;\;\;t\_0 \cdot \cos \left({\left(\sqrt[3]{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}\right)\\
\mathbf{elif}\;y.re \leq 3.4 \cdot 10^{-51}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}\\
\end{array}
\end{array}
if y.re < -2.39999999999999979e-7Initial program 32.4%
cancel-sign-sub-inv32.4%
fma-define32.4%
hypot-define32.4%
distribute-lft-neg-in32.4%
distribute-rgt-neg-out32.4%
fma-define32.4%
hypot-define79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in y.im around 0 76.6%
unpow276.6%
unpow276.6%
hypot-undefine77.7%
Simplified77.7%
add-cube-cbrt82.1%
pow380.6%
Applied egg-rr80.6%
if -2.39999999999999979e-7 < y.re < 3.40000000000000003e-51Initial program 45.8%
exp-diff45.7%
exp-to-pow45.7%
hypot-define45.7%
*-commutative45.7%
exp-prod45.6%
fma-define45.6%
hypot-define88.9%
*-commutative88.9%
Simplified88.9%
add-cube-cbrt88.9%
exp-prod88.9%
pow288.9%
Applied egg-rr88.9%
Taylor expanded in y.re around 0 45.4%
unpow245.4%
unpow245.4%
hypot-undefine88.7%
Simplified88.7%
Taylor expanded in y.re around 0 45.3%
unpow245.3%
unpow245.3%
hypot-undefine88.7%
Simplified88.7%
if 3.40000000000000003e-51 < y.re Initial program 30.3%
exp-diff25.0%
exp-to-pow25.0%
hypot-define25.0%
*-commutative25.0%
exp-prod22.4%
fma-define22.4%
hypot-define48.7%
*-commutative48.7%
Simplified48.7%
add-cube-cbrt48.7%
exp-prod48.7%
pow248.7%
Applied egg-rr48.7%
Taylor expanded in y.re around 0 27.6%
unpow227.6%
unpow227.6%
hypot-undefine56.6%
Simplified56.6%
Taylor expanded in y.im around 0 63.3%
+-commutative63.3%
unpow263.3%
unpow263.3%
hypot-undefine67.1%
hypot-undefine63.3%
unpow263.3%
unpow263.3%
+-commutative63.3%
unpow263.3%
unpow263.3%
hypot-undefine67.1%
*-commutative67.1%
exp-prod68.4%
Simplified68.4%
Final simplification80.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -7.5e-6)
(* t_0 (cos (* y.re (cbrt (pow (atan2 x.im x.re) 3.0)))))
(if (<= y.re 4.5e-52)
(/
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) y.im)))
(/ t_0 (pow (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 t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -7.5e-6) {
tmp = t_0 * cos((y_46_re * cbrt(pow(atan2(x_46_im, x_46_re), 3.0))));
} else if (y_46_re <= 4.5e-52) {
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 / pow(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 t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -7.5e-6) {
tmp = t_0 * Math.cos((y_46_re * Math.cbrt(Math.pow(Math.atan2(x_46_im, x_46_re), 3.0))));
} else if (y_46_re <= 4.5e-52) {
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 = t_0 / Math.pow(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) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -7.5e-6) tmp = Float64(t_0 * cos(Float64(y_46_re * cbrt((atan(x_46_im, x_46_re) ^ 3.0))))); elseif (y_46_re <= 4.5e-52) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / exp(Float64(atan(x_46_im, x_46_re) * y_46_im))); else tmp = Float64(t_0 / (exp(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_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -7.5e-6], N[(t$95$0 * N[Cos[N[(y$46$re * N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.5e-52], 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[(t$95$0 / N[Power[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision], y$46$im], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -7.5 \cdot 10^{-6}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \sqrt[3]{{\tan^{-1}_* \frac{x.im}{x.re}}^{3}}\right)\\
\mathbf{elif}\;y.re \leq 4.5 \cdot 10^{-52}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}\\
\end{array}
\end{array}
if y.re < -7.50000000000000019e-6Initial program 32.4%
cancel-sign-sub-inv32.4%
fma-define32.4%
hypot-define32.4%
distribute-lft-neg-in32.4%
distribute-rgt-neg-out32.4%
fma-define32.4%
hypot-define79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in y.im around 0 76.6%
unpow276.6%
unpow276.6%
hypot-undefine77.7%
Simplified77.7%
add-cbrt-cube79.1%
pow379.1%
Applied egg-rr79.1%
if -7.50000000000000019e-6 < y.re < 4.5e-52Initial program 45.8%
exp-diff45.7%
exp-to-pow45.7%
hypot-define45.7%
*-commutative45.7%
exp-prod45.6%
fma-define45.6%
hypot-define88.9%
*-commutative88.9%
Simplified88.9%
add-cube-cbrt88.9%
exp-prod88.9%
pow288.9%
Applied egg-rr88.9%
Taylor expanded in y.re around 0 45.4%
unpow245.4%
unpow245.4%
hypot-undefine88.7%
Simplified88.7%
Taylor expanded in y.re around 0 45.3%
unpow245.3%
unpow245.3%
hypot-undefine88.7%
Simplified88.7%
if 4.5e-52 < y.re Initial program 30.3%
exp-diff25.0%
exp-to-pow25.0%
hypot-define25.0%
*-commutative25.0%
exp-prod22.4%
fma-define22.4%
hypot-define48.7%
*-commutative48.7%
Simplified48.7%
add-cube-cbrt48.7%
exp-prod48.7%
pow248.7%
Applied egg-rr48.7%
Taylor expanded in y.re around 0 27.6%
unpow227.6%
unpow227.6%
hypot-undefine56.6%
Simplified56.6%
Taylor expanded in y.im around 0 63.3%
+-commutative63.3%
unpow263.3%
unpow263.3%
hypot-undefine67.1%
hypot-undefine63.3%
unpow263.3%
unpow263.3%
+-commutative63.3%
unpow263.3%
unpow263.3%
hypot-undefine67.1%
*-commutative67.1%
exp-prod68.4%
Simplified68.4%
Final simplification80.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -4.8e-7)
(* t_0 (cos (* y.re (atan2 x.im x.re))))
(if (<= y.re 1.16e-51)
(/
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) y.im)))
(/ t_0 (pow (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 t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -4.8e-7) {
tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.16e-51) {
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 / pow(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 t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -4.8e-7) {
tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.16e-51) {
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 = t_0 / Math.pow(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): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -4.8e-7: tmp = t_0 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 1.16e-51: 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 = t_0 / math.pow(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) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -4.8e-7) tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1.16e-51) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / exp(Float64(atan(x_46_im, x_46_re) * y_46_im))); else tmp = Float64(t_0 / (exp(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) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -4.8e-7) tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 1.16e-51) 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 / (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_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -4.8e-7], N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.16e-51], 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[(t$95$0 / N[Power[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision], y$46$im], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -4.8 \cdot 10^{-7}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 1.16 \cdot 10^{-51}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}\\
\end{array}
\end{array}
if y.re < -4.79999999999999957e-7Initial program 32.4%
cancel-sign-sub-inv32.4%
fma-define32.4%
hypot-define32.4%
distribute-lft-neg-in32.4%
distribute-rgt-neg-out32.4%
fma-define32.4%
hypot-define79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in y.im around 0 76.6%
unpow276.6%
unpow276.6%
hypot-undefine77.7%
Simplified77.7%
if -4.79999999999999957e-7 < y.re < 1.1600000000000001e-51Initial program 45.8%
exp-diff45.7%
exp-to-pow45.7%
hypot-define45.7%
*-commutative45.7%
exp-prod45.6%
fma-define45.6%
hypot-define88.9%
*-commutative88.9%
Simplified88.9%
add-cube-cbrt88.9%
exp-prod88.9%
pow288.9%
Applied egg-rr88.9%
Taylor expanded in y.re around 0 45.4%
unpow245.4%
unpow245.4%
hypot-undefine88.7%
Simplified88.7%
Taylor expanded in y.re around 0 45.3%
unpow245.3%
unpow245.3%
hypot-undefine88.7%
Simplified88.7%
if 1.1600000000000001e-51 < y.re Initial program 30.3%
exp-diff25.0%
exp-to-pow25.0%
hypot-define25.0%
*-commutative25.0%
exp-prod22.4%
fma-define22.4%
hypot-define48.7%
*-commutative48.7%
Simplified48.7%
add-cube-cbrt48.7%
exp-prod48.7%
pow248.7%
Applied egg-rr48.7%
Taylor expanded in y.re around 0 27.6%
unpow227.6%
unpow227.6%
hypot-undefine56.6%
Simplified56.6%
Taylor expanded in y.im around 0 63.3%
+-commutative63.3%
unpow263.3%
unpow263.3%
hypot-undefine67.1%
hypot-undefine63.3%
unpow263.3%
unpow263.3%
+-commutative63.3%
unpow263.3%
unpow263.3%
hypot-undefine67.1%
*-commutative67.1%
exp-prod68.4%
Simplified68.4%
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)))
(if (<= y.re -1.55e+80)
(* t_0 (cos (* y.re (atan2 x.im x.re))))
(/ t_0 (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 t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.55e+80) {
tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 / 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 t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.55e+80) {
tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 / 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): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -1.55e+80: tmp = t_0 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 / 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) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.55e+80) tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 / 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) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1.55e+80) tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re))); else tmp = t_0 / 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_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.55e+80], N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.55 \cdot 10^{+80}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\end{array}
\end{array}
if y.re < -1.54999999999999994e80Initial program 35.8%
cancel-sign-sub-inv35.8%
fma-define35.8%
hypot-define35.8%
distribute-lft-neg-in35.8%
distribute-rgt-neg-out35.8%
fma-define35.8%
hypot-define81.1%
*-commutative81.1%
Simplified81.1%
Taylor expanded in y.im around 0 79.4%
unpow279.4%
unpow279.4%
hypot-undefine79.4%
Simplified79.4%
if -1.54999999999999994e80 < y.re Initial program 38.1%
exp-diff36.1%
exp-to-pow36.1%
hypot-define36.1%
*-commutative36.1%
exp-prod35.0%
fma-define35.0%
hypot-define72.7%
*-commutative72.7%
Simplified72.7%
add-cube-cbrt72.7%
exp-prod72.7%
pow272.7%
Applied egg-rr72.7%
Taylor expanded in y.re around 0 37.3%
unpow237.3%
unpow237.3%
hypot-undefine75.6%
Simplified75.6%
Taylor expanded in y.im around 0 58.6%
unpow258.6%
unpow258.6%
hypot-undefine76.8%
Simplified76.8%
Final simplification77.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -2.8e-7)
(* t_0 (cos (* y.re (atan2 x.im x.re))))
(if (<= y.re 9000000.0)
(exp (* (atan2 x.im x.re) (- y.im)))
(/ t_0 (+ (* (atan2 x.im x.re) y.im) 1.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 tmp;
if (y_46_re <= -2.8e-7) {
tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 9000000.0) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0 / ((atan2(x_46_im, x_46_re) * y_46_im) + 1.0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -2.8e-7) {
tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 9000000.0) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0 / ((Math.atan2(x_46_im, x_46_re) * y_46_im) + 1.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) tmp = 0 if y_46_re <= -2.8e-7: tmp = t_0 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 9000000.0: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = t_0 / ((math.atan2(x_46_im, x_46_re) * y_46_im) + 1.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 tmp = 0.0 if (y_46_re <= -2.8e-7) tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 9000000.0) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = Float64(t_0 / Float64(Float64(atan(x_46_im, x_46_re) * y_46_im) + 1.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; tmp = 0.0; if (y_46_re <= -2.8e-7) tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 9000000.0) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = t_0 / ((atan2(x_46_im, x_46_re) * y_46_im) + 1.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]}, If[LessEqual[y$46$re, -2.8e-7], N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9000000.0], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[(t$95$0 / N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{-7}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 9000000:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + 1}\\
\end{array}
\end{array}
if y.re < -2.80000000000000019e-7Initial program 32.4%
cancel-sign-sub-inv32.4%
fma-define32.4%
hypot-define32.4%
distribute-lft-neg-in32.4%
distribute-rgt-neg-out32.4%
fma-define32.4%
hypot-define79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in y.im around 0 76.6%
unpow276.6%
unpow276.6%
hypot-undefine77.7%
Simplified77.7%
if -2.80000000000000019e-7 < y.re < 9e6Initial program 45.2%
exp-diff45.2%
exp-to-pow45.2%
hypot-define45.2%
*-commutative45.2%
exp-prod45.0%
fma-define45.0%
hypot-define88.0%
*-commutative88.0%
Simplified88.0%
add-cube-cbrt88.0%
exp-prod88.0%
pow288.0%
Applied egg-rr88.0%
Taylor expanded in y.re around 0 44.8%
unpow244.8%
unpow244.8%
hypot-undefine87.8%
Simplified87.8%
Taylor expanded in y.im around 0 53.3%
+-commutative53.3%
unpow253.3%
unpow253.3%
hypot-undefine83.9%
hypot-undefine53.3%
unpow253.3%
unpow253.3%
+-commutative53.3%
unpow253.3%
unpow253.3%
hypot-undefine83.9%
*-commutative83.9%
exp-prod80.7%
Simplified80.7%
Taylor expanded in y.re around 0 83.9%
rec-exp83.9%
distribute-rgt-neg-in83.9%
Simplified83.9%
if 9e6 < y.re Initial program 29.4%
exp-diff23.5%
exp-to-pow23.5%
hypot-define23.5%
*-commutative23.5%
exp-prod20.6%
fma-define20.6%
hypot-define45.6%
*-commutative45.6%
Simplified45.6%
add-cube-cbrt45.6%
exp-prod45.6%
pow245.6%
Applied egg-rr45.6%
Taylor expanded in y.re around 0 26.5%
unpow226.5%
unpow226.5%
hypot-undefine54.4%
Simplified54.4%
Taylor expanded in y.im around 0 64.7%
+-commutative64.7%
unpow264.7%
unpow264.7%
hypot-undefine64.7%
hypot-undefine64.7%
unpow264.7%
unpow264.7%
+-commutative64.7%
unpow264.7%
unpow264.7%
hypot-undefine64.7%
*-commutative64.7%
exp-prod66.2%
Simplified66.2%
Taylor expanded in y.im around 0 63.4%
Final simplification76.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.75e-12) (not (<= y.im 9.6e+76))) (exp (* (atan2 x.im x.re) (- y.im))) (/ (pow (hypot x.im x.re) y.re) (+ (* (atan2 x.im x.re) y.im) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.75e-12) || !(y_46_im <= 9.6e+76)) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) / ((atan2(x_46_im, x_46_re) * y_46_im) + 1.0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.75e-12) || !(y_46_im <= 9.6e+76)) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) / ((Math.atan2(x_46_im, x_46_re) * y_46_im) + 1.0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.75e-12) or not (y_46_im <= 9.6e+76): tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) / ((math.atan2(x_46_im, x_46_re) * y_46_im) + 1.0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.75e-12) || !(y_46_im <= 9.6e+76)) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) / Float64(Float64(atan(x_46_im, x_46_re) * y_46_im) + 1.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.75e-12) || ~((y_46_im <= 9.6e+76))) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) / ((atan2(x_46_im, x_46_re) * y_46_im) + 1.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.75e-12], N[Not[LessEqual[y$46$im, 9.6e+76]], $MachinePrecision]], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.75 \cdot 10^{-12} \lor \neg \left(y.im \leq 9.6 \cdot 10^{+76}\right):\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + 1}\\
\end{array}
\end{array}
if y.im < -1.75e-12 or 9.5999999999999999e76 < y.im Initial program 37.8%
exp-diff30.5%
exp-to-pow30.5%
hypot-define30.5%
*-commutative30.5%
exp-prod29.4%
fma-define29.4%
hypot-define53.2%
*-commutative53.2%
Simplified53.2%
add-cube-cbrt53.2%
exp-prod53.2%
pow253.2%
Applied egg-rr53.2%
Taylor expanded in y.re around 0 27.3%
unpow227.3%
unpow227.3%
hypot-undefine50.3%
Simplified50.3%
Taylor expanded in y.im around 0 48.6%
+-commutative48.6%
unpow248.6%
unpow248.6%
hypot-undefine54.3%
hypot-undefine48.6%
unpow248.6%
unpow248.6%
+-commutative48.6%
unpow248.6%
unpow248.6%
hypot-undefine54.3%
*-commutative54.3%
exp-prod51.7%
Simplified51.7%
Taylor expanded in y.re around 0 58.4%
rec-exp58.4%
distribute-rgt-neg-in58.4%
Simplified58.4%
if -1.75e-12 < y.im < 9.5999999999999999e76Initial program 37.4%
exp-diff36.7%
exp-to-pow36.7%
hypot-define36.7%
*-commutative36.7%
exp-prod36.1%
fma-define36.1%
hypot-define83.3%
*-commutative83.3%
Simplified83.3%
add-cube-cbrt83.3%
exp-prod83.3%
pow283.3%
Applied egg-rr83.3%
Taylor expanded in y.re around 0 39.5%
unpow239.5%
unpow239.5%
hypot-undefine88.3%
Simplified88.3%
Taylor expanded in y.im around 0 68.8%
+-commutative68.8%
unpow268.8%
unpow268.8%
hypot-undefine89.6%
hypot-undefine68.8%
unpow268.8%
unpow268.8%
+-commutative68.8%
unpow268.8%
unpow268.8%
hypot-undefine89.6%
*-commutative89.6%
exp-prod89.6%
Simplified89.6%
Taylor expanded in y.im around 0 89.4%
Final simplification76.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.75e-12) (not (<= y.im 3.1e-67))) (exp (* (atan2 x.im x.re) (- y.im))) (+ 1.0 (log (pow (hypot x.re x.im) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.75e-12) || !(y_46_im <= 3.1e-67)) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 1.0 + log(pow(hypot(x_46_re, x_46_im), y_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.75e-12) || !(y_46_im <= 3.1e-67)) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 1.0 + Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.75e-12) or not (y_46_im <= 3.1e-67): tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = 1.0 + math.log(math.pow(math.hypot(x_46_re, x_46_im), y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.75e-12) || !(y_46_im <= 3.1e-67)) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = Float64(1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.75e-12) || ~((y_46_im <= 3.1e-67))) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.75e-12], N[Not[LessEqual[y$46$im, 3.1e-67]], $MachinePrecision]], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.75 \cdot 10^{-12} \lor \neg \left(y.im \leq 3.1 \cdot 10^{-67}\right):\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.im < -1.75e-12 or 3.1000000000000003e-67 < y.im Initial program 38.4%
exp-diff31.5%
exp-to-pow31.5%
hypot-define31.5%
*-commutative31.5%
exp-prod29.8%
fma-define29.8%
hypot-define56.9%
*-commutative56.9%
Simplified56.9%
add-cube-cbrt56.9%
exp-prod56.9%
pow256.9%
Applied egg-rr56.9%
Taylor expanded in y.re around 0 27.3%
unpow227.3%
unpow227.3%
hypot-undefine53.7%
Simplified53.7%
Taylor expanded in y.im around 0 50.5%
+-commutative50.5%
unpow250.5%
unpow250.5%
hypot-undefine58.5%
hypot-undefine50.5%
unpow250.5%
unpow250.5%
+-commutative50.5%
unpow250.5%
unpow250.5%
hypot-undefine58.5%
*-commutative58.5%
exp-prod56.4%
Simplified56.4%
Taylor expanded in y.re around 0 57.5%
rec-exp57.5%
distribute-rgt-neg-in57.5%
Simplified57.5%
if -1.75e-12 < y.im < 3.1000000000000003e-67Initial program 36.8%
cancel-sign-sub-inv36.8%
fma-define36.8%
hypot-define36.8%
distribute-lft-neg-in36.8%
distribute-rgt-neg-out36.8%
fma-define36.8%
hypot-define84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in y.im around 0 63.1%
unpow263.1%
unpow263.1%
hypot-undefine84.6%
Simplified84.6%
Taylor expanded in y.re around 0 37.4%
unpow237.4%
unpow237.4%
hypot-undefine45.7%
Simplified45.7%
log-pow68.4%
Applied egg-rr68.4%
hypot-undefine47.2%
unpow247.2%
unpow247.2%
+-commutative47.2%
unpow247.2%
unpow247.2%
hypot-define68.4%
Simplified68.4%
Final simplification62.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1700000.0)
(* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re))
(if (<= y.re 330.0)
(exp (* (atan2 x.im x.re) (- y.im)))
(+ 1.0 (log (pow (hypot x.re x.im) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1700000.0) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else if (y_46_re <= 330.0) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 1.0 + log(pow(hypot(x_46_re, x_46_im), y_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1700000.0) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 330.0) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 1.0 + Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -1700000.0: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) elif y_46_re <= 330.0: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = 1.0 + math.log(math.pow(math.hypot(x_46_re, x_46_im), y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -1700000.0) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); elseif (y_46_re <= 330.0) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = Float64(1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -1700000.0) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); elseif (y_46_re <= 330.0) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1700000.0], 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], If[LessEqual[y$46$re, 330.0], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1700000:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 330:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < -1.7e6Initial program 32.8%
cancel-sign-sub-inv32.8%
fma-define32.8%
hypot-define32.8%
distribute-lft-neg-in32.8%
distribute-rgt-neg-out32.8%
fma-define32.8%
hypot-define79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in y.im around 0 78.2%
unpow278.2%
unpow278.2%
hypot-undefine78.2%
Simplified78.2%
Taylor expanded in x.re around 0 61.3%
*-commutative61.3%
Simplified61.3%
if -1.7e6 < y.re < 330Initial program 44.5%
exp-diff44.5%
exp-to-pow44.5%
hypot-define44.5%
*-commutative44.5%
exp-prod44.3%
fma-define44.3%
hypot-define88.2%
*-commutative88.2%
Simplified88.2%
add-cube-cbrt88.2%
exp-prod88.2%
pow288.2%
Applied egg-rr88.2%
Taylor expanded in y.re around 0 44.1%
unpow244.1%
unpow244.1%
hypot-undefine87.3%
Simplified87.3%
Taylor expanded in y.im around 0 53.3%
+-commutative53.3%
unpow253.3%
unpow253.3%
hypot-undefine83.5%
hypot-undefine53.3%
unpow253.3%
unpow253.3%
+-commutative53.3%
unpow253.3%
unpow253.3%
hypot-undefine83.5%
*-commutative83.5%
exp-prod80.3%
Simplified80.3%
Taylor expanded in y.re around 0 82.6%
rec-exp82.6%
distribute-rgt-neg-in82.6%
Simplified82.6%
if 330 < y.re Initial program 30.0%
cancel-sign-sub-inv30.0%
fma-define30.0%
hypot-define30.0%
distribute-lft-neg-in30.0%
distribute-rgt-neg-out30.0%
fma-define30.0%
hypot-define55.7%
*-commutative55.7%
Simplified55.7%
Taylor expanded in y.im around 0 55.9%
unpow255.9%
unpow255.9%
hypot-undefine55.9%
Simplified55.9%
Taylor expanded in y.re around 0 37.1%
unpow237.1%
unpow237.1%
hypot-undefine4.6%
Simplified4.6%
log-pow56.0%
Applied egg-rr56.0%
hypot-undefine56.0%
unpow256.0%
unpow256.0%
+-commutative56.0%
unpow256.0%
unpow256.0%
hypot-define56.0%
Simplified56.0%
Final simplification70.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (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) {
return exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
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 = exp((atan2(x_46im, x_46re) * -y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}
\end{array}
Initial program 37.6%
exp-diff34.1%
exp-to-pow34.1%
hypot-define34.1%
*-commutative34.1%
exp-prod33.2%
fma-define33.2%
hypot-define70.5%
*-commutative70.5%
Simplified70.5%
add-cube-cbrt70.5%
exp-prod70.5%
pow270.5%
Applied egg-rr70.5%
Taylor expanded in y.re around 0 34.3%
unpow234.3%
unpow234.3%
hypot-undefine72.1%
Simplified72.1%
Taylor expanded in y.im around 0 60.2%
+-commutative60.2%
unpow260.2%
unpow260.2%
hypot-undefine74.6%
hypot-undefine60.2%
unpow260.2%
unpow260.2%
+-commutative60.2%
unpow260.2%
unpow260.2%
hypot-undefine74.6%
*-commutative74.6%
exp-prod73.5%
Simplified73.5%
Taylor expanded in y.re around 0 51.3%
rec-exp51.3%
distribute-rgt-neg-in51.3%
Simplified51.3%
Final simplification51.3%
(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 37.6%
cancel-sign-sub-inv37.6%
fma-define37.6%
hypot-define37.6%
distribute-lft-neg-in37.6%
distribute-rgt-neg-out37.6%
fma-define37.6%
hypot-define77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in y.im around 0 52.6%
unpow252.6%
unpow252.6%
hypot-undefine61.0%
Simplified61.0%
Taylor expanded in y.re around 0 26.6%
herbie shell --seed 2024146
(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)))))