
(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 21 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 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (hypot x.re x.im)))
(t_3 (exp (- (* y.re t_2) t_0))))
(if (<= y.re -200000000000.0)
(* t_3 (sqrt (pow (sin t_1) 2.0)))
(if (<= y.re 2.85e+69)
(* t_3 (sin (pow (cbrt (fma t_2 y.im t_1)) 3.0)))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(sin (+ t_1 (fabs (* 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 = atan2(x_46_im, x_46_re) * y_46_im;
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(((y_46_re * t_2) - t_0));
double tmp;
if (y_46_re <= -200000000000.0) {
tmp = t_3 * sqrt(pow(sin(t_1), 2.0));
} else if (y_46_re <= 2.85e+69) {
tmp = t_3 * sin(pow(cbrt(fma(t_2, y_46_im, t_1)), 3.0));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin((t_1 + fabs((y_46_im * log(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(atan(x_46_im, x_46_re) * y_46_im) 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(y_46_re * t_2) - t_0)) tmp = 0.0 if (y_46_re <= -200000000000.0) tmp = Float64(t_3 * sqrt((sin(t_1) ^ 2.0))); elseif (y_46_re <= 2.85e+69) tmp = Float64(t_3 * sin((cbrt(fma(t_2, y_46_im, t_1)) ^ 3.0))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * sin(Float64(t_1 + abs(Float64(y_46_im * log(hypot(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $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[(y$46$re * t$95$2), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -200000000000.0], N[(t$95$3 * N[Sqrt[N[Power[N[Sin[t$95$1], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.85e+69], N[(t$95$3 * N[Sin[N[Power[N[Power[N[(t$95$2 * y$46$im + t$95$1), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 + N[Abs[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
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^{y.re \cdot t_2 - t_0}\\
\mathbf{if}\;y.re \leq -200000000000:\\
\;\;\;\;t_3 \cdot \sqrt{{\sin t_1}^{2}}\\
\mathbf{elif}\;y.re \leq 2.85 \cdot 10^{+69}:\\
\;\;\;\;t_3 \cdot \sin \left({\left(\sqrt[3]{\mathsf{fma}\left(t_2, y.im, t_1\right)}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot \sin \left(t_1 + \left|y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right|\right)\\
\end{array}
\end{array}
if y.re < -2e11Initial program 40.6%
hypot-def40.6%
fma-def40.6%
hypot-def78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in y.im around 0 82.6%
add-sqr-sqrt44.9%
sqrt-unprod91.3%
pow291.3%
*-commutative91.3%
Applied egg-rr91.3%
if -2e11 < y.re < 2.85e69Initial program 34.2%
hypot-def34.2%
fma-def34.2%
hypot-def82.3%
*-commutative82.3%
Simplified82.3%
fma-udef82.3%
hypot-udef34.2%
*-commutative34.2%
add-cube-cbrt33.3%
pow334.0%
hypot-udef84.3%
*-commutative84.3%
fma-udef84.3%
*-commutative84.3%
Applied egg-rr84.3%
if 2.85e69 < y.re Initial program 46.3%
add-sqr-sqrt19.5%
sqrt-unprod34.1%
pow234.1%
hypot-udef56.1%
Applied egg-rr56.1%
unpow256.1%
rem-sqrt-square75.6%
hypot-def46.3%
unpow246.3%
unpow246.3%
+-commutative46.3%
*-commutative46.3%
unpow246.3%
unpow246.3%
hypot-def75.6%
Simplified75.6%
Final simplification84.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* y.re (log (hypot x.re x.im))) (* (atan2 x.im x.re) y.im)))))
(if (<= y.re -45000000000000.0)
(* t_0 (sqrt (pow (sin (* y.re (atan2 x.im x.re))) 2.0)))
(*
t_0
(pow
(cbrt
(sin
(fma
(atan2 x.im x.re)
y.re
(pow (* (cbrt (log (hypot x.im x.re))) (cbrt y.im)) 3.0))))
3.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -45000000000000.0) {
tmp = t_0 * sqrt(pow(sin((y_46_re * atan2(x_46_im, x_46_re))), 2.0));
} else {
tmp = t_0 * pow(cbrt(sin(fma(atan2(x_46_im, x_46_re), y_46_re, pow((cbrt(log(hypot(x_46_im, x_46_re))) * cbrt(y_46_im)), 3.0)))), 3.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -45000000000000.0) tmp = Float64(t_0 * sqrt((sin(Float64(y_46_re * atan(x_46_im, x_46_re))) ^ 2.0))); else tmp = Float64(t_0 * (cbrt(sin(fma(atan(x_46_im, x_46_re), y_46_re, (Float64(cbrt(log(hypot(x_46_im, x_46_re))) * cbrt(y_46_im)) ^ 3.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[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -45000000000000.0], N[(t$95$0 * N[Sqrt[N[Power[N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Power[N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[Power[N[(N[Power[N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[y$46$im, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -45000000000000:\\
\;\;\;\;t_0 \cdot \sqrt{{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {\left(\sqrt[3]{\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, {\left(\sqrt[3]{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot \sqrt[3]{y.im}\right)}^{3}\right)\right)}\right)}^{3}\\
\end{array}
\end{array}
if y.re < -4.5e13Initial program 40.9%
hypot-def40.9%
fma-def40.9%
hypot-def78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in y.im around 0 83.3%
add-sqr-sqrt45.5%
sqrt-unprod90.9%
pow290.9%
*-commutative90.9%
Applied egg-rr90.9%
if -4.5e13 < y.re Initial program 36.8%
hypot-def36.8%
fma-def36.8%
hypot-def79.6%
*-commutative79.6%
Simplified79.6%
fma-udef79.6%
hypot-udef36.8%
*-commutative36.8%
add-sqr-sqrt20.1%
sqrt-unprod15.8%
pow215.8%
fma-def15.8%
hypot-udef32.1%
Applied egg-rr32.1%
unpow232.1%
rem-sqrt-square59.2%
hypot-def28.7%
unpow228.7%
unpow228.7%
+-commutative28.7%
*-commutative28.7%
fma-def28.7%
*-commutative28.7%
+-commutative28.7%
fma-def28.7%
unpow228.7%
unpow228.7%
hypot-def59.2%
Simplified59.2%
add-cube-cbrt58.9%
pow358.9%
add-sqr-sqrt42.4%
fabs-sqr42.4%
add-sqr-sqrt79.0%
fma-udef79.0%
*-commutative79.0%
fma-def79.0%
Applied egg-rr79.0%
add-cube-cbrt80.5%
pow381.5%
Applied egg-rr81.5%
*-commutative81.5%
cbrt-prod82.5%
Applied egg-rr82.5%
Final simplification84.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* y.re (log (hypot x.re x.im))) (* (atan2 x.im x.re) y.im)))))
(if (<= y.re -5000000000.0)
(* t_0 (sqrt (pow (sin (* y.re (atan2 x.im x.re))) 2.0)))
(*
t_0
(pow
(cbrt
(sin
(fma
(atan2 x.im x.re)
y.re
(pow (cbrt (* y.im (log (hypot x.im x.re)))) 3.0))))
3.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -5000000000.0) {
tmp = t_0 * sqrt(pow(sin((y_46_re * atan2(x_46_im, x_46_re))), 2.0));
} else {
tmp = t_0 * pow(cbrt(sin(fma(atan2(x_46_im, x_46_re), y_46_re, pow(cbrt((y_46_im * log(hypot(x_46_im, x_46_re)))), 3.0)))), 3.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -5000000000.0) tmp = Float64(t_0 * sqrt((sin(Float64(y_46_re * atan(x_46_im, x_46_re))) ^ 2.0))); else tmp = Float64(t_0 * (cbrt(sin(fma(atan(x_46_im, x_46_re), y_46_re, (cbrt(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) ^ 3.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[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -5000000000.0], N[(t$95$0 * N[Sqrt[N[Power[N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Power[N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + 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], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -5000000000:\\
\;\;\;\;t_0 \cdot \sqrt{{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {\left(\sqrt[3]{\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, {\left(\sqrt[3]{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right)\right)}\right)}^{3}\\
\end{array}
\end{array}
if y.re < -5e9Initial program 40.6%
hypot-def40.6%
fma-def40.6%
hypot-def78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in y.im around 0 82.6%
add-sqr-sqrt44.9%
sqrt-unprod91.3%
pow291.3%
*-commutative91.3%
Applied egg-rr91.3%
if -5e9 < y.re Initial program 36.9%
hypot-def36.9%
fma-def36.9%
hypot-def79.8%
*-commutative79.8%
Simplified79.8%
fma-udef79.8%
hypot-udef36.9%
*-commutative36.9%
add-sqr-sqrt20.4%
sqrt-unprod15.5%
pow215.5%
fma-def15.5%
hypot-udef31.5%
Applied egg-rr31.5%
unpow231.5%
rem-sqrt-square59.1%
hypot-def28.6%
unpow228.6%
unpow228.6%
+-commutative28.6%
*-commutative28.6%
fma-def28.6%
*-commutative28.6%
+-commutative28.6%
fma-def28.6%
unpow228.6%
unpow228.6%
hypot-def59.1%
Simplified59.1%
add-cube-cbrt58.8%
pow358.8%
add-sqr-sqrt42.6%
fabs-sqr42.6%
add-sqr-sqrt79.2%
fma-udef79.2%
*-commutative79.2%
fma-def79.2%
Applied egg-rr79.2%
add-cube-cbrt80.7%
pow381.8%
Applied egg-rr81.8%
Final simplification84.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 (- (* y.re t_1) (* (atan2 x.im x.re) y.im)))))
(if (<= y.re -4e+106)
(* t_2 (sqrt (pow (sin t_0) 2.0)))
(* t_2 (sin (fma t_1 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 = 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(((y_46_re * t_1) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -4e+106) {
tmp = t_2 * sqrt(pow(sin(t_0), 2.0));
} else {
tmp = t_2 * sin(fma(t_1, y_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_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = exp(Float64(Float64(y_46_re * t_1) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -4e+106) tmp = Float64(t_2 * sqrt((sin(t_0) ^ 2.0))); else tmp = Float64(t_2 * sin(fma(t_1, 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[(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[(y$46$re * t$95$1), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -4e+106], N[(t$95$2 * N[Sqrt[N[Power[N[Sin[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -4 \cdot 10^{+106}:\\
\;\;\;\;t_2 \cdot \sqrt{{\sin t_0}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)\\
\end{array}
\end{array}
if y.re < -4.00000000000000036e106Initial program 35.6%
hypot-def35.6%
fma-def35.6%
hypot-def73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in y.im around 0 82.2%
add-sqr-sqrt46.7%
sqrt-unprod93.3%
pow293.3%
*-commutative93.3%
Applied egg-rr93.3%
if -4.00000000000000036e106 < y.re Initial program 38.4%
hypot-def38.4%
fma-def38.4%
hypot-def80.7%
*-commutative80.7%
Simplified80.7%
Final simplification82.9%
(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 (sin (fma t_1 y.im t_0))))
(if (<= y.re -0.00022)
(*
(exp (- (* y.re t_1) (* (atan2 x.im x.re) y.im)))
(sqrt (pow (sin t_0) 2.0)))
(if (<= y.re 4.5e-7)
(* t_2 (exp (* (atan2 x.im x.re) (- y.im))))
(* t_2 (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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = sin(fma(t_1, y_46_im, t_0));
double tmp;
if (y_46_re <= -0.00022) {
tmp = exp(((y_46_re * t_1) - (atan2(x_46_im, x_46_re) * y_46_im))) * sqrt(pow(sin(t_0), 2.0));
} else if (y_46_re <= 4.5e-7) {
tmp = t_2 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_2 * 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = sin(fma(t_1, y_46_im, t_0)) tmp = 0.0 if (y_46_re <= -0.00022) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sqrt((sin(t_0) ^ 2.0))); elseif (y_46_re <= 4.5e-7) tmp = Float64(t_2 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_2 * (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[(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[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.00022], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Power[N[Sin[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.5e-7], N[(t$95$2 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * 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 := 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 := \sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)\\
\mathbf{if}\;y.re \leq -0.00022:\\
\;\;\;\;e^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt{{\sin t_0}^{2}}\\
\mathbf{elif}\;y.re \leq 4.5 \cdot 10^{-7}:\\
\;\;\;\;t_2 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.20000000000000008e-4Initial program 41.4%
hypot-def41.4%
fma-def41.4%
hypot-def78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in y.im around 0 82.8%
add-sqr-sqrt45.7%
sqrt-unprod90.6%
pow290.6%
*-commutative90.6%
Applied egg-rr90.6%
if -2.20000000000000008e-4 < y.re < 4.4999999999999998e-7Initial program 33.1%
exp-diff33.1%
exp-to-pow33.1%
hypot-def33.1%
*-commutative33.1%
exp-prod33.0%
fma-def33.0%
hypot-def81.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in y.re around 0 81.6%
rec-exp81.6%
distribute-rgt-neg-in81.6%
Simplified81.6%
if 4.4999999999999998e-7 < y.re Initial program 45.3%
exp-diff39.6%
exp-to-pow39.6%
hypot-def39.6%
*-commutative39.6%
exp-prod39.6%
fma-def39.6%
hypot-def64.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in y.im around 0 71.8%
unpow271.8%
unpow271.8%
hypot-def71.8%
Simplified71.8%
Final simplification82.0%
(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 (sin (fma t_1 y.im t_0))))
(if (<= y.re -2.15e-9)
(* (exp (- (* y.re t_1) (* (atan2 x.im x.re) y.im))) (sin t_0))
(if (<= y.re 3.6e-7)
(* t_2 (exp (* (atan2 x.im x.re) (- y.im))))
(* t_2 (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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = sin(fma(t_1, y_46_im, t_0));
double tmp;
if (y_46_re <= -2.15e-9) {
tmp = exp(((y_46_re * t_1) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
} else if (y_46_re <= 3.6e-7) {
tmp = t_2 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_2 * 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = sin(fma(t_1, y_46_im, t_0)) tmp = 0.0 if (y_46_re <= -2.15e-9) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)); elseif (y_46_re <= 3.6e-7) tmp = Float64(t_2 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_2 * (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[(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[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.15e-9], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.6e-7], N[(t$95$2 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * 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 := 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 := \sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)\\
\mathbf{if}\;y.re \leq -2.15 \cdot 10^{-9}:\\
\;\;\;\;e^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t_0\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{-7}:\\
\;\;\;\;t_2 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.14999999999999981e-9Initial program 40.2%
hypot-def40.2%
fma-def40.2%
hypot-def76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in y.im around 0 81.9%
if -2.14999999999999981e-9 < y.re < 3.59999999999999994e-7Initial program 33.6%
exp-diff33.6%
exp-to-pow33.6%
hypot-def33.6%
*-commutative33.6%
exp-prod33.5%
fma-def33.5%
hypot-def83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in y.re around 0 82.7%
rec-exp82.7%
distribute-rgt-neg-in82.7%
Simplified82.7%
if 3.59999999999999994e-7 < y.re Initial program 45.3%
exp-diff39.6%
exp-to-pow39.6%
hypot-def39.6%
*-commutative39.6%
exp-prod39.6%
fma-def39.6%
hypot-def64.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in y.im around 0 71.8%
unpow271.8%
unpow271.8%
hypot-def71.8%
Simplified71.8%
Final simplification80.2%
(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 (- (* y.re t_1) (* (atan2 x.im x.re) y.im))) (sin t_0))))
(if (<= y.im -6.5e+31)
t_2
(if (<= y.im 2300000000.0)
(* (sin (fma t_1 y.im t_0)) (pow (hypot x.im x.re) y.re))
(if (<= y.im 8e+226)
t_2
(* (fabs t_0) (exp (* (atan2 x.im x.re) (- y.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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(((y_46_re * t_1) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
double tmp;
if (y_46_im <= -6.5e+31) {
tmp = t_2;
} else if (y_46_im <= 2300000000.0) {
tmp = sin(fma(t_1, y_46_im, t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 8e+226) {
tmp = t_2;
} else {
tmp = fabs(t_0) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(exp(Float64(Float64(y_46_re * t_1) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)) tmp = 0.0 if (y_46_im <= -6.5e+31) tmp = t_2; elseif (y_46_im <= 2300000000.0) tmp = Float64(sin(fma(t_1, y_46_im, t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 8e+226) tmp = t_2; else tmp = Float64(abs(t_0) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -6.5e+31], t$95$2, If[LessEqual[y$46$im, 2300000000.0], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8e+226], t$95$2, N[(N[Abs[t$95$0], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
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^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t_0\\
\mathbf{if}\;y.im \leq -6.5 \cdot 10^{+31}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq 2300000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 8 \cdot 10^{+226}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left|t_0\right| \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.im < -6.5000000000000004e31 or 2.3e9 < y.im < 7.99999999999999969e226Initial program 33.3%
hypot-def33.3%
fma-def33.3%
hypot-def65.1%
*-commutative65.1%
Simplified65.1%
Taylor expanded in y.im around 0 70.4%
if -6.5000000000000004e31 < y.im < 2.3e9Initial program 43.0%
exp-diff42.2%
exp-to-pow42.3%
hypot-def42.3%
*-commutative42.3%
exp-prod41.4%
fma-def41.4%
hypot-def88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in y.im around 0 61.4%
unpow261.4%
unpow261.4%
hypot-def90.1%
Simplified90.1%
if 7.99999999999999969e226 < y.im Initial program 26.8%
hypot-def26.8%
fma-def26.8%
hypot-def74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in y.im around 0 40.4%
Taylor expanded in y.re around 0 47.1%
*-commutative47.1%
distribute-rgt-neg-in47.1%
Simplified47.1%
*-commutative47.1%
add-sqr-sqrt33.5%
sqrt-unprod53.8%
pow253.8%
Applied egg-rr53.8%
*-commutative53.8%
unpow253.8%
rem-sqrt-square73.8%
Simplified73.8%
Final simplification80.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (- x.im)))
(t_2 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -1.25e-116)
(* (exp (- (* y.re t_1) t_2)) (sin (+ t_0 (* y.im t_1))))
(* (exp (- (* y.re (log (hypot x.re x.im))) 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(-x_46_im);
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -1.25e-116) {
tmp = exp(((y_46_re * t_1) - t_2)) * sin((t_0 + (y_46_im * t_1)));
} else {
tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_2)) * sin(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 t_1 = Math.log(-x_46_im);
double t_2 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -1.25e-116) {
tmp = Math.exp(((y_46_re * t_1) - t_2)) * Math.sin((t_0 + (y_46_im * t_1)));
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - t_2)) * Math.sin(t_0);
}
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 = math.log(-x_46_im) t_2 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_im <= -1.25e-116: tmp = math.exp(((y_46_re * t_1) - t_2)) * math.sin((t_0 + (y_46_im * t_1))) else: tmp = math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - t_2)) * math.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(Float64(-x_46_im)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_im <= -1.25e-116) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - t_2)) * sin(Float64(t_0 + Float64(y_46_im * t_1)))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - t_2)) * sin(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_re * atan2(x_46_im, x_46_re); t_1 = log(-x_46_im); t_2 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_im <= -1.25e-116) tmp = exp(((y_46_re * t_1) - t_2)) * sin((t_0 + (y_46_im * t_1))); else tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_2)) * sin(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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[(-x$46$im)], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -1.25e-116], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 + N[(y$46$im * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * 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(-x.im\right)\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -1.25 \cdot 10^{-116}:\\
\;\;\;\;e^{y.re \cdot t_1 - t_2} \cdot \sin \left(t_0 + y.im \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - t_2} \cdot \sin t_0\\
\end{array}
\end{array}
if x.im < -1.2500000000000001e-116Initial program 37.6%
Taylor expanded in x.im around -inf 37.1%
mul-1-neg37.1%
Simplified37.1%
Taylor expanded in x.im around -inf 75.0%
mul-1-neg37.1%
Simplified75.0%
if -1.2500000000000001e-116 < x.im Initial program 38.0%
hypot-def38.0%
fma-def38.0%
hypot-def76.8%
*-commutative76.8%
Simplified76.8%
Taylor expanded in y.im around 0 64.4%
Final simplification68.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
(t_1 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -7.5e-229)
(*
(exp (- (* y.re (log (- x.im))) t_1))
(sin (* y.im (log (hypot x.im x.re)))))
(if (<= x.im 1.95e+30)
(* t_0 (/ (pow (hypot x.re x.im) y.re) (+ t_1 1.0)))
(* 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_re * atan2(x_46_im, x_46_re)));
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -7.5e-229) {
tmp = exp(((y_46_re * log(-x_46_im)) - t_1)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (x_46_im <= 1.95e+30) {
tmp = t_0 * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_1 + 1.0));
} 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_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -7.5e-229) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_1)) * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
} else if (x_46_im <= 1.95e+30) {
tmp = t_0 * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (t_1 + 1.0));
} 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_re * math.atan2(x_46_im, x_46_re))) t_1 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_im <= -7.5e-229: tmp = math.exp(((y_46_re * math.log(-x_46_im)) - t_1)) * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) elif x_46_im <= 1.95e+30: tmp = t_0 * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (t_1 + 1.0)) 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_re * atan(x_46_im, x_46_re))) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_im <= -7.5e-229) tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_1)) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (x_46_im <= 1.95e+30) tmp = Float64(t_0 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_1 + 1.0))); 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_re * atan2(x_46_im, x_46_re))); t_1 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_im <= -7.5e-229) tmp = exp(((y_46_re * log(-x_46_im)) - t_1)) * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); elseif (x_46_im <= 1.95e+30) tmp = t_0 * ((hypot(x_46_re, x_46_im) ^ y_46_re) / (t_1 + 1.0)); 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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -7.5e-229], N[(N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$1), $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], If[LessEqual[x$46$im, 1.95e+30], N[(t$95$0 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$1 + 1.0), $MachinePrecision]), $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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -7.5 \cdot 10^{-229}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t_1} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;x.im \leq 1.95 \cdot 10^{+30}:\\
\;\;\;\;t_0 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_1 + 1}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot e^{y.re \cdot \log x.im - t_1}\\
\end{array}
\end{array}
if x.im < -7.4999999999999999e-229Initial program 37.9%
Taylor expanded in x.im around -inf 36.6%
mul-1-neg36.6%
Simplified36.6%
Taylor expanded in y.re around 0 31.1%
unpow231.1%
unpow231.1%
hypot-def70.4%
Simplified70.4%
if -7.4999999999999999e-229 < x.im < 1.95000000000000005e30Initial program 48.8%
hypot-def48.8%
fma-def48.8%
hypot-def75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in y.im around 0 63.3%
expm1-log1p-u55.8%
expm1-udef46.3%
*-commutative46.3%
*-commutative46.3%
exp-diff42.5%
exp-to-pow42.5%
exp-prod41.4%
Applied egg-rr41.4%
expm1-def50.9%
expm1-log1p58.4%
*-commutative58.4%
Simplified58.4%
Taylor expanded in y.im around 0 54.0%
if 1.95000000000000005e30 < x.im Initial program 25.0%
hypot-def25.0%
fma-def25.0%
hypot-def77.8%
*-commutative77.8%
Simplified77.8%
Taylor expanded in y.im around 0 68.3%
Taylor expanded in x.re around 0 68.3%
Final simplification64.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -1.05e-268)
(*
(exp (- (* y.re (log (- x.im))) t_0))
(sin (* y.im (log (hypot x.im x.re)))))
(*
(exp (- (* y.re (log (hypot x.re x.im))) t_0))
(sin (* 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 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -1.05e-268) {
tmp = exp(((y_46_re * log(-x_46_im)) - t_0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * sin((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.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -1.05e-268) {
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))));
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - t_0)) * Math.sin((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.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_im <= -1.05e-268: 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)))) else: tmp = math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - t_0)) * math.sin((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 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_im <= -1.05e-268) 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))))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * sin(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 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_im <= -1.05e-268) tmp = exp(((y_46_re * log(-x_46_im)) - t_0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); else tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * sin((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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -1.05e-268], 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], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -1.05 \cdot 10^{-268}:\\
\;\;\;\;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)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - t_0} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if x.im < -1.04999999999999999e-268Initial program 38.7%
Taylor expanded in x.im around -inf 37.5%
mul-1-neg37.5%
Simplified37.5%
Taylor expanded in y.re around 0 30.2%
unpow230.2%
unpow230.2%
hypot-def68.5%
Simplified68.5%
if -1.04999999999999999e-268 < x.im Initial program 37.2%
hypot-def37.2%
fma-def37.2%
hypot-def76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in y.im around 0 67.1%
Final simplification67.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -8e-105)
(* t_1 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 1.95e+30)
(* t_1 (/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0)))
(* t_1 (exp (- (* y.re (log 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -8e-105) {
tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 1.95e+30) {
tmp = t_1 * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0));
} else {
tmp = t_1 * exp(((y_46_re * log(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 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -8e-105) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 1.95e+30) {
tmp = t_1 * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -8e-105: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 1.95e+30: tmp = t_1 * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -8e-105) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 1.95e+30) tmp = Float64(t_1 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.0))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(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 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -8e-105) tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 1.95e+30) tmp = t_1 * ((hypot(x_46_re, x_46_im) ^ y_46_re) / (t_0 + 1.0)); else tmp = t_1 * exp(((y_46_re * log(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -8e-105], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.95e+30], N[(t$95$1 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -8 \cdot 10^{-105}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 1.95 \cdot 10^{+30}:\\
\;\;\;\;t_1 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_0 + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -7.99999999999999972e-105Initial program 36.5%
Taylor expanded in x.im around -inf 36.0%
mul-1-neg36.0%
Simplified36.0%
Taylor expanded in y.im around 0 64.9%
if -7.99999999999999972e-105 < x.im < 1.95000000000000005e30Initial program 47.2%
hypot-def47.2%
fma-def47.2%
hypot-def75.8%
*-commutative75.8%
Simplified75.8%
Taylor expanded in y.im around 0 61.1%
expm1-log1p-u55.4%
expm1-udef44.7%
*-commutative44.7%
*-commutative44.7%
exp-diff40.0%
exp-to-pow40.0%
exp-prod39.1%
Applied egg-rr39.1%
expm1-def49.9%
expm1-log1p55.5%
*-commutative55.5%
Simplified55.5%
Taylor expanded in y.im around 0 54.1%
if 1.95000000000000005e30 < x.im Initial program 25.0%
hypot-def25.0%
fma-def25.0%
hypot-def77.8%
*-commutative77.8%
Simplified77.8%
Taylor expanded in y.im around 0 68.3%
Taylor expanded in x.re around 0 68.3%
Final simplification61.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.95e+39) (not (<= y.re 0.0037)))
(*
(sin (* y.re (atan2 x.im x.re)))
(pow (sqrt (+ (* x.re x.re) (* x.im x.im))) y.re))
(* y.re (* (atan2 x.im x.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 <= -1.95e+39) || !(y_46_re <= 0.0037)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
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) :: tmp
if ((y_46re <= (-1.95d+39)) .or. (.not. (y_46re <= 0.0037d0))) then
tmp = sin((y_46re * atan2(x_46im, x_46re))) * (sqrt(((x_46re * x_46re) + (x_46im * x_46im))) ** y_46re)
else
tmp = y_46re * (atan2(x_46im, x_46re) * exp((atan2(x_46im, x_46re) * -y_46im)))
end if
code = tmp
end function
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 <= -1.95e+39) || !(y_46_re <= 0.0037)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.95e+39) or not (y_46_re <= 0.0037): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.95e+39) || !(y_46_re <= 0.0037)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) ^ y_46_re)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * 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 <= -1.95e+39) || ~((y_46_re <= 0.0037))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))) ^ y_46_re); else tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.95e+39], N[Not[LessEqual[y$46$re, 0.0037]], $MachinePrecision]], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.95 \cdot 10^{+39} \lor \neg \left(y.re \leq 0.0037\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.re < -1.95e39 or 0.0037000000000000002 < y.re Initial program 43.3%
hypot-def43.3%
fma-def43.3%
hypot-def76.1%
*-commutative76.1%
Simplified76.1%
Taylor expanded in y.im around 0 77.9%
Taylor expanded in y.im around 0 70.1%
*-commutative70.1%
unpow270.1%
unpow270.1%
Simplified70.1%
if -1.95e39 < y.re < 0.0037000000000000002Initial program 33.5%
hypot-def33.5%
fma-def33.6%
hypot-def82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in y.im around 0 53.4%
Taylor expanded in y.re around 0 52.8%
*-commutative52.8%
distribute-rgt-neg-in52.8%
Simplified52.8%
*-commutative52.8%
add-cbrt-cube37.4%
pow1/321.8%
pow321.8%
Applied egg-rr21.8%
Taylor expanded in x.im around 0 53.5%
mul-1-neg53.5%
Simplified53.5%
Final simplification60.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.im -1e+51)
(* (fabs t_0) t_1)
(if (<= y.im 1.4e-58)
(log1p (expm1 t_0))
(* y.re (* (atan2 x.im x.re) t_1))))))
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 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_im <= -1e+51) {
tmp = fabs(t_0) * t_1;
} else if (y_46_im <= 1.4e-58) {
tmp = log1p(expm1(t_0));
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_im <= -1e+51) {
tmp = Math.abs(t_0) * t_1;
} else if (y_46_im <= 1.4e-58) {
tmp = Math.log1p(Math.expm1(t_0));
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * t_1);
}
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 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) tmp = 0 if y_46_im <= -1e+51: tmp = math.fabs(t_0) * t_1 elif y_46_im <= 1.4e-58: tmp = math.log1p(math.expm1(t_0)) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * t_1) 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 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (y_46_im <= -1e+51) tmp = Float64(abs(t_0) * t_1); elseif (y_46_im <= 1.4e-58) tmp = log1p(expm1(t_0)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * t_1)); 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1e+51], N[(N[Abs[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 1.4e-58], N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.im \leq -1 \cdot 10^{+51}:\\
\;\;\;\;\left|t_0\right| \cdot t_1\\
\mathbf{elif}\;y.im \leq 1.4 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot t_1\right)\\
\end{array}
\end{array}
if y.im < -1e51Initial program 28.1%
hypot-def28.1%
fma-def28.1%
hypot-def59.7%
*-commutative59.7%
Simplified59.7%
Taylor expanded in y.im around 0 67.3%
Taylor expanded in y.re around 0 52.1%
*-commutative52.1%
distribute-rgt-neg-in52.1%
Simplified52.1%
*-commutative52.1%
add-sqr-sqrt34.8%
sqrt-unprod39.5%
pow239.5%
Applied egg-rr39.5%
*-commutative39.5%
unpow239.5%
rem-sqrt-square55.2%
Simplified55.2%
if -1e51 < y.im < 1.4e-58Initial program 41.7%
hypot-def41.7%
fma-def41.7%
hypot-def90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in y.im around 0 65.6%
Taylor expanded in y.re around 0 26.2%
*-commutative26.2%
distribute-rgt-neg-in26.2%
Simplified26.2%
Taylor expanded in y.im around 0 25.4%
*-commutative25.4%
log1p-expm1-u34.7%
Applied egg-rr34.7%
if 1.4e-58 < y.im Initial program 40.1%
hypot-def40.1%
fma-def40.1%
hypot-def77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in y.im around 0 59.1%
Taylor expanded in y.re around 0 52.3%
*-commutative52.3%
distribute-rgt-neg-in52.3%
Simplified52.3%
*-commutative52.3%
add-cbrt-cube39.8%
pow1/330.1%
pow330.1%
Applied egg-rr30.1%
Taylor expanded in x.im around 0 53.7%
mul-1-neg53.7%
Simplified53.7%
Final simplification45.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.im -1e+51)
(/ t_0 (pow (exp y.im) (atan2 x.im x.re)))
(if (<= y.im 9.2e-60)
(log1p (expm1 t_0))
(* y.re (* (atan2 x.im x.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 t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -1e+51) {
tmp = t_0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else if (y_46_im <= 9.2e-60) {
tmp = log1p(expm1(t_0));
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -1e+51) {
tmp = t_0 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else if (y_46_im <= 9.2e-60) {
tmp = Math.log1p(Math.expm1(t_0));
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_im <= -1e+51: tmp = t_0 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) elif y_46_im <= 9.2e-60: tmp = math.log1p(math.expm1(t_0)) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -1e+51) tmp = Float64(t_0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); elseif (y_46_im <= 9.2e-60) tmp = log1p(expm1(t_0)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1e+51], N[(t$95$0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9.2e-60], N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -1 \cdot 10^{+51}:\\
\;\;\;\;\frac{t_0}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.im \leq 9.2 \cdot 10^{-60}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.im < -1e51Initial program 28.1%
hypot-def28.1%
fma-def28.1%
hypot-def59.7%
*-commutative59.7%
Simplified59.7%
Taylor expanded in y.im around 0 67.3%
expm1-log1p-u56.4%
expm1-udef56.4%
*-commutative56.4%
*-commutative56.4%
exp-diff42.3%
exp-to-pow42.3%
exp-prod42.5%
Applied egg-rr42.5%
expm1-def42.5%
expm1-log1p51.9%
*-commutative51.9%
Simplified51.9%
Taylor expanded in y.re around 0 52.1%
exp-prod55.1%
Simplified55.1%
if -1e51 < y.im < 9.2000000000000005e-60Initial program 41.7%
hypot-def41.7%
fma-def41.7%
hypot-def90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in y.im around 0 65.6%
Taylor expanded in y.re around 0 26.2%
*-commutative26.2%
distribute-rgt-neg-in26.2%
Simplified26.2%
Taylor expanded in y.im around 0 25.4%
*-commutative25.4%
log1p-expm1-u34.7%
Applied egg-rr34.7%
if 9.2000000000000005e-60 < y.im Initial program 40.1%
hypot-def40.1%
fma-def40.1%
hypot-def77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in y.im around 0 59.1%
Taylor expanded in y.re around 0 52.3%
*-commutative52.3%
distribute-rgt-neg-in52.3%
Simplified52.3%
*-commutative52.3%
add-cbrt-cube39.8%
pow1/330.1%
pow330.1%
Applied egg-rr30.1%
Taylor expanded in x.im around 0 53.7%
mul-1-neg53.7%
Simplified53.7%
Final simplification45.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1e+51) (not (<= y.im 9.5e-63))) (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im))))) (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) {
double tmp;
if ((y_46_im <= -1e+51) || !(y_46_im <= 9.5e-63)) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = log1p(expm1((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 tmp;
if ((y_46_im <= -1e+51) || !(y_46_im <= 9.5e-63)) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = Math.log1p(Math.expm1((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): tmp = 0 if (y_46_im <= -1e+51) or not (y_46_im <= 9.5e-63): tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) else: tmp = math.log1p(math.expm1((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) tmp = 0.0 if ((y_46_im <= -1e+51) || !(y_46_im <= 9.5e-63)) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); else tmp = log1p(expm1(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_] := If[Or[LessEqual[y$46$im, -1e+51], N[Not[LessEqual[y$46$im, 9.5e-63]], $MachinePrecision]], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1 \cdot 10^{+51} \lor \neg \left(y.im \leq 9.5 \cdot 10^{-63}\right):\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if y.im < -1e51 or 9.50000000000000016e-63 < y.im Initial program 34.5%
hypot-def34.5%
fma-def34.5%
hypot-def69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in y.im around 0 63.0%
Taylor expanded in y.re around 0 52.2%
*-commutative52.2%
distribute-rgt-neg-in52.2%
Simplified52.2%
*-commutative52.2%
add-cbrt-cube37.4%
pow1/328.6%
pow328.6%
Applied egg-rr28.6%
Taylor expanded in x.im around 0 52.9%
mul-1-neg52.9%
Simplified52.9%
if -1e51 < y.im < 9.50000000000000016e-63Initial program 41.7%
hypot-def41.7%
fma-def41.7%
hypot-def90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in y.im around 0 65.6%
Taylor expanded in y.re around 0 26.2%
*-commutative26.2%
distribute-rgt-neg-in26.2%
Simplified26.2%
Taylor expanded in y.im around 0 25.4%
*-commutative25.4%
log1p-expm1-u34.7%
Applied egg-rr34.7%
Final simplification44.4%
(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 -1.36e+51) (not (<= y.im 4.1e-32)))
(/ t_0 (exp (* (atan2 x.im x.re) y.im)))
(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 <= -1.36e+51) || !(y_46_im <= 4.1e-32)) {
tmp = t_0 / exp((atan2(x_46_im, x_46_re) * y_46_im));
} 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 <= -1.36e+51) || !(y_46_im <= 4.1e-32)) {
tmp = t_0 / Math.exp((Math.atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = Math.log1p(Math.expm1(t_0));
}
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) tmp = 0 if (y_46_im <= -1.36e+51) or not (y_46_im <= 4.1e-32): tmp = t_0 / math.exp((math.atan2(x_46_im, x_46_re) * y_46_im)) 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 <= -1.36e+51) || !(y_46_im <= 4.1e-32)) tmp = Float64(t_0 / exp(Float64(atan(x_46_im, x_46_re) * y_46_im))); 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, -1.36e+51], N[Not[LessEqual[y$46$im, 4.1e-32]], $MachinePrecision]], N[(t$95$0 / N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $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 -1.36 \cdot 10^{+51} \lor \neg \left(y.im \leq 4.1 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{t_0}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t_0\right)\right)\\
\end{array}
\end{array}
if y.im < -1.3599999999999999e51 or 4.09999999999999975e-32 < y.im Initial program 33.5%
hypot-def33.5%
fma-def33.5%
hypot-def68.2%
*-commutative68.2%
Simplified68.2%
Taylor expanded in y.im around 0 64.5%
expm1-log1p-u53.0%
expm1-udef53.1%
*-commutative53.1%
*-commutative53.1%
exp-diff42.4%
exp-to-pow42.4%
exp-prod43.2%
Applied egg-rr43.2%
expm1-def43.2%
expm1-log1p52.4%
*-commutative52.4%
Simplified52.4%
Taylor expanded in y.re around 0 54.1%
if -1.3599999999999999e51 < y.im < 4.09999999999999975e-32Initial program 42.4%
hypot-def42.4%
fma-def42.4%
hypot-def91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in y.im around 0 63.9%
Taylor expanded in y.re around 0 25.3%
*-commutative25.3%
distribute-rgt-neg-in25.3%
Simplified25.3%
Taylor expanded in y.im around 0 24.5%
*-commutative24.5%
log1p-expm1-u33.5%
Applied egg-rr33.5%
Final simplification44.0%
(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.3e-69) (not (<= y.im 9.5e-24)))
(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.3e-69) || !(y_46_im <= 9.5e-24)) {
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.3e-69) || !(y_46_im <= 9.5e-24)) {
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.3e-69) or not (y_46_im <= 9.5e-24): 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.3e-69) || !(y_46_im <= 9.5e-24)) 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.3e-69], N[Not[LessEqual[y$46$im, 9.5e-24]], $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.3 \cdot 10^{-69} \lor \neg \left(y.im \leq 9.5 \cdot 10^{-24}\right):\\
\;\;\;\;\log \left(1 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(t_0\right)\\
\end{array}
\end{array}
if y.im < -2.3000000000000001e-69 or 9.50000000000000029e-24 < y.im Initial program 36.7%
hypot-def36.7%
fma-def36.7%
hypot-def70.9%
*-commutative70.9%
Simplified70.9%
Taylor expanded in y.im around 0 63.9%
Taylor expanded in y.re around 0 47.3%
*-commutative47.3%
distribute-rgt-neg-in47.3%
Simplified47.3%
Taylor expanded in y.im around 0 4.1%
*-commutative4.1%
log1p-expm1-u14.6%
log1p-udef33.2%
Applied egg-rr33.2%
if -2.3000000000000001e-69 < y.im < 9.50000000000000029e-24Initial program 39.7%
hypot-def39.7%
fma-def39.7%
hypot-def91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in y.im around 0 64.7%
Taylor expanded in y.re around 0 29.2%
*-commutative29.2%
distribute-rgt-neg-in29.2%
Simplified29.2%
Taylor expanded in y.im around 0 29.2%
*-commutative29.2%
log1p-expm1-u36.3%
Applied egg-rr36.3%
Final simplification34.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* y.re (atan2 x.im x.re)))) (if (<= y.im 1.2e-143) (log1p (expm1 t_0)) (cbrt (pow 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_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= 1.2e-143) {
tmp = log1p(expm1(t_0));
} else {
tmp = cbrt(pow(t_0, 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= 1.2e-143) {
tmp = Math.log1p(Math.expm1(t_0));
} else {
tmp = Math.cbrt(Math.pow(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_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= 1.2e-143) tmp = log1p(expm1(t_0)); else tmp = 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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, 1.2e-143], N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq 1.2 \cdot 10^{-143}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{t_0}^{3}}\\
\end{array}
\end{array}
if y.im < 1.1999999999999999e-143Initial program 35.2%
hypot-def35.2%
fma-def35.2%
hypot-def78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in y.im around 0 66.5%
Taylor expanded in y.re around 0 37.8%
*-commutative37.8%
distribute-rgt-neg-in37.8%
Simplified37.8%
Taylor expanded in y.im around 0 18.6%
*-commutative18.6%
log1p-expm1-u27.6%
Applied egg-rr27.6%
if 1.1999999999999999e-143 < y.im Initial program 42.8%
hypot-def42.8%
fma-def42.8%
hypot-def80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in y.im around 0 60.1%
Taylor expanded in y.re around 0 44.0%
*-commutative44.0%
distribute-rgt-neg-in44.0%
Simplified44.0%
Taylor expanded in y.im around 0 6.1%
*-commutative6.1%
add-cbrt-cube21.6%
pow321.6%
Applied egg-rr21.6%
Final simplification25.5%
(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 37.9%
hypot-def37.9%
fma-def37.9%
hypot-def79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.im around 0 64.2%
Taylor expanded in y.re around 0 40.0%
*-commutative40.0%
distribute-rgt-neg-in40.0%
Simplified40.0%
Taylor expanded in y.im around 0 14.2%
*-commutative14.2%
log1p-expm1-u23.3%
Applied egg-rr23.3%
Final simplification23.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (* y.re (atan2 x.im x.re)) (- 1.0 (* (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 (y_46_re * atan2(x_46_im, x_46_re)) * (1.0 - (atan2(x_46_im, x_46_re) * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = (y_46re * atan2(x_46im, x_46re)) * (1.0d0 - (atan2(x_46im, x_46re) * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (y_46_re * Math.atan2(x_46_im, x_46_re)) * (1.0 - (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 (y_46_re * math.atan2(x_46_im, x_46_re)) * (1.0 - (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 Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * Float64(1.0 - 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 = (y_46_re * atan2(x_46_im, x_46_re)) * (1.0 - (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[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \left(1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)
\end{array}
Initial program 37.9%
hypot-def37.9%
fma-def37.9%
hypot-def79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.im around 0 64.2%
Taylor expanded in y.re around 0 40.0%
*-commutative40.0%
distribute-rgt-neg-in40.0%
Simplified40.0%
Taylor expanded in y.im around 0 16.3%
Final simplification16.3%
(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 37.9%
hypot-def37.9%
fma-def37.9%
hypot-def79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.im around 0 64.2%
Taylor expanded in y.re around 0 40.0%
*-commutative40.0%
distribute-rgt-neg-in40.0%
Simplified40.0%
Taylor expanded in y.im around 0 14.2%
Final simplification14.2%
herbie shell --seed 2023274
(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)))))