
(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 12 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 (sqrt (log (hypot x.im x.re))))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (hypot x.re x.im)))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re -5e+160)
(* t_3 (cos (pow (cbrt (fma t_2 y.im t_1)) 3.0)))
(if (<= x.re -4e-236)
t_3
(if (<= x.re 5.5e+33)
(* t_3 (cos t_1))
(* t_3 (cos (* t_0 (* y.im t_0)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sqrt(log(hypot(x_46_im, x_46_re)));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(hypot(x_46_re, x_46_im));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -5e+160) {
tmp = t_3 * cos(pow(cbrt(fma(t_2, y_46_im, t_1)), 3.0));
} else if (x_46_re <= -4e-236) {
tmp = t_3;
} else if (x_46_re <= 5.5e+33) {
tmp = t_3 * cos(t_1);
} else {
tmp = t_3 * cos((t_0 * (y_46_im * t_0)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(log(hypot(x_46_im, x_46_re))) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(hypot(x_46_re, x_46_im)) t_3 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= -5e+160) tmp = Float64(t_3 * cos((cbrt(fma(t_2, y_46_im, t_1)) ^ 3.0))); elseif (x_46_re <= -4e-236) tmp = t_3; elseif (x_46_re <= 5.5e+33) tmp = Float64(t_3 * cos(t_1)); else tmp = Float64(t_3 * cos(Float64(t_0 * Float64(y_46_im * t_0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sqrt[N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -5e+160], N[(t$95$3 * N[Cos[N[Power[N[Power[N[(t$95$2 * y$46$im + t$95$1), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, -4e-236], t$95$3, If[LessEqual[x$46$re, 5.5e+33], N[(t$95$3 * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Cos[N[(t$95$0 * N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := e^{t_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq -5 \cdot 10^{+160}:\\
\;\;\;\;t_3 \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(t_2, y.im, t_1\right)}\right)}^{3}\right)\\
\mathbf{elif}\;x.re \leq -4 \cdot 10^{-236}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x.re \leq 5.5 \cdot 10^{+33}:\\
\;\;\;\;t_3 \cdot \cos t_1\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \cos \left(t_0 \cdot \left(y.im \cdot t_0\right)\right)\\
\end{array}
\end{array}
if x.re < -5.0000000000000002e160Initial program 0.0%
Simplified89.1%
add-cube-cbrt89.1%
pow394.6%
Applied egg-rr94.6%
if -5.0000000000000002e160 < x.re < -4.0000000000000002e-236Initial program 52.9%
Simplified72.2%
add-cube-cbrt73.3%
pow373.4%
Applied egg-rr73.4%
rem-cbrt-cube74.6%
pow1/333.7%
cube-mult33.7%
unpow-prod-down36.1%
Applied egg-rr76.9%
fma-def76.9%
+-commutative76.9%
fma-def76.9%
unpow1/380.5%
fma-def80.5%
+-commutative80.5%
fma-def80.5%
Simplified80.5%
Taylor expanded in y.re around inf 89.1%
if -4.0000000000000002e-236 < x.re < 5.5000000000000006e33Initial program 46.4%
Simplified76.7%
Taylor expanded in y.im around 0 84.5%
if 5.5000000000000006e33 < x.re Initial program 35.4%
Simplified77.2%
add-cube-cbrt75.1%
pow373.6%
Applied egg-rr73.6%
Taylor expanded in y.re around 0 18.4%
unpow1/334.0%
unpow234.0%
unpow234.0%
hypot-def75.3%
Simplified75.3%
rem-cube-cbrt77.2%
add-sqr-sqrt77.4%
associate-*r*79.5%
Applied egg-rr79.5%
Final simplification86.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (log (hypot x.im x.re))))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re -1e+161)
(* t_2 (cos (pow (cbrt (fma t_1 y.im (* y.re (atan2 x.im x.re)))) 3.0)))
(if (<= x.re -2.9e-268)
t_2
(*
t_2
(cos
(pow
(*
(pow
(pow (cbrt (fma y.re (atan2 x.im x.re) t_0)) 2.0)
0.16666666666666666)
(cbrt (pow (cbrt t_0) 2.0)))
3.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * log(hypot(x_46_im, x_46_re));
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -1e+161) {
tmp = t_2 * cos(pow(cbrt(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))), 3.0));
} else if (x_46_re <= -2.9e-268) {
tmp = t_2;
} else {
tmp = t_2 * cos(pow((pow(pow(cbrt(fma(y_46_re, atan2(x_46_im, x_46_re), t_0)), 2.0), 0.16666666666666666) * cbrt(pow(cbrt(t_0), 2.0))), 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= -1e+161) tmp = Float64(t_2 * cos((cbrt(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) ^ 3.0))); elseif (x_46_re <= -2.9e-268) tmp = t_2; else tmp = Float64(t_2 * cos((Float64(((cbrt(fma(y_46_re, atan(x_46_im, x_46_re), t_0)) ^ 2.0) ^ 0.16666666666666666) * cbrt((cbrt(t_0) ^ 2.0))) ^ 3.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$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $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[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -1e+161], N[(t$95$2 * N[Cos[N[Power[N[Power[N[(t$95$1 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, -2.9e-268], t$95$2, N[(t$95$2 * N[Cos[N[Power[N[(N[Power[N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + t$95$0), $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision], 0.16666666666666666], $MachinePrecision] * N[Power[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{t_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq -1 \cdot 10^{+161}:\\
\;\;\;\;t_2 \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(t_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}^{3}\right)\\
\mathbf{elif}\;x.re \leq -2.9 \cdot 10^{-268}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \cos \left({\left({\left({\left(\sqrt[3]{\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t_0\right)}\right)}^{2}\right)}^{0.16666666666666666} \cdot \sqrt[3]{{\left(\sqrt[3]{t_0}\right)}^{2}}\right)}^{3}\right)\\
\end{array}
\end{array}
if x.re < -1e161Initial program 0.0%
Simplified89.1%
add-cube-cbrt89.1%
pow394.6%
Applied egg-rr94.6%
if -1e161 < x.re < -2.9000000000000002e-268Initial program 50.4%
Simplified70.2%
add-cube-cbrt70.2%
pow370.2%
Applied egg-rr70.2%
rem-cbrt-cube71.3%
pow1/331.9%
cube-mult31.9%
unpow-prod-down34.1%
Applied egg-rr75.6%
fma-def75.6%
+-commutative75.6%
fma-def75.6%
unpow1/377.8%
fma-def77.8%
+-commutative77.8%
fma-def77.8%
Simplified77.8%
Taylor expanded in y.re around inf 86.7%
if -2.9000000000000002e-268 < x.re Initial program 42.6%
Simplified78.6%
add-cube-cbrt77.6%
pow376.1%
Applied egg-rr76.1%
rem-cbrt-cube75.5%
pow1/332.1%
cube-mult31.3%
unpow-prod-down31.4%
Applied egg-rr74.7%
fma-def74.7%
+-commutative74.7%
fma-def74.7%
unpow1/377.5%
fma-def77.5%
+-commutative77.5%
fma-def77.5%
Simplified77.5%
add-sqr-sqrt35.3%
sqrt-unprod77.5%
cbrt-prod75.6%
unpow275.6%
pow1/378.8%
sqrt-pow178.8%
Applied egg-rr43.0%
log-pow78.8%
Simplified78.8%
Taylor expanded in y.re around 0 45.2%
unpow245.2%
unpow245.2%
hypot-def82.4%
Simplified82.4%
Final simplification85.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sqrt (log (hypot x.im x.re))))
(t_1
(exp
(- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re -5e-212)
(* t_1 (cos (* (log (/ -1.0 x.re)) (- y.im))))
(if (<= x.re 4.2e+33)
(* t_1 (cos (* y.re (atan2 x.im x.re))))
(* t_1 (cos (* t_0 (* y.im t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sqrt(log(hypot(x_46_im, x_46_re)));
double t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -5e-212) {
tmp = t_1 * cos((log((-1.0 / x_46_re)) * -y_46_im));
} else if (x_46_re <= 4.2e+33) {
tmp = t_1 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = t_1 * cos((t_0 * (y_46_im * t_0)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sqrt(Math.log(Math.hypot(x_46_im, x_46_re)));
double t_1 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -5e-212) {
tmp = t_1 * Math.cos((Math.log((-1.0 / x_46_re)) * -y_46_im));
} else if (x_46_re <= 4.2e+33) {
tmp = t_1 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_1 * Math.cos((t_0 * (y_46_im * t_0)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sqrt(math.log(math.hypot(x_46_im, x_46_re))) t_1 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if x_46_re <= -5e-212: tmp = t_1 * math.cos((math.log((-1.0 / x_46_re)) * -y_46_im)) elif x_46_re <= 4.2e+33: tmp = t_1 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = t_1 * math.cos((t_0 * (y_46_im * t_0))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(log(hypot(x_46_im, x_46_re))) t_1 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= -5e-212) tmp = Float64(t_1 * cos(Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_im)))); elseif (x_46_re <= 4.2e+33) tmp = Float64(t_1 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(t_1 * cos(Float64(t_0 * Float64(y_46_im * t_0)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(log(hypot(x_46_im, x_46_re))); t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); tmp = 0.0; if (x_46_re <= -5e-212) tmp = t_1 * cos((log((-1.0 / x_46_re)) * -y_46_im)); elseif (x_46_re <= 4.2e+33) tmp = t_1 * cos((y_46_re * atan2(x_46_im, x_46_re))); else tmp = t_1 * cos((t_0 * (y_46_im * t_0))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sqrt[N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -5e-212], N[(t$95$1 * N[Cos[N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 4.2e+33], N[(t$95$1 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Cos[N[(t$95$0 * N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\\
t_1 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq -5 \cdot 10^{-212}:\\
\;\;\;\;t_1 \cdot \cos \left(\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.im\right)\right)\\
\mathbf{elif}\;x.re \leq 4.2 \cdot 10^{+33}:\\
\;\;\;\;t_1 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \cos \left(t_0 \cdot \left(y.im \cdot t_0\right)\right)\\
\end{array}
\end{array}
if x.re < -5.00000000000000043e-212Initial program 35.9%
Simplified78.0%
add-cube-cbrt78.8%
pow380.6%
Applied egg-rr80.6%
Taylor expanded in y.re around 0 17.5%
unpow1/341.1%
unpow241.1%
unpow241.1%
hypot-def82.4%
Simplified82.4%
Taylor expanded in x.re around -inf 87.6%
mul-1-neg87.6%
pow-base-187.6%
*-lft-identity87.6%
Simplified87.6%
if -5.00000000000000043e-212 < x.re < 4.2000000000000001e33Initial program 46.7%
Simplified75.9%
Taylor expanded in y.im around 0 84.4%
if 4.2000000000000001e33 < x.re Initial program 35.4%
Simplified77.2%
add-cube-cbrt75.1%
pow373.6%
Applied egg-rr73.6%
Taylor expanded in y.re around 0 18.4%
unpow1/334.0%
unpow234.0%
unpow234.0%
hypot-def75.3%
Simplified75.3%
rem-cube-cbrt77.2%
add-sqr-sqrt77.4%
associate-*r*79.5%
Applied egg-rr79.5%
Final simplification84.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re -2.5e-212)
(* t_0 (cos (* (log (/ -1.0 x.re)) (- y.im))))
(if (<= x.re 7e+47)
(* t_0 (cos (* y.re (atan2 x.im x.re))))
(* t_0 (cos (pow (cbrt (* y.im (log (hypot x.im x.re)))) 3.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -2.5e-212) {
tmp = t_0 * cos((log((-1.0 / x_46_re)) * -y_46_im));
} else if (x_46_re <= 7e+47) {
tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * cos(pow(cbrt((y_46_im * log(hypot(x_46_im, x_46_re)))), 3.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.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -2.5e-212) {
tmp = t_0 * Math.cos((Math.log((-1.0 / x_46_re)) * -y_46_im));
} else if (x_46_re <= 7e+47) {
tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * Math.cos(Math.pow(Math.cbrt((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))), 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= -2.5e-212) tmp = Float64(t_0 * cos(Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_im)))); elseif (x_46_re <= 7e+47) tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * cos((cbrt(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) ^ 3.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -2.5e-212], N[(t$95$0 * N[Cos[N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 7e+47], 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[Cos[N[Power[N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq -2.5 \cdot 10^{-212}:\\
\;\;\;\;t_0 \cdot \cos \left(\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.im\right)\right)\\
\mathbf{elif}\;x.re \leq 7 \cdot 10^{+47}:\\
\;\;\;\;t_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \cos \left({\left(\sqrt[3]{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right)\\
\end{array}
\end{array}
if x.re < -2.50000000000000022e-212Initial program 35.9%
Simplified78.0%
add-cube-cbrt78.8%
pow380.6%
Applied egg-rr80.6%
Taylor expanded in y.re around 0 17.5%
unpow1/341.1%
unpow241.1%
unpow241.1%
hypot-def82.4%
Simplified82.4%
Taylor expanded in x.re around -inf 87.6%
mul-1-neg87.6%
pow-base-187.6%
*-lft-identity87.6%
Simplified87.6%
if -2.50000000000000022e-212 < x.re < 7.00000000000000031e47Initial program 46.3%
Simplified77.3%
Taylor expanded in y.im around 0 85.3%
if 7.00000000000000031e47 < x.re Initial program 34.9%
Simplified75.1%
add-cube-cbrt74.7%
pow374.9%
Applied egg-rr74.9%
Taylor expanded in y.re around 0 18.2%
unpow1/335.2%
unpow235.2%
unpow235.2%
hypot-def76.7%
Simplified76.7%
Final simplification84.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re -2e-213)
(* t_0 (cos (* (log (/ -1.0 x.re)) (- y.im))))
(if (<= x.re 8.7e+74)
(* t_0 (cos (* y.re (atan2 x.im x.re))))
(* t_0 (cos (pow (cbrt (* y.im (log x.re))) 3.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -2e-213) {
tmp = t_0 * cos((log((-1.0 / x_46_re)) * -y_46_im));
} else if (x_46_re <= 8.7e+74) {
tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * cos(pow(cbrt((y_46_im * log(x_46_re))), 3.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.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -2e-213) {
tmp = t_0 * Math.cos((Math.log((-1.0 / x_46_re)) * -y_46_im));
} else if (x_46_re <= 8.7e+74) {
tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * Math.cos(Math.pow(Math.cbrt((y_46_im * Math.log(x_46_re))), 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= -2e-213) tmp = Float64(t_0 * cos(Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_im)))); elseif (x_46_re <= 8.7e+74) tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * cos((cbrt(Float64(y_46_im * log(x_46_re))) ^ 3.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -2e-213], N[(t$95$0 * N[Cos[N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 8.7e+74], 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[Cos[N[Power[N[Power[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq -2 \cdot 10^{-213}:\\
\;\;\;\;t_0 \cdot \cos \left(\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.im\right)\right)\\
\mathbf{elif}\;x.re \leq 8.7 \cdot 10^{+74}:\\
\;\;\;\;t_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \cos \left({\left(\sqrt[3]{y.im \cdot \log x.re}\right)}^{3}\right)\\
\end{array}
\end{array}
if x.re < -1.9999999999999999e-213Initial program 35.9%
Simplified78.0%
add-cube-cbrt78.8%
pow380.6%
Applied egg-rr80.6%
Taylor expanded in y.re around 0 17.5%
unpow1/341.1%
unpow241.1%
unpow241.1%
hypot-def82.4%
Simplified82.4%
Taylor expanded in x.re around -inf 87.6%
mul-1-neg87.6%
pow-base-187.6%
*-lft-identity87.6%
Simplified87.6%
if -1.9999999999999999e-213 < x.re < 8.69999999999999974e74Initial program 48.7%
Simplified79.2%
Taylor expanded in y.im around 0 85.4%
if 8.69999999999999974e74 < x.re Initial program 28.1%
Simplified70.9%
add-cube-cbrt70.4%
pow370.6%
Applied egg-rr70.6%
Taylor expanded in y.re around 0 12.8%
unpow1/328.5%
unpow228.5%
unpow228.5%
hypot-def72.7%
Simplified72.7%
Taylor expanded in x.im around 0 24.0%
unpow1/374.9%
Simplified74.9%
Final simplification84.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re -4e-212)
(* t_0 (cos (* (log (/ -1.0 x.re)) (- y.im))))
(* t_0 (cos (* y.re (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 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -4e-212) {
tmp = t_0 * cos((log((-1.0 / x_46_re)) * -y_46_im));
} else {
tmp = t_0 * cos((y_46_re * 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.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -4e-212) {
tmp = t_0 * Math.cos((Math.log((-1.0 / x_46_re)) * -y_46_im));
} else {
tmp = t_0 * Math.cos((y_46_re * 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.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if x_46_re <= -4e-212: tmp = t_0 * math.cos((math.log((-1.0 / x_46_re)) * -y_46_im)) else: tmp = t_0 * math.cos((y_46_re * 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 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= -4e-212) tmp = Float64(t_0 * cos(Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_im)))); else tmp = Float64(t_0 * cos(Float64(y_46_re * 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 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); tmp = 0.0; if (x_46_re <= -4e-212) tmp = t_0 * cos((log((-1.0 / x_46_re)) * -y_46_im)); else tmp = t_0 * cos((y_46_re * 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[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -4e-212], N[(t$95$0 * N[Cos[N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq -4 \cdot 10^{-212}:\\
\;\;\;\;t_0 \cdot \cos \left(\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if x.re < -3.99999999999999982e-212Initial program 35.9%
Simplified78.0%
add-cube-cbrt78.8%
pow380.6%
Applied egg-rr80.6%
Taylor expanded in y.re around 0 17.5%
unpow1/341.1%
unpow241.1%
unpow241.1%
hypot-def82.4%
Simplified82.4%
Taylor expanded in x.re around -inf 87.6%
mul-1-neg87.6%
pow-base-187.6%
*-lft-identity87.6%
Simplified87.6%
if -3.99999999999999982e-212 < x.re Initial program 41.9%
Simplified76.5%
Taylor expanded in y.im around 0 78.0%
Final simplification82.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re -4e-236) t_0 (* t_0 (cos (* y.re (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 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -4e-236) {
tmp = t_0;
} else {
tmp = t_0 * cos((y_46_re * 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.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -4e-236) {
tmp = t_0;
} else {
tmp = t_0 * Math.cos((y_46_re * 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.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if x_46_re <= -4e-236: tmp = t_0 else: tmp = t_0 * math.cos((y_46_re * 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 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= -4e-236) tmp = t_0; else tmp = Float64(t_0 * cos(Float64(y_46_re * 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 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); tmp = 0.0; if (x_46_re <= -4e-236) tmp = t_0; else tmp = t_0 * cos((y_46_re * 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[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -4e-236], t$95$0, N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq -4 \cdot 10^{-236}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if x.re < -4.0000000000000002e-236Initial program 36.6%
Simplified77.4%
add-cube-cbrt78.2%
pow379.9%
Applied egg-rr79.9%
rem-cbrt-cube79.9%
pow1/335.8%
cube-mult36.7%
unpow-prod-down38.3%
Applied egg-rr79.8%
fma-def79.8%
+-commutative79.8%
fma-def79.8%
unpow1/382.3%
fma-def82.3%
+-commutative82.3%
fma-def82.3%
Simplified82.3%
Taylor expanded in y.re around inf 85.7%
if -4.0000000000000002e-236 < x.re Initial program 41.5%
Simplified76.9%
Taylor expanded in y.im around 0 77.8%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re 3e-119) t_0 (* t_0 (cos (* y.im (log x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= 3e-119) {
tmp = t_0;
} else {
tmp = t_0 * cos((y_46_im * log(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.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= 3e-119) {
tmp = t_0;
} else {
tmp = t_0 * Math.cos((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if x_46_re <= 3e-119: tmp = t_0 else: tmp = t_0 * math.cos((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= 3e-119) tmp = t_0; else tmp = Float64(t_0 * cos(Float64(y_46_im * log(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 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); tmp = 0.0; if (x_46_re <= 3e-119) tmp = t_0; else tmp = t_0 * cos((y_46_im * log(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[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 3e-119], t$95$0, N[(t$95$0 * N[Cos[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq 3 \cdot 10^{-119}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \cos \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < 3.0000000000000002e-119Initial program 35.5%
Simplified77.6%
add-cube-cbrt78.2%
pow378.8%
Applied egg-rr78.8%
rem-cbrt-cube78.8%
pow1/333.7%
cube-mult34.3%
unpow-prod-down35.5%
Applied egg-rr79.4%
fma-def79.4%
+-commutative79.4%
fma-def79.4%
unpow1/381.8%
fma-def81.8%
+-commutative81.8%
fma-def81.8%
Simplified81.8%
Taylor expanded in y.re around inf 84.1%
if 3.0000000000000002e-119 < x.re Initial program 46.1%
Simplified76.2%
add-cube-cbrt73.7%
pow372.7%
Applied egg-rr72.7%
Taylor expanded in y.re around 0 22.4%
unpow1/346.3%
unpow246.3%
unpow246.3%
hypot-def77.2%
Simplified77.2%
Taylor expanded in x.im around 0 76.2%
pow-base-176.2%
*-lft-identity76.2%
Simplified76.2%
Final simplification81.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.65e+14)
(* (cos (* y.re (atan2 x.im x.re))) t_0)
(if (<= y.re 6.2e+22) (exp (* (atan2 x.im x.re) (- y.im))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -2.65e+14) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * t_0;
} else if (y_46_re <= 6.2e+22) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -2.65e+14) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * t_0;
} else if (y_46_re <= 6.2e+22) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -2.65e+14: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * t_0 elif y_46_re <= 6.2e+22: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -2.65e+14) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * t_0); elseif (y_46_re <= 6.2e+22) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -2.65e+14) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * t_0; elseif (y_46_re <= 6.2e+22) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -2.65e+14], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 6.2e+22], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -2.65 \cdot 10^{+14}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t_0\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{+22}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.re < -2.65e14Initial program 40.8%
exp-diff38.8%
exp-to-pow38.8%
hypot-def38.8%
*-commutative38.8%
exp-prod32.7%
fma-def32.7%
hypot-def67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in y.im around 0 77.7%
*-commutative77.7%
unpow277.7%
unpow277.7%
hypot-def77.7%
Simplified77.7%
if -2.65e14 < y.re < 6.2000000000000004e22Initial program 38.8%
exp-diff36.9%
exp-to-pow36.9%
hypot-def36.9%
*-commutative36.9%
exp-prod36.6%
fma-def36.6%
hypot-def77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in y.im around 0 79.9%
Taylor expanded in y.re around 0 80.1%
rec-exp80.1%
Simplified80.1%
Taylor expanded in y.re around 0 80.8%
if 6.2000000000000004e22 < y.re Initial program 38.9%
exp-diff27.8%
exp-to-pow27.8%
hypot-def27.8%
*-commutative27.8%
exp-prod27.8%
fma-def27.8%
hypot-def48.1%
*-commutative48.1%
Simplified48.1%
Taylor expanded in y.im around 0 55.7%
*-commutative55.7%
unpow255.7%
unpow255.7%
hypot-def55.7%
Simplified55.7%
Taylor expanded in y.re around 0 64.9%
Final simplification76.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (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.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (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(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (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[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}
\end{array}
Initial program 39.2%
Simplified77.1%
add-cube-cbrt76.6%
pow376.7%
Applied egg-rr76.7%
rem-cbrt-cube76.4%
pow1/333.2%
cube-mult33.2%
unpow-prod-down34.1%
Applied egg-rr76.7%
fma-def76.7%
+-commutative76.7%
fma-def76.7%
unpow1/378.9%
fma-def78.9%
+-commutative78.9%
fma-def78.9%
Simplified78.9%
Taylor expanded in y.re around inf 79.4%
Final simplification79.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.65e+14) (not (<= y.re 4.4e+21))) (pow (hypot x.im x.re) y.re) (exp (* (atan2 x.im x.re) (- y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.65e+14) || !(y_46_re <= 4.4e+21)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.65e+14) || !(y_46_re <= 4.4e+21)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -2.65e+14) or not (y_46_re <= 4.4e+21): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -2.65e+14) || !(y_46_re <= 4.4e+21)) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -2.65e+14) || ~((y_46_re <= 4.4e+21))) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.65e+14], N[Not[LessEqual[y$46$re, 4.4e+21]], $MachinePrecision]], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.65 \cdot 10^{+14} \lor \neg \left(y.re \leq 4.4 \cdot 10^{+21}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -2.65e14 or 4.4e21 < y.re Initial program 39.8%
exp-diff33.0%
exp-to-pow33.0%
hypot-def33.0%
*-commutative33.0%
exp-prod30.1%
fma-def30.1%
hypot-def57.3%
*-commutative57.3%
Simplified57.3%
Taylor expanded in y.im around 0 66.1%
*-commutative66.1%
unpow266.1%
unpow266.1%
hypot-def66.1%
Simplified66.1%
Taylor expanded in y.re around 0 71.0%
if -2.65e14 < y.re < 4.4e21Initial program 38.8%
exp-diff36.9%
exp-to-pow36.9%
hypot-def36.9%
*-commutative36.9%
exp-prod36.6%
fma-def36.6%
hypot-def77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in y.im around 0 79.9%
Taylor expanded in y.re around 0 80.1%
rec-exp80.1%
Simplified80.1%
Taylor expanded in y.re around 0 80.8%
Final simplification76.8%
(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 39.2%
exp-diff35.3%
exp-to-pow35.3%
hypot-def35.3%
*-commutative35.3%
exp-prod34.0%
fma-def34.0%
hypot-def69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in y.im around 0 49.2%
*-commutative49.2%
unpow249.2%
unpow249.2%
hypot-def56.6%
Simplified56.6%
Taylor expanded in y.re around 0 58.4%
Final simplification58.4%
herbie shell --seed 2023193
(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)))))