
(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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \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 20 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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \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 (log (hypot x.re x.im)))
(t_1 (exp (- (* t_0 y.re) (* y.im (atan2 x.im x.re)))))
(t_2 (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(if (<= y.im -1.8e+15)
(*
t_1
(sin
(fabs (fma (atan2 x.im x.re) y.re (* y.im (log (hypot x.im x.re)))))))
(if (<= y.im 6.4e+27)
(* t_1 (sin t_2))
(* t_1 (sin (pow (sqrt (pow (cbrt t_2) 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 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(((t_0 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_2 = fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -1.8e+15) {
tmp = t_1 * sin(fabs(fma(atan2(x_46_im, x_46_re), y_46_re, (y_46_im * log(hypot(x_46_im, x_46_re))))));
} else if (y_46_im <= 6.4e+27) {
tmp = t_1 * sin(t_2);
} else {
tmp = t_1 * sin(pow(sqrt(pow(cbrt(t_2), 2.0)), 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(Float64(Float64(t_0 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) t_2 = fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -1.8e+15) tmp = Float64(t_1 * sin(abs(fma(atan(x_46_im, x_46_re), y_46_re, Float64(y_46_im * log(hypot(x_46_im, x_46_re))))))); elseif (y_46_im <= 6.4e+27) tmp = Float64(t_1 * sin(t_2)); else tmp = Float64(t_1 * sin((sqrt((cbrt(t_2) ^ 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.8e+15], N[(t$95$1 * N[Sin[N[Abs[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 6.4e+27], N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[Power[N[Sqrt[N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_2 := \mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -1.8 \cdot 10^{+15}:\\
\;\;\;\;t_1 \cdot \sin \left(\left|\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right|\right)\\
\mathbf{elif}\;y.im \leq 6.4 \cdot 10^{+27}:\\
\;\;\;\;t_1 \cdot \sin t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left({\left(\sqrt{{\left(\sqrt[3]{t_2}\right)}^{2}}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.im < -1.8e15Initial program 26.3%
Simplified65.0%
fma-udef65.0%
hypot-udef26.3%
*-commutative26.3%
add-sqr-sqrt10.7%
sqrt-unprod13.1%
pow213.1%
fma-def13.1%
hypot-udef30.4%
Applied egg-rr30.4%
unpow230.4%
rem-sqrt-square77.9%
fma-def77.9%
+-commutative77.9%
fma-def77.9%
hypot-def30.7%
unpow230.7%
unpow230.7%
+-commutative30.7%
*-commutative30.7%
unpow230.7%
unpow230.7%
hypot-def77.9%
Simplified77.9%
if -1.8e15 < y.im < 6.4000000000000003e27Initial program 52.9%
Simplified93.3%
if 6.4000000000000003e27 < y.im Initial program 30.7%
Simplified64.6%
fma-udef64.6%
hypot-udef30.7%
*-commutative30.7%
add-cube-cbrt32.6%
pow334.2%
hypot-udef71.6%
*-commutative71.6%
fma-udef71.6%
*-commutative71.6%
Applied egg-rr71.6%
add-sqr-sqrt50.6%
sqrt-unprod79.7%
pow279.7%
Applied egg-rr79.7%
Final simplification86.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (- (* t_0 y.re) (* y.im (atan2 x.im x.re)))))
(t_2 (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(if (<= y.im -1e+17)
(*
t_1
(sin
(fabs (fma (atan2 x.im x.re) y.re (* y.im (log (hypot x.im x.re)))))))
(if (<= y.im 0.00096)
(* t_1 (sin t_2))
(* t_1 (sin (pow (pow (cbrt t_2) 2.0) 1.5)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(((t_0 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_2 = fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -1e+17) {
tmp = t_1 * sin(fabs(fma(atan2(x_46_im, x_46_re), y_46_re, (y_46_im * log(hypot(x_46_im, x_46_re))))));
} else if (y_46_im <= 0.00096) {
tmp = t_1 * sin(t_2);
} else {
tmp = t_1 * sin(pow(pow(cbrt(t_2), 2.0), 1.5));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(Float64(Float64(t_0 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) t_2 = fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -1e+17) tmp = Float64(t_1 * sin(abs(fma(atan(x_46_im, x_46_re), y_46_re, Float64(y_46_im * log(hypot(x_46_im, x_46_re))))))); elseif (y_46_im <= 0.00096) tmp = Float64(t_1 * sin(t_2)); else tmp = Float64(t_1 * sin(((cbrt(t_2) ^ 2.0) ^ 1.5))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1e+17], N[(t$95$1 * N[Sin[N[Abs[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 0.00096], N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[Power[N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 2.0], $MachinePrecision], 1.5], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_2 := \mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -1 \cdot 10^{+17}:\\
\;\;\;\;t_1 \cdot \sin \left(\left|\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right|\right)\\
\mathbf{elif}\;y.im \leq 0.00096:\\
\;\;\;\;t_1 \cdot \sin t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left({\left({\left(\sqrt[3]{t_2}\right)}^{2}\right)}^{1.5}\right)\\
\end{array}
\end{array}
if y.im < -1e17Initial program 26.3%
Simplified65.0%
fma-udef65.0%
hypot-udef26.3%
*-commutative26.3%
add-sqr-sqrt10.7%
sqrt-unprod13.1%
pow213.1%
fma-def13.1%
hypot-udef30.4%
Applied egg-rr30.4%
unpow230.4%
rem-sqrt-square77.9%
fma-def77.9%
+-commutative77.9%
fma-def77.9%
hypot-def30.7%
unpow230.7%
unpow230.7%
+-commutative30.7%
*-commutative30.7%
unpow230.7%
unpow230.7%
hypot-def77.9%
Simplified77.9%
if -1e17 < y.im < 9.60000000000000024e-4Initial program 53.8%
Simplified94.5%
if 9.60000000000000024e-4 < y.im Initial program 30.9%
Simplified64.8%
fma-udef64.8%
hypot-udef30.9%
*-commutative30.9%
add-cube-cbrt32.6%
pow334.1%
hypot-udef69.7%
*-commutative69.7%
fma-udef69.7%
*-commutative69.7%
Applied egg-rr69.7%
add-sqr-sqrt47.6%
sqrt-unprod77.1%
pow277.1%
Applied egg-rr77.1%
sqrt-pow278.3%
pow-to-exp43.6%
pow-exp47.4%
add-log-exp47.4%
pow-to-exp72.4%
metadata-eval72.4%
Applied egg-rr72.4%
exp-to-pow78.3%
*-commutative78.3%
Simplified78.3%
Final simplification86.4%
(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) (* y.im (atan2 x.im x.re))))))
(if (<= y.im -2e+15)
(* t_2 (sin (fabs (fma (atan2 x.im x.re) y.re t_0))))
(if (<= y.im 0.00048)
(* t_2 (sin (fma t_1 y.im (* y.re (atan2 x.im x.re)))))
(* t_2 (sin (pow (cbrt t_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) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -2e+15) {
tmp = t_2 * sin(fabs(fma(atan2(x_46_im, x_46_re), y_46_re, t_0)));
} else if (y_46_im <= 0.00048) {
tmp = t_2 * sin(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = t_2 * sin(pow(cbrt(t_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(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -2e+15) tmp = Float64(t_2 * sin(abs(fma(atan(x_46_im, x_46_re), y_46_re, t_0)))); elseif (y_46_im <= 0.00048) tmp = Float64(t_2 * sin(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(t_2 * sin((cbrt(t_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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -2e+15], N[(t$95$2 * N[Sin[N[Abs[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 0.00048], N[(t$95$2 * N[Sin[N[(t$95$1 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[Power[N[Power[t$95$0, 1/3], $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 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{+15}:\\
\;\;\;\;t_2 \cdot \sin \left(\left|\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, t_0\right)\right|\right)\\
\mathbf{elif}\;y.im \leq 0.00048:\\
\;\;\;\;t_2 \cdot \sin \left(\mathsf{fma}\left(t_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin \left({\left(\sqrt[3]{t_0}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.im < -2e15Initial program 26.3%
Simplified65.0%
fma-udef65.0%
hypot-udef26.3%
*-commutative26.3%
add-sqr-sqrt10.7%
sqrt-unprod13.1%
pow213.1%
fma-def13.1%
hypot-udef30.4%
Applied egg-rr30.4%
unpow230.4%
rem-sqrt-square77.9%
fma-def77.9%
+-commutative77.9%
fma-def77.9%
hypot-def30.7%
unpow230.7%
unpow230.7%
+-commutative30.7%
*-commutative30.7%
unpow230.7%
unpow230.7%
hypot-def77.9%
Simplified77.9%
if -2e15 < y.im < 4.80000000000000012e-4Initial program 53.8%
Simplified94.5%
if 4.80000000000000012e-4 < y.im Initial program 30.9%
Simplified64.8%
fma-udef64.8%
hypot-udef30.9%
*-commutative30.9%
add-cube-cbrt32.6%
pow334.1%
hypot-udef69.7%
*-commutative69.7%
fma-udef69.7%
*-commutative69.7%
Applied egg-rr69.7%
Taylor expanded in y.re around 0 17.7%
unpow1/334.1%
+-commutative34.1%
unpow234.1%
unpow234.1%
hypot-def72.7%
hypot-def34.1%
unpow234.1%
unpow234.1%
+-commutative34.1%
unpow234.1%
unpow234.1%
hypot-def72.7%
log-pow1.5%
log-pow72.7%
Simplified72.7%
Final simplification85.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (- (* t_0 y.re) (* y.im (atan2 x.im x.re))))))
(if (or (<= y.im -2e+138) (not (<= y.im 0.00043)))
(* t_1 (sin (pow (cbrt (* y.im (log (hypot x.im x.re)))) 3.0)))
(* t_1 (sin (fma t_0 y.im (* 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 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(((t_0 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if ((y_46_im <= -2e+138) || !(y_46_im <= 0.00043)) {
tmp = t_1 * sin(pow(cbrt((y_46_im * log(hypot(x_46_im, x_46_re)))), 3.0));
} else {
tmp = t_1 * sin(fma(t_0, y_46_im, (y_46_re * 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 = log(hypot(x_46_re, x_46_im)) t_1 = exp(Float64(Float64(t_0 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if ((y_46_im <= -2e+138) || !(y_46_im <= 0.00043)) tmp = Float64(t_1 * sin((cbrt(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) ^ 3.0))); else tmp = Float64(t_1 * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -2e+138], N[Not[LessEqual[y$46$im, 0.00043]], $MachinePrecision]], N[(t$95$1 * N[Sin[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], N[(t$95$1 * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{+138} \lor \neg \left(y.im \leq 0.00043\right):\\
\;\;\;\;t_1 \cdot \sin \left({\left(\sqrt[3]{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if y.im < -2.0000000000000001e138 or 4.29999999999999989e-4 < y.im Initial program 27.3%
Simplified61.1%
fma-udef61.1%
hypot-udef27.3%
*-commutative27.3%
add-cube-cbrt27.5%
pow330.5%
hypot-udef67.7%
*-commutative67.7%
fma-udef68.7%
*-commutative68.7%
Applied egg-rr68.7%
Taylor expanded in y.re around 0 14.2%
unpow1/330.5%
+-commutative30.5%
unpow230.5%
unpow230.5%
hypot-def70.8%
hypot-def30.5%
unpow230.5%
unpow230.5%
+-commutative30.5%
unpow230.5%
unpow230.5%
hypot-def70.8%
log-pow1.0%
log-pow70.8%
Simplified70.8%
if -2.0000000000000001e138 < y.im < 4.29999999999999989e-4Initial program 50.5%
Simplified91.8%
Final simplification83.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -1.45e-46) (not (<= y.re 1.7e-21)))
(* (exp (- (* t_0 y.re) (* y.im (atan2 x.im x.re)))) (sin t_1))
(* (sin (fma t_0 y.im t_1)) (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 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -1.45e-46) || !(y_46_re <= 1.7e-21)) {
tmp = exp(((t_0 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin(t_1);
} else {
tmp = sin(fma(t_0, y_46_im, t_1)) * exp((y_46_im * -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 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -1.45e-46) || !(y_46_re <= 1.7e-21)) tmp = Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(t_1)); else tmp = Float64(sin(fma(t_0, y_46_im, t_1)) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -1.45e-46], N[Not[LessEqual[y$46$re, 1.7e-21]], $MachinePrecision]], N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1.45 \cdot 10^{-46} \lor \neg \left(y.re \leq 1.7 \cdot 10^{-21}\right):\\
\;\;\;\;e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin t_1\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_0, y.im, t_1\right)\right) \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -1.45000000000000002e-46 or 1.7e-21 < y.re Initial program 39.0%
Simplified75.9%
Taylor expanded in y.im around 0 80.2%
if -1.45000000000000002e-46 < y.re < 1.7e-21Initial program 44.6%
exp-diff44.5%
+-rgt-identity44.5%
+-rgt-identity44.5%
exp-to-pow44.5%
hypot-def44.5%
*-commutative44.5%
exp-prod44.2%
fma-def44.2%
hypot-def84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in y.re around 0 84.9%
rec-exp84.9%
distribute-rgt-neg-in84.9%
Simplified84.9%
Final simplification82.3%
(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 (- (* t_1 y.re) (* y.im (atan2 x.im x.re))))))
(if (<= y.re -1.42e-8)
(* t_2 (sin (fabs t_0)))
(if (<= y.re 1.6e-22)
(* (sin (fma t_1 y.im t_0)) (exp (* y.im (- (atan2 x.im x.re)))))
(* t_2 (sin 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(((t_1 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.42e-8) {
tmp = t_2 * sin(fabs(t_0));
} else if (y_46_re <= 1.6e-22) {
tmp = sin(fma(t_1, y_46_im, t_0)) * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = t_2 * sin(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 = exp(Float64(Float64(t_1 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -1.42e-8) tmp = Float64(t_2 * sin(abs(t_0))); elseif (y_46_re <= 1.6e-22) tmp = Float64(sin(fma(t_1, y_46_im, t_0)) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(t_2 * sin(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[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.42e-8], N[(t$95$2 * N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-22], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[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^{t_1 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -1.42 \cdot 10^{-8}:\\
\;\;\;\;t_2 \cdot \sin \left(\left|t_0\right|\right)\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-22}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right) \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin t_0\\
\end{array}
\end{array}
if y.re < -1.41999999999999998e-8Initial program 38.6%
Simplified84.3%
Taylor expanded in y.im around 0 82.9%
*-commutative82.9%
add-sqr-sqrt58.6%
sqrt-unprod57.1%
pow257.1%
Applied egg-rr57.1%
*-commutative57.1%
unpow257.1%
rem-sqrt-square90.0%
Simplified90.0%
if -1.41999999999999998e-8 < y.re < 1.59999999999999994e-22Initial program 44.0%
exp-diff44.0%
+-rgt-identity44.0%
+-rgt-identity44.0%
exp-to-pow44.0%
hypot-def44.0%
*-commutative44.0%
exp-prod43.7%
fma-def43.7%
hypot-def82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in y.re around 0 82.9%
rec-exp82.9%
distribute-rgt-neg-in82.9%
Simplified82.9%
if 1.59999999999999994e-22 < y.re Initial program 40.0%
Simplified69.2%
Taylor expanded in y.im around 0 78.5%
Final simplification83.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.im (atan2 x.im x.re)))
(t_2 (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -4.5e-45) (not (<= y.re 1.7e-21)))
(* (exp (- (* t_0 y.re) t_1)) (sin t_2))
(/ (sin (fma t_0 y.im t_2)) (exp t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -4.5e-45) || !(y_46_re <= 1.7e-21)) {
tmp = exp(((t_0 * y_46_re) - t_1)) * sin(t_2);
} else {
tmp = sin(fma(t_0, y_46_im, t_2)) / exp(t_1);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -4.5e-45) || !(y_46_re <= 1.7e-21)) tmp = Float64(exp(Float64(Float64(t_0 * y_46_re) - t_1)) * sin(t_2)); else tmp = Float64(sin(fma(t_0, y_46_im, t_2)) / exp(t_1)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -4.5e-45], N[Not[LessEqual[y$46$re, 1.7e-21]], $MachinePrecision]], N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision] / N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-45} \lor \neg \left(y.re \leq 1.7 \cdot 10^{-21}\right):\\
\;\;\;\;e^{t_0 \cdot y.re - t_1} \cdot \sin t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(t_0, y.im, t_2\right)\right)}{e^{t_1}}\\
\end{array}
\end{array}
if y.re < -4.4999999999999999e-45 or 1.7e-21 < y.re Initial program 39.0%
Simplified75.9%
Taylor expanded in y.im around 0 80.2%
if -4.4999999999999999e-45 < y.re < 1.7e-21Initial program 44.6%
*-commutative44.6%
exp-diff44.5%
associate-*r/44.5%
associate-/l*44.5%
fma-def44.5%
hypot-def55.8%
*-commutative55.8%
Simplified80.5%
Taylor expanded in y.re around 0 84.9%
Final simplification82.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (* y.re (atan2 x.im x.re))))
(if (or (<= y.im -160.0) (not (<= y.im 1.35e+14)))
(* (exp (- (* t_0 y.re) (* y.im (atan2 x.im x.re)))) (sin t_1))
(* (sin (fma t_0 y.im t_1)) (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 t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -160.0) || !(y_46_im <= 1.35e+14)) {
tmp = exp(((t_0 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin(t_1);
} else {
tmp = sin(fma(t_0, y_46_im, t_1)) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -160.0) || !(y_46_im <= 1.35e+14)) tmp = Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(t_1)); else tmp = Float64(sin(fma(t_0, y_46_im, t_1)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -160.0], N[Not[LessEqual[y$46$im, 1.35e+14]], $MachinePrecision]], N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -160 \lor \neg \left(y.im \leq 1.35 \cdot 10^{+14}\right):\\
\;\;\;\;e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin t_1\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_0, y.im, t_1\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -160 or 1.35e14 < y.im Initial program 30.0%
Simplified65.5%
Taylor expanded in y.im around 0 69.9%
if -160 < y.im < 1.35e14Initial program 53.1%
exp-diff53.0%
+-rgt-identity53.0%
+-rgt-identity53.0%
exp-to-pow53.0%
hypot-def53.0%
*-commutative53.0%
exp-prod53.0%
fma-def53.0%
hypot-def94.4%
*-commutative94.4%
Simplified94.4%
Taylor expanded in y.im around 0 73.6%
unpow273.6%
unpow273.6%
hypot-def92.6%
Simplified92.6%
Final simplification81.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))))
(if (or (<= y.re -3.2e-184) (not (<= y.re 3e-179)))
(*
(exp (- (* (log (hypot x.re x.im)) y.re) t_0))
(sin (* y.re (atan2 x.im x.re))))
(*
(* y.im (log (hypot x.im x.re)))
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) 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_im * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -3.2e-184) || !(y_46_re <= 3e-179)) {
tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = (y_46_im * log(hypot(x_46_im, x_46_re))) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_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 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -3.2e-184) || !(y_46_re <= 3e-179)) {
tmp = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = (y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))) * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_re <= -3.2e-184) or not (y_46_re <= 3e-179): tmp = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = (y_46_im * math.log(math.hypot(x_46_im, x_46_re))) * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -3.2e-184) || !(y_46_re <= 3e-179)) tmp = Float64(exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(Float64(y_46_im * log(hypot(x_46_im, x_46_re))) * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_re <= -3.2e-184) || ~((y_46_re <= 3e-179))) tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = (y_46_im * log(hypot(x_46_im, x_46_re))) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -3.2e-184], N[Not[LessEqual[y$46$re, 3e-179]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -3.2 \cdot 10^{-184} \lor \neg \left(y.re \leq 3 \cdot 10^{-179}\right):\\
\;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\
\end{array}
\end{array}
if y.re < -3.2e-184 or 3.00000000000000006e-179 < y.re Initial program 39.3%
Simplified78.4%
Taylor expanded in y.im around 0 75.7%
if -3.2e-184 < y.re < 3.00000000000000006e-179Initial program 49.8%
Taylor expanded in y.re around 0 46.1%
unpow246.1%
unpow246.1%
hypot-def58.3%
Simplified58.3%
Taylor expanded in y.im around 0 49.1%
+-commutative49.1%
unpow249.1%
unpow249.1%
hypot-def57.2%
hypot-def49.1%
unpow249.1%
unpow249.1%
+-commutative49.1%
unpow249.1%
unpow249.1%
hypot-def57.2%
Simplified57.2%
Final simplification71.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.im (log (hypot x.im x.re)))))
(t_1 (* y.im (atan2 x.im x.re))))
(if (<= x.im -1.5e-282)
(* (exp (- (* y.re (log (- x.im))) t_1)) t_0)
(if (or (<= x.im 1.4e-179)
(and (not (<= x.im 3.3e-131)) (<= x.im 8.5e-39)))
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(* t_0 (exp (- (* y.re (log x.im)) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -1.5e-282) {
tmp = exp(((y_46_re * log(-x_46_im)) - t_1)) * t_0;
} else if ((x_46_im <= 1.4e-179) || (!(x_46_im <= 3.3e-131) && (x_46_im <= 8.5e-39))) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * exp(((y_46_re * log(x_46_im)) - t_1));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_1 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -1.5e-282) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_1)) * t_0;
} else if ((x_46_im <= 1.4e-179) || (!(x_46_im <= 3.3e-131) && (x_46_im <= 8.5e-39))) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_1));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_1 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_im <= -1.5e-282: tmp = math.exp(((y_46_re * math.log(-x_46_im)) - t_1)) * t_0 elif (x_46_im <= 1.4e-179) or (not (x_46_im <= 3.3e-131) and (x_46_im <= 8.5e-39)): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * math.exp(((y_46_re * math.log(x_46_im)) - t_1)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -1.5e-282) tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_1)) * t_0); elseif ((x_46_im <= 1.4e-179) || (!(x_46_im <= 3.3e-131) && (x_46_im <= 8.5e-39))) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_1))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); t_1 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_im <= -1.5e-282) tmp = exp(((y_46_re * log(-x_46_im)) - t_1)) * t_0; elseif ((x_46_im <= 1.4e-179) || (~((x_46_im <= 3.3e-131)) && (x_46_im <= 8.5e-39))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0 * exp(((y_46_re * log(x_46_im)) - t_1)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -1.5e-282], N[(N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[Or[LessEqual[x$46$im, 1.4e-179], And[N[Not[LessEqual[x$46$im, 3.3e-131]], $MachinePrecision], LessEqual[x$46$im, 8.5e-39]]], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -1.5 \cdot 10^{-282}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t_1} \cdot t_0\\
\mathbf{elif}\;x.im \leq 1.4 \cdot 10^{-179} \lor \neg \left(x.im \leq 3.3 \cdot 10^{-131}\right) \land x.im \leq 8.5 \cdot 10^{-39}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot e^{y.re \cdot \log x.im - t_1}\\
\end{array}
\end{array}
if x.im < -1.5e-282Initial program 39.9%
Taylor expanded in y.re around 0 36.2%
unpow236.2%
unpow236.2%
hypot-def60.9%
Simplified60.9%
Taylor expanded in x.im around -inf 69.0%
mul-1-neg69.0%
Simplified69.0%
if -1.5e-282 < x.im < 1.4e-179 or 3.3000000000000002e-131 < x.im < 8.5000000000000005e-39Initial program 48.2%
Simplified73.3%
Taylor expanded in y.im around 0 68.8%
Taylor expanded in y.im around 0 59.8%
unpow259.8%
unpow259.8%
hypot-def62.2%
Simplified62.2%
if 1.4e-179 < x.im < 3.3000000000000002e-131 or 8.5000000000000005e-39 < x.im Initial program 40.4%
Taylor expanded in y.re around 0 36.8%
unpow236.8%
unpow236.8%
hypot-def58.9%
Simplified58.9%
Taylor expanded in x.re around 0 73.9%
Final simplification69.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (sin (* y.re (atan2 x.im x.re))))
(t_2 (exp (- (* y.re (log x.re)) t_0)))
(t_3 (* y.im (log x.re))))
(if (<= x.re -1.08e-89)
(* t_1 (exp (- (* (log (/ -1.0 x.re)) (- y.re)) t_0)))
(if (<= x.re 2.7e-302)
(* t_1 (pow (hypot x.im x.re) y.re))
(if (<= x.re 9e-130)
(* (sin (* y.im (log (hypot x.im x.re)))) t_2)
(if (<= x.re 5.5e+78)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_3)
(* t_2 (sin t_3))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = exp(((y_46_re * log(x_46_re)) - t_0));
double t_3 = y_46_im * log(x_46_re);
double tmp;
if (x_46_re <= -1.08e-89) {
tmp = t_1 * exp(((log((-1.0 / x_46_re)) * -y_46_re) - t_0));
} else if (x_46_re <= 2.7e-302) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (x_46_re <= 9e-130) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_2;
} else if (x_46_re <= 5.5e+78) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_3;
} else {
tmp = t_2 * sin(t_3);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
double t_3 = y_46_im * Math.log(x_46_re);
double tmp;
if (x_46_re <= -1.08e-89) {
tmp = t_1 * Math.exp(((Math.log((-1.0 / x_46_re)) * -y_46_re) - t_0));
} else if (x_46_re <= 2.7e-302) {
tmp = t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (x_46_re <= 9e-130) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_2;
} else if (x_46_re <= 5.5e+78) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_3;
} else {
tmp = t_2 * Math.sin(t_3);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_2 = math.exp(((y_46_re * math.log(x_46_re)) - t_0)) t_3 = y_46_im * math.log(x_46_re) tmp = 0 if x_46_re <= -1.08e-89: tmp = t_1 * math.exp(((math.log((-1.0 / x_46_re)) * -y_46_re) - t_0)) elif x_46_re <= 2.7e-302: tmp = t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif x_46_re <= 9e-130: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * t_2 elif x_46_re <= 5.5e+78: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_3 else: tmp = t_2 * math.sin(t_3) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0)) t_3 = Float64(y_46_im * log(x_46_re)) tmp = 0.0 if (x_46_re <= -1.08e-89) tmp = Float64(t_1 * exp(Float64(Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_re)) - t_0))); elseif (x_46_re <= 2.7e-302) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (x_46_re <= 9e-130) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * t_2); elseif (x_46_re <= 5.5e+78) 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_0)) * t_3); else tmp = Float64(t_2 * sin(t_3)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); t_2 = exp(((y_46_re * log(x_46_re)) - t_0)); t_3 = y_46_im * log(x_46_re); tmp = 0.0; if (x_46_re <= -1.08e-89) tmp = t_1 * exp(((log((-1.0 / x_46_re)) * -y_46_re) - t_0)); elseif (x_46_re <= 2.7e-302) tmp = t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (x_46_re <= 9e-130) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_2; elseif (x_46_re <= 5.5e+78) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_3; else tmp = t_2 * sin(t_3); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -1.08e-89], N[(t$95$1 * N[Exp[N[(N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$re)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.7e-302], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 9e-130], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[x$46$re, 5.5e+78], 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$0), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision], N[(t$95$2 * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := e^{y.re \cdot \log x.re - t_0}\\
t_3 := y.im \cdot \log x.re\\
\mathbf{if}\;x.re \leq -1.08 \cdot 10^{-89}:\\
\;\;\;\;t_1 \cdot e^{\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.re\right) - t_0}\\
\mathbf{elif}\;x.re \leq 2.7 \cdot 10^{-302}:\\
\;\;\;\;t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 9 \cdot 10^{-130}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t_2\\
\mathbf{elif}\;x.re \leq 5.5 \cdot 10^{+78}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot t_3\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin t_3\\
\end{array}
\end{array}
if x.re < -1.07999999999999999e-89Initial program 35.0%
Simplified84.2%
Taylor expanded in y.im around 0 69.6%
Taylor expanded in x.re around -inf 68.3%
mul-1-neg68.3%
Simplified68.3%
if -1.07999999999999999e-89 < x.re < 2.70000000000000006e-302Initial program 56.8%
Simplified88.2%
Taylor expanded in y.im around 0 75.4%
Taylor expanded in y.im around 0 54.5%
unpow254.5%
unpow254.5%
hypot-def62.3%
Simplified62.3%
if 2.70000000000000006e-302 < x.re < 9e-130Initial program 35.3%
Taylor expanded in y.re around 0 38.6%
unpow238.6%
unpow238.6%
hypot-def82.8%
Simplified82.8%
Taylor expanded in x.re around inf 74.2%
if 9e-130 < x.re < 5.4999999999999997e78Initial program 56.2%
Taylor expanded in y.re around 0 54.2%
unpow254.2%
unpow254.2%
hypot-def62.7%
Simplified62.7%
Taylor expanded in x.im around 0 58.7%
Taylor expanded in y.im around 0 66.3%
if 5.4999999999999997e78 < x.re Initial program 26.4%
Taylor expanded in y.re around 0 24.7%
unpow224.7%
unpow224.7%
hypot-def48.5%
Simplified48.5%
Taylor expanded in x.im around 0 48.5%
Taylor expanded in x.re around inf 67.4%
Final simplification67.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))))
(if (or (<= y.re -4.8e-208) (not (<= y.re 4.3e-225)))
(*
(exp (- (* (log (hypot x.re x.im)) y.re) t_0))
(sin (* y.re (atan2 x.im x.re))))
(*
(exp (- (* y.re (log (- x.im))) t_0))
(sin (* y.im (log (hypot x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -4.8e-208) || !(y_46_re <= 4.3e-225)) {
tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = exp(((y_46_re * log(-x_46_im)) - t_0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -4.8e-208) || !(y_46_re <= 4.3e-225)) {
tmp = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0)) * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_re <= -4.8e-208) or not (y_46_re <= 4.3e-225): tmp = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -4.8e-208) || !(y_46_re <= 4.3e-225)) tmp = Float64(exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0)) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_re <= -4.8e-208) || ~((y_46_re <= 4.3e-225))) tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = exp(((y_46_re * log(-x_46_im)) - t_0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -4.8e-208], N[Not[LessEqual[y$46$re, 4.3e-225]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -4.8 \cdot 10^{-208} \lor \neg \left(y.re \leq 4.3 \cdot 10^{-225}\right):\\
\;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t_0} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -4.7999999999999998e-208 or 4.29999999999999979e-225 < y.re Initial program 40.5%
Simplified79.2%
Taylor expanded in y.im around 0 73.2%
if -4.7999999999999998e-208 < y.re < 4.29999999999999979e-225Initial program 47.7%
Taylor expanded in y.re around 0 45.0%
unpow245.0%
unpow245.0%
hypot-def57.0%
Simplified57.0%
Taylor expanded in x.im around -inf 56.7%
mul-1-neg56.7%
Simplified56.7%
Final simplification70.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* t_0 (exp (* y.im (- (atan2 x.im x.re))))))
(t_2 (* (sin t_0) (pow (hypot x.im x.re) y.re))))
(if (<= y.re -5.4e-15)
t_2
(if (<= y.re -2.35e-209)
t_1
(if (<= y.re 3e-179)
(*
(exp (- (* y.re (log x.re)) (* y.im (atan2 x.im x.re))))
(sin (* y.im (log x.re))))
(if (<= y.re 5.5) t_1 t_2))))))
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 = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
double t_2 = sin(t_0) * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -5.4e-15) {
tmp = t_2;
} else if (y_46_re <= -2.35e-209) {
tmp = t_1;
} else if (y_46_re <= 3e-179) {
tmp = exp(((y_46_re * log(x_46_re)) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin((y_46_im * log(x_46_re)));
} else if (y_46_re <= 5.5) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = t_0 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
double t_2 = Math.sin(t_0) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -5.4e-15) {
tmp = t_2;
} else if (y_46_re <= -2.35e-209) {
tmp = t_1;
} else if (y_46_re <= 3e-179) {
tmp = Math.exp(((y_46_re * Math.log(x_46_re)) - (y_46_im * Math.atan2(x_46_im, x_46_re)))) * Math.sin((y_46_im * Math.log(x_46_re)));
} else if (y_46_re <= 5.5) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = t_0 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) t_2 = math.sin(t_0) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -5.4e-15: tmp = t_2 elif y_46_re <= -2.35e-209: tmp = t_1 elif y_46_re <= 3e-179: tmp = math.exp(((y_46_re * math.log(x_46_re)) - (y_46_im * math.atan2(x_46_im, x_46_re)))) * math.sin((y_46_im * math.log(x_46_re))) elif y_46_re <= 5.5: tmp = t_1 else: tmp = t_2 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 = Float64(t_0 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) t_2 = Float64(sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -5.4e-15) tmp = t_2; elseif (y_46_re <= -2.35e-209) tmp = t_1; elseif (y_46_re <= 3e-179) tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_re)) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(y_46_im * log(x_46_re)))); elseif (y_46_re <= 5.5) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re))); t_2 = sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re); tmp = 0.0; if (y_46_re <= -5.4e-15) tmp = t_2; elseif (y_46_re <= -2.35e-209) tmp = t_1; elseif (y_46_re <= 3e-179) tmp = exp(((y_46_re * log(x_46_re)) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin((y_46_im * log(x_46_re))); elseif (y_46_re <= 5.5) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5.4e-15], t$95$2, If[LessEqual[y$46$re, -2.35e-209], t$95$1, If[LessEqual[y$46$re, 3e-179], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.5], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := t_0 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_2 := \sin t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -5.4 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq -2.35 \cdot 10^{-209}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{-179}:\\
\;\;\;\;e^{y.re \cdot \log x.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\mathbf{elif}\;y.re \leq 5.5:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y.re < -5.40000000000000018e-15 or 5.5 < y.re Initial program 39.8%
Simplified78.2%
Taylor expanded in y.im around 0 81.2%
Taylor expanded in y.im around 0 71.6%
unpow271.6%
unpow271.6%
hypot-def72.4%
Simplified72.4%
if -5.40000000000000018e-15 < y.re < -2.35e-209 or 3.00000000000000006e-179 < y.re < 5.5Initial program 41.4%
Simplified80.6%
Taylor expanded in y.im around 0 64.7%
Taylor expanded in y.re around 0 64.7%
distribute-rgt-neg-in64.7%
Simplified64.7%
if -2.35e-209 < y.re < 3.00000000000000006e-179Initial program 46.5%
Taylor expanded in y.re around 0 44.4%
unpow244.4%
unpow244.4%
hypot-def56.1%
Simplified56.1%
Taylor expanded in x.im around 0 28.1%
Taylor expanded in x.re around inf 41.2%
Final simplification64.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.5e-13) (not (<= y.re 4.2))) (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)) (* (atan2 x.im x.re) (* y.re (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 <= -2.5e-13) || !(y_46_re <= 4.2)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = atan2(x_46_im, x_46_re) * (y_46_re * 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 <= -2.5e-13) || !(y_46_re <= 4.2)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.atan2(x_46_im, x_46_re) * (y_46_re * 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 <= -2.5e-13) or not (y_46_re <= 4.2): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.atan2(x_46_im, x_46_re) * (y_46_re * 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 <= -2.5e-13) || !(y_46_re <= 4.2)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(atan(x_46_im, x_46_re) * Float64(y_46_re * exp(Float64(y_46_im * Float64(-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 <= -2.5e-13) || ~((y_46_re <= 4.2))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = atan2(x_46_im, x_46_re) * (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, -2.5e-13], N[Not[LessEqual[y$46$re, 4.2]], $MachinePrecision]], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(y$46$re * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.5 \cdot 10^{-13} \lor \neg \left(y.re \leq 4.2\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(y.re \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\end{array}
\end{array}
if y.re < -2.49999999999999995e-13 or 4.20000000000000018 < y.re Initial program 39.8%
Simplified78.2%
Taylor expanded in y.im around 0 81.2%
Taylor expanded in y.im around 0 71.6%
unpow271.6%
unpow271.6%
hypot-def72.4%
Simplified72.4%
if -2.49999999999999995e-13 < y.re < 4.20000000000000018Initial program 43.3%
Simplified81.8%
Taylor expanded in y.im around 0 50.3%
Taylor expanded in y.re around 0 50.3%
distribute-rgt-neg-in50.3%
Simplified50.3%
Taylor expanded in y.im around -inf 52.0%
associate-*r*52.0%
neg-mul-152.0%
distribute-rgt-neg-in52.0%
Simplified52.0%
Final simplification62.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (expm1 (* y.re (atan2 x.im x.re)))))
(if (or (<= y.im -2.75e-15) (not (<= y.im 4.5e-33)))
(log (+ 1.0 t_0))
(log1p t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = expm1((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -2.75e-15) || !(y_46_im <= 4.5e-33)) {
tmp = log((1.0 + t_0));
} else {
tmp = log1p(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.expm1((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -2.75e-15) || !(y_46_im <= 4.5e-33)) {
tmp = Math.log((1.0 + t_0));
} else {
tmp = Math.log1p(t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.expm1((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_im <= -2.75e-15) or not (y_46_im <= 4.5e-33): tmp = math.log((1.0 + t_0)) else: tmp = math.log1p(t_0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = expm1(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_im <= -2.75e-15) || !(y_46_im <= 4.5e-33)) tmp = log(Float64(1.0 + t_0)); else tmp = log1p(t_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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -2.75e-15], N[Not[LessEqual[y$46$im, 4.5e-33]], $MachinePrecision]], N[Log[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision], N[Log[1 + t$95$0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -2.75 \cdot 10^{-15} \lor \neg \left(y.im \leq 4.5 \cdot 10^{-33}\right):\\
\;\;\;\;\log \left(1 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(t_0\right)\\
\end{array}
\end{array}
if y.im < -2.7500000000000001e-15 or 4.49999999999999991e-33 < y.im Initial program 33.6%
Simplified68.6%
Taylor expanded in y.im around 0 68.4%
Taylor expanded in y.re around 0 47.4%
distribute-rgt-neg-in47.4%
Simplified47.4%
Taylor expanded in y.im around 0 3.9%
*-commutative3.9%
log1p-expm1-u9.6%
log1p-udef28.8%
Applied egg-rr28.8%
if -2.7500000000000001e-15 < y.im < 4.49999999999999991e-33Initial program 51.7%
Simplified94.5%
Taylor expanded in y.im around 0 63.7%
Taylor expanded in y.re around 0 23.5%
distribute-rgt-neg-in23.5%
Simplified23.5%
Taylor expanded in y.im around 0 23.5%
*-commutative23.5%
log1p-expm1-u25.8%
Applied egg-rr25.8%
Final simplification27.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (* y.re (atan2 x.im x.re)) (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) {
return (y_46_re * atan2(x_46_im, x_46_re)) * exp((y_46_im * -atan2(x_46_im, x_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
code = (y_46re * atan2(x_46im, x_46re)) * exp((y_46im * -atan2(x_46im, x_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (y_46_re * Math.atan2(x_46_im, x_46_re)) * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return (y_46_re * math.atan2(x_46_im, x_46_re)) * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = (y_46_re * atan2(x_46_im, x_46_re)) * exp((y_46_im * -atan2(x_46_im, x_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}
\end{array}
Initial program 41.5%
Simplified79.9%
Taylor expanded in y.im around 0 66.4%
Taylor expanded in y.re around 0 36.9%
distribute-rgt-neg-in36.9%
Simplified36.9%
Final simplification36.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (atan2 x.im x.re) (* y.re (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) {
return atan2(x_46_im, x_46_re) * (y_46_re * exp((y_46_im * -atan2(x_46_im, x_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
code = atan2(x_46im, x_46re) * (y_46re * exp((y_46im * -atan2(x_46im, x_46re))))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.atan2(x_46_im, x_46_re) * (y_46_re * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.atan2(x_46_im, x_46_re) * (y_46_re * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(atan(x_46_im, x_46_re) * Float64(y_46_re * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = atan2(x_46_im, x_46_re) * (y_46_re * exp((y_46_im * -atan2(x_46_im, x_46_re)))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(y$46$re * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(y.re \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)
\end{array}
Initial program 41.5%
Simplified79.9%
Taylor expanded in y.im around 0 66.4%
Taylor expanded in y.re around 0 36.9%
distribute-rgt-neg-in36.9%
Simplified36.9%
Taylor expanded in y.im around -inf 37.7%
associate-*r*37.7%
neg-mul-137.7%
distribute-rgt-neg-in37.7%
Simplified37.7%
Final simplification37.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.im -2.3e-6) (not (<= y.im 2.7e-195)))
(cbrt (pow t_0 3.0))
(log1p (expm1 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 tmp;
if ((y_46_im <= -2.3e-6) || !(y_46_im <= 2.7e-195)) {
tmp = cbrt(pow(t_0, 3.0));
} else {
tmp = log1p(expm1(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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -2.3e-6) || !(y_46_im <= 2.7e-195)) {
tmp = Math.cbrt(Math.pow(t_0, 3.0));
} else {
tmp = Math.log1p(Math.expm1(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)) tmp = 0.0 if ((y_46_im <= -2.3e-6) || !(y_46_im <= 2.7e-195)) tmp = cbrt((t_0 ^ 3.0)); else tmp = log1p(expm1(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]}, If[Or[LessEqual[y$46$im, -2.3e-6], N[Not[LessEqual[y$46$im, 2.7e-195]], $MachinePrecision]], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision], N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -2.3 \cdot 10^{-6} \lor \neg \left(y.im \leq 2.7 \cdot 10^{-195}\right):\\
\;\;\;\;\sqrt[3]{{t_0}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t_0\right)\right)\\
\end{array}
\end{array}
if y.im < -2.3e-6 or 2.7e-195 < y.im Initial program 35.0%
Simplified73.3%
Taylor expanded in y.im around 0 65.2%
Taylor expanded in y.re around 0 40.9%
distribute-rgt-neg-in40.9%
Simplified40.9%
Taylor expanded in y.im around 0 6.3%
*-commutative6.3%
add-cbrt-cube21.2%
pow321.2%
Applied egg-rr21.2%
if -2.3e-6 < y.im < 2.7e-195Initial program 57.3%
Simplified95.9%
Taylor expanded in y.im around 0 69.3%
Taylor expanded in y.re around 0 27.4%
distribute-rgt-neg-in27.4%
Simplified27.4%
Taylor expanded in y.im around 0 27.4%
*-commutative27.4%
log1p-expm1-u31.0%
Applied egg-rr31.0%
Final simplification24.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (log1p (expm1 (* 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) {
return log1p(expm1((y_46_re * atan2(x_46_im, x_46_re))));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.log1p(Math.expm1((y_46_re * Math.atan2(x_46_im, x_46_re))));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.log1p(math.expm1((y_46_re * math.atan2(x_46_im, x_46_re))))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return log1p(expm1(Float64(y_46_re * atan(x_46_im, x_46_re)))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Log[1 + N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{log1p}\left(\mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
Initial program 41.5%
Simplified79.9%
Taylor expanded in y.im around 0 66.4%
Taylor expanded in y.re around 0 36.9%
distribute-rgt-neg-in36.9%
Simplified36.9%
Taylor expanded in y.im around 0 12.5%
*-commutative12.5%
log1p-expm1-u16.7%
Applied egg-rr16.7%
Final simplification16.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 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) {
return y_46_re * atan2(x_46_im, x_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
code = y_46re * atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * Math.atan2(x_46_im, x_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * math.atan2(x_46_im, x_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 41.5%
Simplified79.9%
Taylor expanded in y.im around 0 66.4%
Taylor expanded in y.re around 0 36.9%
distribute-rgt-neg-in36.9%
Simplified36.9%
Taylor expanded in y.im around 0 12.5%
Final simplification12.5%
herbie shell --seed 2023178
(FPCore (x.re x.im y.re y.im)
:name "powComplex, imaginary part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))