
(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 11 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)))
(t_2
(*
(exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_1 y.im t_0)))))
(if (<= y.im -2.5e-13)
t_2
(if (<= y.im 2e-23)
(fabs
(*
(cos (fma y.im (log (hypot x.im x.re)) t_0))
(pow (hypot x.im x.re) y.re)))
(if (<= y.im 1.8e+252)
t_2
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(cos 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 t_2 = 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));
double tmp;
if (y_46_im <= -2.5e-13) {
tmp = t_2;
} else if (y_46_im <= 2e-23) {
tmp = fabs((cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else if (y_46_im <= 1.8e+252) {
tmp = t_2;
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(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)) t_2 = 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))) tmp = 0.0 if (y_46_im <= -2.5e-13) tmp = t_2; elseif (y_46_im <= 2e-23) tmp = abs(Float64(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re))); elseif (y_46_im <= 1.8e+252) tmp = t_2; else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(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]}, Block[{t$95$2 = 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]}, If[LessEqual[y$46$im, -2.5e-13], t$95$2, If[LessEqual[y$46$im, 2e-23], N[Abs[N[(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] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$im, 1.8e+252], t$95$2, 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[t$95$0], $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)\\
t_2 := 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{if}\;y.im \leq -2.5 \cdot 10^{-13}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{-23}:\\
\;\;\;\;\left|\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right|\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+252}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos t\_0\\
\end{array}
\end{array}
if y.im < -2.49999999999999995e-13 or 1.99999999999999992e-23 < y.im < 1.7999999999999999e252Initial program 34.5%
cancel-sign-sub-inv34.5%
fma-define34.5%
hypot-define34.5%
distribute-lft-neg-in34.5%
distribute-rgt-neg-out34.5%
fma-define34.5%
hypot-define76.2%
*-commutative76.2%
Simplified76.2%
if -2.49999999999999995e-13 < y.im < 1.99999999999999992e-23Initial program 52.7%
exp-diff52.7%
exp-to-pow52.7%
hypot-define52.7%
*-commutative52.7%
exp-prod52.7%
fma-define52.7%
hypot-define89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y.im around 0 89.1%
add-sqr-sqrt88.3%
sqrt-unprod99.2%
pow299.2%
/-rgt-identity99.2%
*-commutative99.2%
Applied egg-rr99.2%
unpow299.2%
rem-sqrt-square99.2%
fma-undefine99.2%
hypot-undefine56.6%
unpow256.6%
unpow256.6%
+-commutative56.6%
*-commutative56.6%
Simplified99.2%
if 1.7999999999999999e252 < y.im Initial program 29.9%
Taylor expanded in y.im around 0 76.4%
Final simplification87.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (log (hypot x.re x.im)))
(t_2 (cos (fma t_1 y.im (* y.re (atan2 x.im x.re)))))
(t_3 (pow (hypot x.re x.im) y.re)))
(if (<= y.re 1.5e-217)
(* (exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im)))) t_2)
(if (<= y.re 0.0062)
(*
t_2
(/
t_3
(*
(+ 1.0 (* 0.6666666666666666 t_0))
(cbrt (pow (exp y.im) (atan2 x.im x.re))))))
(* (/ t_3 (+ 1.0 t_0)) (cos (* t_1 y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = cos(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
double t_3 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= 1.5e-217) {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * t_2;
} else if (y_46_re <= 0.0062) {
tmp = t_2 * (t_3 / ((1.0 + (0.6666666666666666 * t_0)) * cbrt(pow(exp(y_46_im), atan2(x_46_im, x_46_re)))));
} else {
tmp = (t_3 / (1.0 + t_0)) * cos((t_1 * y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = cos(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) t_3 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= 1.5e-217) tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * t_2); elseif (y_46_re <= 0.0062) tmp = Float64(t_2 * Float64(t_3 / Float64(Float64(1.0 + Float64(0.6666666666666666 * t_0)) * cbrt((exp(y_46_im) ^ atan(x_46_im, x_46_re)))))); else tmp = Float64(Float64(t_3 / Float64(1.0 + t_0)) * cos(Float64(t_1 * 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(t$95$1 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, 1.5e-217], 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] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 0.0062], N[(t$95$2 * N[(t$95$3 / N[(N[(1.0 + N[(0.6666666666666666 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := \cos \left(\mathsf{fma}\left(t\_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
t_3 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq 1.5 \cdot 10^{-217}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot t\_2\\
\mathbf{elif}\;y.re \leq 0.0062:\\
\;\;\;\;t\_2 \cdot \frac{t\_3}{\left(1 + 0.6666666666666666 \cdot t\_0\right) \cdot \sqrt[3]{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_3}{1 + t\_0} \cdot \cos \left(t\_1 \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < 1.50000000000000002e-217Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define87.2%
*-commutative87.2%
Simplified87.2%
if 1.50000000000000002e-217 < y.re < 0.00619999999999999978Initial program 43.8%
exp-diff43.8%
exp-to-pow43.8%
hypot-define43.8%
*-commutative43.8%
exp-prod43.8%
fma-define43.8%
hypot-define74.7%
*-commutative74.7%
Simplified74.7%
add-cube-cbrt74.7%
associate-*l*74.7%
cbrt-unprod74.7%
pow-prod-down74.7%
pow274.7%
Applied egg-rr74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in y.im around 0 89.7%
if 0.00619999999999999978 < y.re Initial program 48.5%
exp-diff40.9%
exp-to-pow40.9%
hypot-define40.9%
*-commutative40.9%
exp-prod40.9%
fma-define40.9%
hypot-define57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in y.re around inf 40.9%
+-commutative40.9%
associate-/l*40.9%
unpow240.9%
unpow240.9%
hypot-undefine57.6%
Simplified57.6%
Taylor expanded in y.re around 0 43.9%
+-commutative43.9%
unpow243.9%
unpow243.9%
hypot-undefine71.2%
Simplified71.2%
Taylor expanded in y.im around 0 85.0%
Final simplification87.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)) (t_1 (* (atan2 x.im x.re) y.im)))
(if (<= y.re -6.6)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))
(cos (* y.im (log (hypot x.im x.re)))))
(if (<= y.re 0.0062)
(*
(cos (* y.re (atan2 x.im x.re)))
(/ t_0 (pow (exp y.im) (atan2 x.im x.re))))
(* (/ t_0 (+ 1.0 t_1)) (cos (* (log (hypot x.re x.im)) 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_re, x_46_im), y_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (y_46_re <= -6.6) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_re <= 0.0062) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (t_0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = (t_0 / (1.0 + t_1)) * cos((log(hypot(x_46_re, x_46_im)) * 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_re, x_46_im), y_46_re);
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (y_46_re <= -6.6) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
} else if (y_46_re <= 0.0062) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * (t_0 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re)));
} else {
tmp = (t_0 / (1.0 + t_1)) * Math.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * 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_re, x_46_im), y_46_re) t_1 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if y_46_re <= -6.6: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) elif y_46_re <= 0.0062: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * (t_0 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) else: tmp = (t_0 / (1.0 + t_1)) * math.cos((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (y_46_re <= -6.6) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1)) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (y_46_re <= 0.0062) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * Float64(t_0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); else tmp = Float64(Float64(t_0 / Float64(1.0 + t_1)) * cos(Float64(log(hypot(x_46_re, x_46_im)) * 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_re, x_46_im) ^ y_46_re; t_1 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (y_46_re <= -6.6) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * cos((y_46_im * log(hypot(x_46_im, x_46_re)))); elseif (y_46_re <= 0.0062) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (t_0 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re))); else tmp = (t_0 / (1.0 + t_1)) * cos((log(hypot(x_46_re, x_46_im)) * 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$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, -6.6], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.0062], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.re \leq -6.6:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_1} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 0.0062:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \frac{t\_0}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{1 + t\_1} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -6.5999999999999996Initial program 36.9%
Taylor expanded in y.re around 0 40.0%
unpow240.0%
unpow240.0%
hypot-undefine87.8%
Simplified87.8%
if -6.5999999999999996 < y.re < 0.00619999999999999978Initial program 44.2%
exp-diff44.2%
exp-to-pow44.2%
hypot-define44.2%
*-commutative44.2%
exp-prod44.0%
fma-define44.0%
hypot-define80.1%
*-commutative80.1%
Simplified80.1%
Taylor expanded in y.re around inf 37.6%
+-commutative37.6%
associate-/l*37.5%
unpow237.5%
unpow237.5%
hypot-undefine68.6%
Simplified68.6%
Taylor expanded in y.re around inf 81.3%
if 0.00619999999999999978 < y.re Initial program 48.5%
exp-diff40.9%
exp-to-pow40.9%
hypot-define40.9%
*-commutative40.9%
exp-prod40.9%
fma-define40.9%
hypot-define57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in y.re around inf 40.9%
+-commutative40.9%
associate-/l*40.9%
unpow240.9%
unpow240.9%
hypot-undefine57.6%
Simplified57.6%
Taylor expanded in y.re around 0 43.9%
+-commutative43.9%
unpow243.9%
unpow243.9%
hypot-undefine71.2%
Simplified71.2%
Taylor expanded in y.im around 0 85.0%
Final simplification83.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)))
(if (or (<= y.re -11.2) (not (<= y.re 0.0062)))
(*
(/ t_0 (+ 1.0 (* (atan2 x.im x.re) y.im)))
(cos (* (log (hypot x.re x.im)) y.im)))
(*
(cos (* y.re (atan2 x.im x.re)))
(/ t_0 (pow (exp y.im) (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if ((y_46_re <= -11.2) || !(y_46_re <= 0.0062)) {
tmp = (t_0 / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (t_0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if ((y_46_re <= -11.2) || !(y_46_re <= 0.0062)) {
tmp = (t_0 / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * (t_0 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if (y_46_re <= -11.2) or not (y_46_re <= 0.0062): tmp = (t_0 / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) else: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * (t_0 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if ((y_46_re <= -11.2) || !(y_46_re <= 0.0062)) tmp = Float64(Float64(t_0 / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * Float64(t_0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if ((y_46_re <= -11.2) || ~((y_46_re <= 0.0062))) tmp = (t_0 / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (t_0 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -11.2], N[Not[LessEqual[y$46$re, 0.0062]], $MachinePrecision]], N[(N[(t$95$0 / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -11.2 \lor \neg \left(y.re \leq 0.0062\right):\\
\;\;\;\;\frac{t\_0}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \frac{t\_0}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\end{array}
\end{array}
if y.re < -11.199999999999999 or 0.00619999999999999978 < y.re Initial program 42.7%
exp-diff35.9%
exp-to-pow35.9%
hypot-define35.9%
*-commutative35.9%
exp-prod34.4%
fma-define34.4%
hypot-define60.3%
*-commutative60.3%
Simplified60.3%
Taylor expanded in y.re around inf 34.4%
+-commutative34.4%
associate-/l*34.4%
unpow234.4%
unpow234.4%
hypot-undefine60.3%
Simplified60.3%
Taylor expanded in y.re around 0 37.4%
+-commutative37.4%
unpow237.4%
unpow237.4%
hypot-undefine69.5%
Simplified69.5%
Taylor expanded in y.im around 0 85.7%
if -11.199999999999999 < y.re < 0.00619999999999999978Initial program 44.2%
exp-diff44.2%
exp-to-pow44.2%
hypot-define44.2%
*-commutative44.2%
exp-prod44.0%
fma-define44.0%
hypot-define80.1%
*-commutative80.1%
Simplified80.1%
Taylor expanded in y.re around inf 37.6%
+-commutative37.6%
associate-/l*37.5%
unpow237.5%
unpow237.5%
hypot-undefine68.6%
Simplified68.6%
Taylor expanded in y.re around inf 81.3%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)))
(if (or (<= y.re -8.8e-11) (not (<= y.re 2.55e-26)))
(*
(/ t_0 (+ 1.0 (* (atan2 x.im x.re) y.im)))
(cos (* (log (hypot x.re x.im)) y.im)))
(/ t_0 (pow (exp y.im) (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if ((y_46_re <= -8.8e-11) || !(y_46_re <= 2.55e-26)) {
tmp = (t_0 / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if ((y_46_re <= -8.8e-11) || !(y_46_re <= 2.55e-26)) {
tmp = (t_0 / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_0 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if (y_46_re <= -8.8e-11) or not (y_46_re <= 2.55e-26): tmp = (t_0 / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) else: tmp = t_0 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if ((y_46_re <= -8.8e-11) || !(y_46_re <= 2.55e-26)) tmp = Float64(Float64(t_0 / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = Float64(t_0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if ((y_46_re <= -8.8e-11) || ~((y_46_re <= 2.55e-26))) tmp = (t_0 / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = t_0 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -8.8e-11], N[Not[LessEqual[y$46$re, 2.55e-26]], $MachinePrecision]], N[(N[(t$95$0 / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -8.8 \cdot 10^{-11} \lor \neg \left(y.re \leq 2.55 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{t\_0}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\end{array}
\end{array}
if y.re < -8.8000000000000006e-11 or 2.54999999999999995e-26 < y.re Initial program 42.1%
exp-diff35.7%
exp-to-pow35.7%
hypot-define35.7%
*-commutative35.7%
exp-prod34.3%
fma-define34.3%
hypot-define60.8%
*-commutative60.8%
Simplified60.8%
Taylor expanded in y.re around inf 34.3%
+-commutative34.3%
associate-/l*35.0%
unpow235.0%
unpow235.0%
hypot-undefine61.5%
Simplified61.5%
Taylor expanded in y.re around 0 36.8%
+-commutative36.8%
unpow236.8%
unpow236.8%
hypot-undefine68.5%
Simplified68.5%
Taylor expanded in y.im around 0 83.2%
if -8.8000000000000006e-11 < y.re < 2.54999999999999995e-26Initial program 45.1%
exp-diff45.1%
exp-to-pow45.1%
hypot-define45.1%
*-commutative45.1%
exp-prod44.8%
fma-define44.8%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.re around inf 37.9%
+-commutative37.9%
associate-/l*37.0%
unpow237.0%
unpow237.0%
hypot-undefine67.9%
Simplified67.9%
Taylor expanded in y.re around 0 44.8%
+-commutative44.8%
unpow244.8%
unpow244.8%
hypot-undefine81.0%
Simplified81.0%
Taylor expanded in y.im around 0 83.0%
Final simplification83.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ -1.0 x.im))))
(if (<= x.im -1.08e-185)
(*
(cos (* y.im t_0))
(exp (- (* (atan2 x.im x.re) (- y.im)) (* y.re t_0))))
(if (<= x.im 3.1e-77)
(* (pow (hypot x.re x.im) y.re) (cos (* (log (hypot x.re x.im)) y.im)))
(*
(cos (* y.im (- (log x.im))))
(exp (- (* y.re (log x.im)) (* (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((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -1.08e-185) {
tmp = cos((y_46_im * t_0)) * exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0)));
} else if (x_46_im <= 3.1e-77) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = cos((y_46_im * -log(x_46_im))) * exp(((y_46_re * log(x_46_im)) - (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.log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -1.08e-185) {
tmp = Math.cos((y_46_im * t_0)) * Math.exp(((Math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0)));
} else if (x_46_im <= 3.1e-77) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = Math.cos((y_46_im * -Math.log(x_46_im))) * Math.exp(((y_46_re * Math.log(x_46_im)) - (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.log((-1.0 / x_46_im)) tmp = 0 if x_46_im <= -1.08e-185: tmp = math.cos((y_46_im * t_0)) * math.exp(((math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) elif x_46_im <= 3.1e-77: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.cos((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) else: tmp = math.cos((y_46_im * -math.log(x_46_im))) * math.exp(((y_46_re * math.log(x_46_im)) - (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 = log(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -1.08e-185) tmp = Float64(cos(Float64(y_46_im * t_0)) * exp(Float64(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) - Float64(y_46_re * t_0)))); elseif (x_46_im <= 3.1e-77) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = Float64(cos(Float64(y_46_im * Float64(-log(x_46_im)))) * exp(Float64(Float64(y_46_re * log(x_46_im)) - 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 = log((-1.0 / x_46_im)); tmp = 0.0; if (x_46_im <= -1.08e-185) tmp = cos((y_46_im * t_0)) * exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))); elseif (x_46_im <= 3.1e-77) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = cos((y_46_im * -log(x_46_im))) * exp(((y_46_re * log(x_46_im)) - (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[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.08e-185], N[(N[Cos[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision] - N[(y$46$re * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 3.1e-77], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * (-N[Log[x$46$im], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -1.08 \cdot 10^{-185}:\\
\;\;\;\;\cos \left(y.im \cdot t\_0\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right) - y.re \cdot t\_0}\\
\mathbf{elif}\;x.im \leq 3.1 \cdot 10^{-77}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \left(-\log x.im\right)\right) \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if x.im < -1.08e-185Initial program 45.7%
exp-diff42.3%
exp-to-pow42.3%
hypot-define42.3%
*-commutative42.3%
exp-prod41.5%
fma-define41.5%
hypot-define68.5%
*-commutative68.5%
Simplified68.5%
Taylor expanded in y.re around inf 36.4%
+-commutative36.4%
associate-/l*36.4%
unpow236.4%
unpow236.4%
hypot-undefine60.0%
Simplified60.0%
Taylor expanded in y.re around 0 43.2%
+-commutative43.2%
unpow243.2%
unpow243.2%
hypot-undefine74.5%
Simplified74.5%
Taylor expanded in x.im around -inf 75.7%
associate-/l*75.7%
mul-1-neg75.7%
cos-neg75.7%
div-exp84.2%
mul-1-neg84.2%
*-commutative84.2%
Simplified84.2%
if -1.08e-185 < x.im < 3.10000000000000008e-77Initial program 48.4%
exp-diff44.2%
exp-to-pow44.2%
hypot-define44.2%
*-commutative44.2%
exp-prod42.5%
fma-define42.5%
hypot-define73.0%
*-commutative73.0%
Simplified73.0%
Taylor expanded in y.im around 0 72.2%
Taylor expanded in y.re around 0 48.4%
+-commutative48.4%
unpow248.4%
unpow248.4%
hypot-undefine77.7%
Simplified77.7%
if 3.10000000000000008e-77 < x.im Initial program 33.8%
exp-diff30.8%
exp-to-pow30.8%
hypot-define30.8%
*-commutative30.8%
exp-prod30.8%
fma-define30.8%
hypot-define69.2%
*-commutative69.2%
Simplified69.2%
Taylor expanded in y.re around inf 27.7%
+-commutative27.7%
associate-/l*26.2%
unpow226.2%
unpow226.2%
hypot-undefine64.6%
Simplified64.6%
Taylor expanded in y.re around 0 30.1%
+-commutative30.1%
unpow230.1%
unpow230.1%
hypot-undefine68.8%
Simplified68.8%
Taylor expanded in x.im around inf 71.9%
associate-/l*71.9%
mul-1-neg71.9%
cos-neg71.9%
log-rec71.9%
div-exp82.7%
mul-1-neg82.7%
*-commutative82.7%
log-rec82.7%
Simplified82.7%
Final simplification82.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)))
(if (or (<= y.re -0.012) (not (<= y.re 9e+46)))
(* t_0 (cos (* (log (hypot x.re x.im)) y.im)))
(/ t_0 (pow (exp y.im) (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if ((y_46_re <= -0.012) || !(y_46_re <= 9e+46)) {
tmp = t_0 * cos((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if ((y_46_re <= -0.012) || !(y_46_re <= 9e+46)) {
tmp = t_0 * Math.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_0 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if (y_46_re <= -0.012) or not (y_46_re <= 9e+46): tmp = t_0 * math.cos((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) else: tmp = t_0 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if ((y_46_re <= -0.012) || !(y_46_re <= 9e+46)) tmp = Float64(t_0 * cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = Float64(t_0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if ((y_46_re <= -0.012) || ~((y_46_re <= 9e+46))) tmp = t_0 * cos((log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = t_0 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -0.012], N[Not[LessEqual[y$46$re, 9e+46]], $MachinePrecision]], N[(t$95$0 * N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -0.012 \lor \neg \left(y.re \leq 9 \cdot 10^{+46}\right):\\
\;\;\;\;t\_0 \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\end{array}
\end{array}
if y.re < -0.012 or 9.00000000000000019e46 < y.re Initial program 43.5%
exp-diff36.3%
exp-to-pow36.3%
hypot-define36.3%
*-commutative36.3%
exp-prod34.7%
fma-define34.7%
hypot-define60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in y.im around 0 74.0%
Taylor expanded in y.re around 0 42.8%
+-commutative42.8%
unpow242.8%
unpow242.8%
hypot-undefine81.5%
Simplified81.5%
if -0.012 < y.re < 9.00000000000000019e46Initial program 43.4%
exp-diff43.4%
exp-to-pow43.4%
hypot-define43.4%
*-commutative43.4%
exp-prod43.2%
fma-define43.2%
hypot-define78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in y.re around inf 37.1%
+-commutative37.1%
associate-/l*37.1%
unpow237.1%
unpow237.1%
hypot-undefine68.0%
Simplified68.0%
Taylor expanded in y.re around 0 42.9%
+-commutative42.9%
unpow242.9%
unpow242.9%
hypot-undefine79.8%
Simplified79.8%
Taylor expanded in y.im around 0 81.6%
Final simplification81.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -0.012) (not (<= y.re 2.55e-26))) (pow (hypot x.im x.re) y.re) (/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -0.012) || !(y_46_re <= 2.55e-26)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -0.012) || !(y_46_re <= 2.55e-26)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 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));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -0.012) or not (y_46_re <= 2.55e-26): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = 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)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -0.012) || !(y_46_re <= 2.55e-26)) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -0.012) || ~((y_46_re <= 2.55e-26))) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -0.012], N[Not[LessEqual[y$46$re, 2.55e-26]], $MachinePrecision]], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.012 \lor \neg \left(y.re \leq 2.55 \cdot 10^{-26}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\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}}}\\
\end{array}
\end{array}
if y.re < -0.012 or 2.54999999999999995e-26 < y.re Initial program 42.3%
exp-diff35.8%
exp-to-pow35.8%
hypot-define35.8%
*-commutative35.8%
exp-prod34.3%
fma-define34.3%
hypot-define60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in y.re around inf 34.3%
+-commutative34.3%
associate-/l*35.0%
unpow235.0%
unpow235.0%
hypot-undefine60.6%
Simplified60.6%
Taylor expanded in y.re around 0 36.9%
+-commutative36.9%
unpow236.9%
unpow236.9%
hypot-undefine67.9%
Simplified67.9%
Taylor expanded in y.im around 0 78.8%
unpow278.8%
unpow278.8%
hypot-undefine80.0%
Simplified80.0%
if -0.012 < y.re < 2.54999999999999995e-26Initial program 44.8%
exp-diff44.8%
exp-to-pow44.8%
hypot-define44.8%
*-commutative44.8%
exp-prod44.5%
fma-define44.5%
hypot-define81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in y.re around inf 37.8%
+-commutative37.8%
associate-/l*36.9%
unpow236.9%
unpow236.9%
hypot-undefine68.7%
Simplified68.7%
Taylor expanded in y.re around 0 44.5%
+-commutative44.5%
unpow244.5%
unpow244.5%
hypot-undefine81.4%
Simplified81.4%
Taylor expanded in y.im around 0 82.5%
Final simplification81.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5.2e+14)
(pow (sqrt (+ (pow x.im 2.0) (pow x.re 2.0))) y.re)
(if (<= y.im 1.4e+33)
(pow (hypot x.im x.re) y.re)
(*
(cos (* y.re (atan2 x.im x.re)))
(pow (+ x.re (* 0.5 (/ (pow x.im 2.0) x.re))) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -5.2e+14) {
tmp = pow(sqrt((pow(x_46_im, 2.0) + pow(x_46_re, 2.0))), y_46_re);
} else if (y_46_im <= 1.4e+33) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow((x_46_re + (0.5 * (pow(x_46_im, 2.0) / x_46_re))), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -5.2e+14) {
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 <= 1.4e+33) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow((x_46_re + (0.5 * (Math.pow(x_46_im, 2.0) / x_46_re))), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -5.2e+14: 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 <= 1.4e+33: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow((x_46_re + (0.5 * (math.pow(x_46_im, 2.0) / x_46_re))), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -5.2e+14) tmp = sqrt(Float64((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re; elseif (y_46_im <= 1.4e+33) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (Float64(x_46_re + Float64(0.5 * Float64((x_46_im ^ 2.0) / x_46_re))) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -5.2e+14) tmp = sqrt(((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re; elseif (y_46_im <= 1.4e+33) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * ((x_46_re + (0.5 * ((x_46_im ^ 2.0) / x_46_re))) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -5.2e+14], 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, 1.4e+33], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[(x$46$re + N[(0.5 * N[(N[Power[x$46$im, 2.0], $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.2 \cdot 10^{+14}:\\
\;\;\;\;{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 1.4 \cdot 10^{+33}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(x.re + 0.5 \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -5.2e14Initial program 33.9%
exp-diff27.4%
exp-to-pow27.4%
hypot-define27.4%
*-commutative27.4%
exp-prod25.8%
fma-define25.8%
hypot-define50.4%
*-commutative50.4%
Simplified50.4%
Taylor expanded in y.re around inf 19.4%
+-commutative19.4%
associate-/l*19.4%
unpow219.4%
unpow219.4%
hypot-undefine35.6%
Simplified35.6%
Taylor expanded in y.re around 0 24.2%
+-commutative24.2%
unpow224.2%
unpow224.2%
hypot-undefine48.7%
Simplified48.7%
Taylor expanded in y.im around 0 43.3%
if -5.2e14 < y.im < 1.4e33Initial program 52.4%
exp-diff51.7%
exp-to-pow51.7%
hypot-define51.7%
*-commutative51.7%
exp-prod51.0%
fma-define51.0%
hypot-define87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in y.re around inf 51.0%
+-commutative51.0%
associate-/l*51.0%
unpow251.0%
unpow251.0%
hypot-undefine87.2%
Simplified87.2%
Taylor expanded in y.re around 0 54.2%
+-commutative54.2%
unpow254.2%
unpow254.2%
hypot-undefine95.5%
Simplified95.5%
Taylor expanded in y.im around 0 77.4%
unpow277.4%
unpow277.4%
hypot-undefine94.0%
Simplified94.0%
if 1.4e33 < y.im Initial program 30.0%
exp-diff22.1%
exp-to-pow22.1%
hypot-define22.1%
*-commutative22.1%
exp-prod21.6%
fma-define21.6%
hypot-define45.3%
*-commutative45.3%
Simplified45.3%
Taylor expanded in y.im around 0 35.0%
Taylor expanded in y.im around 0 48.6%
Taylor expanded in x.im around 0 46.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.26e+14) (not (<= y.im 210.0))) (pow (sqrt (+ (pow x.im 2.0) (pow x.re 2.0))) y.re) (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.26e+14) || !(y_46_im <= 210.0)) {
tmp = pow(sqrt((pow(x_46_im, 2.0) + pow(x_46_re, 2.0))), y_46_re);
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.26e+14) || !(y_46_im <= 210.0)) {
tmp = Math.pow(Math.sqrt((Math.pow(x_46_im, 2.0) + Math.pow(x_46_re, 2.0))), y_46_re);
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.26e+14) or not (y_46_im <= 210.0): tmp = math.pow(math.sqrt((math.pow(x_46_im, 2.0) + math.pow(x_46_re, 2.0))), y_46_re) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.26e+14) || !(y_46_im <= 210.0)) tmp = sqrt(Float64((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re; else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.26e+14) || ~((y_46_im <= 210.0))) tmp = sqrt(((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re; else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.26e+14], N[Not[LessEqual[y$46$im, 210.0]], $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], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.26 \cdot 10^{+14} \lor \neg \left(y.im \leq 210\right):\\
\;\;\;\;{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -1.26e14 or 210 < y.im Initial program 31.6%
exp-diff24.6%
exp-to-pow24.6%
hypot-define24.6%
*-commutative24.6%
exp-prod23.5%
fma-define23.5%
hypot-define47.2%
*-commutative47.2%
Simplified47.2%
Taylor expanded in y.re around inf 16.5%
+-commutative16.5%
associate-/l*16.5%
unpow216.5%
unpow216.5%
hypot-undefine34.9%
Simplified34.9%
Taylor expanded in y.re around 0 22.6%
+-commutative22.6%
unpow222.6%
unpow222.6%
hypot-undefine46.4%
Simplified46.4%
Taylor expanded in y.im around 0 44.9%
if -1.26e14 < y.im < 210Initial program 53.2%
exp-diff52.5%
exp-to-pow52.5%
hypot-define52.5%
*-commutative52.5%
exp-prod51.8%
fma-define51.8%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.re around inf 51.8%
+-commutative51.8%
associate-/l*51.7%
unpow251.7%
unpow251.7%
hypot-undefine88.5%
Simplified88.5%
Taylor expanded in y.re around 0 55.0%
+-commutative55.0%
unpow255.0%
unpow255.0%
hypot-undefine96.8%
Simplified96.8%
Taylor expanded in y.im around 0 77.8%
unpow277.8%
unpow277.8%
hypot-undefine94.7%
Simplified94.7%
Final simplification72.3%
(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 43.5%
exp-diff39.9%
exp-to-pow39.9%
hypot-define39.9%
*-commutative39.9%
exp-prod39.1%
fma-define39.1%
hypot-define70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in y.re around inf 35.9%
+-commutative35.9%
associate-/l*35.9%
unpow235.9%
unpow235.9%
hypot-undefine64.4%
Simplified64.4%
Taylor expanded in y.re around 0 40.5%
+-commutative40.5%
unpow240.5%
unpow240.5%
hypot-undefine74.2%
Simplified74.2%
Taylor expanded in y.im around 0 63.0%
unpow263.0%
unpow263.0%
hypot-undefine67.3%
Simplified67.3%
herbie shell --seed 2024106
(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)))))