
(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 (* y.re (atan2 x.im x.re)))
(t_1 (sin (* y.im (log (hypot x.im x.re)))))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -7e-7)
(* t_2 (fabs t_1))
(if (<= y.re 6.5e+41)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.re 1.7e+146)
(* t_2 (sin (fabs t_0)))
(if (<= y.re 8.5e+180)
(log (pow (exp y.re) (atan2 x.im x.re)))
(if (or (<= y.re 1.2e+281) (not (<= y.re 6.5e+284)))
(* t_2 t_1)
(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 t_1 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_2 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -7e-7) {
tmp = t_2 * fabs(t_1);
} else if (y_46_re <= 6.5e+41) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.7e+146) {
tmp = t_2 * sin(fabs(t_0));
} else if (y_46_re <= 8.5e+180) {
tmp = log(pow(exp(y_46_re), atan2(x_46_im, x_46_re)));
} else if ((y_46_re <= 1.2e+281) || !(y_46_re <= 6.5e+284)) {
tmp = t_2 * t_1;
} else {
tmp = log1p(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)) t_1 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_2 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -7e-7) tmp = Float64(t_2 * abs(t_1)); elseif (y_46_re <= 6.5e+41) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1.7e+146) tmp = Float64(t_2 * sin(abs(t_0))); elseif (y_46_re <= 8.5e+180) tmp = log((exp(y_46_re) ^ atan(x_46_im, x_46_re))); elseif ((y_46_re <= 1.2e+281) || !(y_46_re <= 6.5e+284)) tmp = Float64(t_2 * t_1); 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]}, Block[{t$95$1 = 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$2 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7e-7], N[(t$95$2 * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.5e+41], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.7e+146], N[(t$95$2 * N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.5e+180], N[Log[N[Power[N[Exp[y$46$re], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[y$46$re, 1.2e+281], N[Not[LessEqual[y$46$re, 6.5e+284]], $MachinePrecision]], N[(t$95$2 * t$95$1), $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}\\
t_1 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_2 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -7 \cdot 10^{-7}:\\
\;\;\;\;t\_2 \cdot \left|t\_1\right|\\
\mathbf{elif}\;y.re \leq 6.5 \cdot 10^{+41}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{+146}:\\
\;\;\;\;t\_2 \cdot \sin \left(\left|t\_0\right|\right)\\
\mathbf{elif}\;y.re \leq 8.5 \cdot 10^{+180}:\\
\;\;\;\;\log \left({\left(e^{y.re}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{+281} \lor \neg \left(y.re \leq 6.5 \cdot 10^{+284}\right):\\
\;\;\;\;t\_2 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_0\right)\right)\\
\end{array}
\end{array}
if y.re < -6.99999999999999968e-7Initial program 41.3%
Taylor expanded in y.re around 0 41.3%
unpow241.3%
unpow241.3%
hypot-undefine87.4%
Simplified87.4%
add-sqr-sqrt42.9%
sqrt-unprod89.2%
pow289.2%
hypot-undefine43.1%
+-commutative43.1%
hypot-define89.2%
Applied egg-rr89.2%
unpow289.2%
rem-sqrt-square89.2%
hypot-undefine43.1%
unpow243.1%
unpow243.1%
+-commutative43.1%
unpow243.1%
unpow243.1%
hypot-define89.2%
Simplified89.2%
if -6.99999999999999968e-7 < y.re < 6.49999999999999975e41Initial program 41.7%
exp-diff41.7%
exp-to-pow41.7%
hypot-define41.7%
*-commutative41.7%
exp-prod41.7%
fma-define41.7%
hypot-define82.3%
*-commutative82.3%
Simplified82.3%
if 6.49999999999999975e41 < y.re < 1.69999999999999995e146Initial program 25.0%
Taylor expanded in y.im around 0 50.1%
*-commutative50.1%
add-sqr-sqrt25.0%
sqrt-unprod58.4%
pow258.4%
Applied egg-rr58.4%
*-commutative58.4%
unpow258.4%
rem-sqrt-square66.7%
Simplified66.7%
if 1.69999999999999995e146 < y.re < 8.50000000000000077e180Initial program 9.1%
Taylor expanded in y.im around 0 18.3%
Taylor expanded in y.re around 0 29.7%
*-commutative29.7%
distribute-lft-neg-in29.7%
Simplified29.7%
Taylor expanded in y.im around 0 3.7%
*-commutative3.7%
add-log-exp64.1%
*-commutative64.1%
exp-prod73.0%
Applied egg-rr73.0%
if 8.50000000000000077e180 < y.re < 1.2e281 or 6.50000000000000027e284 < y.re Initial program 35.7%
Taylor expanded in y.re around 0 50.0%
unpow250.0%
unpow250.0%
hypot-undefine78.6%
Simplified78.6%
if 1.2e281 < y.re < 6.50000000000000027e284Initial program 33.3%
Taylor expanded in y.im around 0 66.7%
Taylor expanded in y.re around 0 67.2%
*-commutative67.2%
distribute-lft-neg-in67.2%
Simplified67.2%
Taylor expanded in y.im around 0 8.8%
*-commutative8.8%
log1p-expm1-u100.0%
Applied egg-rr100.0%
Final simplification82.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (cbrt t_0))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_4 (exp (- (* t_3 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_4 (sin (+ (* t_3 y.im) t_2))) INFINITY)
(* t_4 (sin (+ t_2 (* y.im (log (pow (exp (pow t_1 2.0)) t_1))))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_0 y.im t_2))))))
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 = cbrt(t_0);
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_4 = exp(((t_3 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_4 * sin(((t_3 * y_46_im) + t_2))) <= ((double) INFINITY)) {
tmp = t_4 * sin((t_2 + (y_46_im * log(pow(exp(pow(t_1, 2.0)), t_1)))));
} else {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_0, y_46_im, t_2));
}
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 = cbrt(t_0) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_4 = exp(Float64(Float64(t_3 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_4 * sin(Float64(Float64(t_3 * y_46_im) + t_2))) <= Inf) tmp = Float64(t_4 * sin(Float64(t_2 + Float64(y_46_im * log((exp((t_1 ^ 2.0)) ^ t_1)))))); else tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_0, y_46_im, t_2))); 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[Power[t$95$0, 1/3], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(t$95$3 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$4 * N[Sin[N[(N[(t$95$3 * y$46$im), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$4 * N[Sin[N[(t$95$2 + N[(y$46$im * N[Log[N[Power[N[Exp[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision], t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \sqrt[3]{t\_0}\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_4 := e^{t\_3 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_4 \cdot \sin \left(t\_3 \cdot y.im + t\_2\right) \leq \infty:\\
\;\;\;\;t\_4 \cdot \sin \left(t\_2 + y.im \cdot \log \left({\left(e^{{t\_1}^{2}}\right)}^{t\_1}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, t\_2\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < +inf.0Initial program 75.7%
add-exp-log75.7%
add-cube-cbrt79.0%
exp-prod79.0%
pow279.0%
hypot-define79.0%
hypot-define79.0%
Applied egg-rr79.0%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 0.0%
fma-neg0.0%
hypot-define0.0%
distribute-rgt-neg-out0.0%
fma-define0.0%
hypot-define78.1%
*-commutative78.1%
Simplified78.1%
Final simplification78.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(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));
return exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_0, y_46_im, 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_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[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)\\
e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \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}
Initial program 37.9%
fma-neg37.9%
hypot-define37.9%
distribute-rgt-neg-out37.9%
fma-define37.9%
hypot-define76.9%
*-commutative76.9%
Simplified76.9%
Final simplification76.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_2 (log (hypot x.im x.re)))
(t_3 (* y.im t_2))
(t_4 (sin t_3)))
(if (<= y.re -7e-7)
(* t_1 (fabs t_4))
(if (<= y.re 1.85)
(*
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))
(sin (* y.im (+ t_2 (* y.re (/ (atan2 x.im x.re) y.im))))))
(if (<= y.re 5.5e+143)
(* t_1 (sin (+ t_0 (fabs t_3))))
(if (<= y.re 9.6e+179)
(log (pow (exp y.re) (atan2 x.im x.re)))
(if (or (<= y.re 1.2e+281) (not (<= y.re 1e+285)))
(* t_1 t_4)
(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 t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = log(hypot(x_46_im, x_46_re));
double t_3 = y_46_im * t_2;
double t_4 = sin(t_3);
double tmp;
if (y_46_re <= -7e-7) {
tmp = t_1 * fabs(t_4);
} else if (y_46_re <= 1.85) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re))) * sin((y_46_im * (t_2 + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
} else if (y_46_re <= 5.5e+143) {
tmp = t_1 * sin((t_0 + fabs(t_3)));
} else if (y_46_re <= 9.6e+179) {
tmp = log(pow(exp(y_46_re), atan2(x_46_im, x_46_re)));
} else if ((y_46_re <= 1.2e+281) || !(y_46_re <= 1e+285)) {
tmp = t_1 * t_4;
} 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 t_1 = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_3 = y_46_im * t_2;
double t_4 = Math.sin(t_3);
double tmp;
if (y_46_re <= -7e-7) {
tmp = t_1 * Math.abs(t_4);
} else if (y_46_re <= 1.85) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re))) * Math.sin((y_46_im * (t_2 + (y_46_re * (Math.atan2(x_46_im, x_46_re) / y_46_im)))));
} else if (y_46_re <= 5.5e+143) {
tmp = t_1 * Math.sin((t_0 + Math.abs(t_3)));
} else if (y_46_re <= 9.6e+179) {
tmp = Math.log(Math.pow(Math.exp(y_46_re), Math.atan2(x_46_im, x_46_re)));
} else if ((y_46_re <= 1.2e+281) || !(y_46_re <= 1e+285)) {
tmp = t_1 * t_4;
} 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) t_1 = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) t_2 = math.log(math.hypot(x_46_im, x_46_re)) t_3 = y_46_im * t_2 t_4 = math.sin(t_3) tmp = 0 if y_46_re <= -7e-7: tmp = t_1 * math.fabs(t_4) elif y_46_re <= 1.85: tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) * math.sin((y_46_im * (t_2 + (y_46_re * (math.atan2(x_46_im, x_46_re) / y_46_im))))) elif y_46_re <= 5.5e+143: tmp = t_1 * math.sin((t_0 + math.fabs(t_3))) elif y_46_re <= 9.6e+179: tmp = math.log(math.pow(math.exp(y_46_re), math.atan2(x_46_im, x_46_re))) elif (y_46_re <= 1.2e+281) or not (y_46_re <= 1e+285): tmp = t_1 * t_4 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)) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_2 = log(hypot(x_46_im, x_46_re)) t_3 = Float64(y_46_im * t_2) t_4 = sin(t_3) tmp = 0.0 if (y_46_re <= -7e-7) tmp = Float64(t_1 * abs(t_4)); elseif (y_46_re <= 1.85) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) * sin(Float64(y_46_im * Float64(t_2 + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); elseif (y_46_re <= 5.5e+143) tmp = Float64(t_1 * sin(Float64(t_0 + abs(t_3)))); elseif (y_46_re <= 9.6e+179) tmp = log((exp(y_46_re) ^ atan(x_46_im, x_46_re))); elseif ((y_46_re <= 1.2e+281) || !(y_46_re <= 1e+285)) tmp = Float64(t_1 * t_4); 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]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$im * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$3], $MachinePrecision]}, If[LessEqual[y$46$re, -7e-7], N[(t$95$1 * N[Abs[t$95$4], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.85], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$im * N[(t$95$2 + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.5e+143], N[(t$95$1 * N[Sin[N[(t$95$0 + N[Abs[t$95$3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9.6e+179], N[Log[N[Power[N[Exp[y$46$re], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[y$46$re, 1.2e+281], N[Not[LessEqual[y$46$re, 1e+285]], $MachinePrecision]], N[(t$95$1 * t$95$4), $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}\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_3 := y.im \cdot t\_2\\
t_4 := \sin t\_3\\
\mathbf{if}\;y.re \leq -7 \cdot 10^{-7}:\\
\;\;\;\;t\_1 \cdot \left|t\_4\right|\\
\mathbf{elif}\;y.re \leq 1.85:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sin \left(y.im \cdot \left(t\_2 + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\mathbf{elif}\;y.re \leq 5.5 \cdot 10^{+143}:\\
\;\;\;\;t\_1 \cdot \sin \left(t\_0 + \left|t\_3\right|\right)\\
\mathbf{elif}\;y.re \leq 9.6 \cdot 10^{+179}:\\
\;\;\;\;\log \left({\left(e^{y.re}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{+281} \lor \neg \left(y.re \leq 10^{+285}\right):\\
\;\;\;\;t\_1 \cdot t\_4\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_0\right)\right)\\
\end{array}
\end{array}
if y.re < -6.99999999999999968e-7Initial program 41.3%
Taylor expanded in y.re around 0 41.3%
unpow241.3%
unpow241.3%
hypot-undefine87.4%
Simplified87.4%
add-sqr-sqrt42.9%
sqrt-unprod89.2%
pow289.2%
hypot-undefine43.1%
+-commutative43.1%
hypot-define89.2%
Applied egg-rr89.2%
unpow289.2%
rem-sqrt-square89.2%
hypot-undefine43.1%
unpow243.1%
unpow243.1%
+-commutative43.1%
unpow243.1%
unpow243.1%
hypot-define89.2%
Simplified89.2%
if -6.99999999999999968e-7 < y.re < 1.8500000000000001Initial program 42.7%
exp-diff42.7%
exp-to-pow42.7%
hypot-define42.7%
*-commutative42.7%
exp-prod42.7%
fma-define42.7%
hypot-define81.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in y.im around inf 42.7%
unpow242.7%
unpow242.7%
hypot-undefine81.9%
associate-/l*81.9%
Simplified81.9%
if 1.8500000000000001 < y.re < 5.4999999999999997e143Initial program 22.2%
add-sqr-sqrt7.4%
sqrt-unprod14.8%
pow214.8%
hypot-define44.4%
Applied egg-rr44.4%
unpow244.4%
rem-sqrt-square66.7%
*-commutative66.7%
hypot-undefine25.9%
unpow225.9%
unpow225.9%
+-commutative25.9%
unpow225.9%
unpow225.9%
hypot-undefine66.7%
Simplified66.7%
if 5.4999999999999997e143 < y.re < 9.6000000000000005e179Initial program 9.1%
Taylor expanded in y.im around 0 18.3%
Taylor expanded in y.re around 0 29.7%
*-commutative29.7%
distribute-lft-neg-in29.7%
Simplified29.7%
Taylor expanded in y.im around 0 3.7%
*-commutative3.7%
add-log-exp64.1%
*-commutative64.1%
exp-prod73.0%
Applied egg-rr73.0%
if 9.6000000000000005e179 < y.re < 1.2e281 or 9.9999999999999998e284 < y.re Initial program 35.7%
Taylor expanded in y.re around 0 50.0%
unpow250.0%
unpow250.0%
hypot-undefine78.6%
Simplified78.6%
if 1.2e281 < y.re < 9.9999999999999998e284Initial program 33.3%
Taylor expanded in y.im around 0 66.7%
Taylor expanded in y.re around 0 67.2%
*-commutative67.2%
distribute-lft-neg-in67.2%
Simplified67.2%
Taylor expanded in y.im around 0 8.8%
*-commutative8.8%
log1p-expm1-u100.0%
Applied egg-rr100.0%
Final simplification81.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_2 (log (hypot x.im x.re)))
(t_3 (sin (* y.im t_2))))
(if (<= y.re -7e-7)
(* t_1 (fabs t_3))
(if (<= y.re 4900000.0)
(*
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))
(sin (* y.im (+ t_2 (* y.re (/ (atan2 x.im x.re) y.im))))))
(if (<= y.re 9e+145)
(* t_1 (sin (fabs t_0)))
(if (<= y.re 8.2e+179)
(log (pow (exp y.re) (atan2 x.im x.re)))
(if (or (<= y.re 1e+281) (not (<= y.re 6.5e+284)))
(* t_1 t_3)
(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 t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = log(hypot(x_46_im, x_46_re));
double t_3 = sin((y_46_im * t_2));
double tmp;
if (y_46_re <= -7e-7) {
tmp = t_1 * fabs(t_3);
} else if (y_46_re <= 4900000.0) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re))) * sin((y_46_im * (t_2 + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
} else if (y_46_re <= 9e+145) {
tmp = t_1 * sin(fabs(t_0));
} else if (y_46_re <= 8.2e+179) {
tmp = log(pow(exp(y_46_re), atan2(x_46_im, x_46_re)));
} else if ((y_46_re <= 1e+281) || !(y_46_re <= 6.5e+284)) {
tmp = t_1 * t_3;
} 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 t_1 = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_3 = Math.sin((y_46_im * t_2));
double tmp;
if (y_46_re <= -7e-7) {
tmp = t_1 * Math.abs(t_3);
} else if (y_46_re <= 4900000.0) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re))) * Math.sin((y_46_im * (t_2 + (y_46_re * (Math.atan2(x_46_im, x_46_re) / y_46_im)))));
} else if (y_46_re <= 9e+145) {
tmp = t_1 * Math.sin(Math.abs(t_0));
} else if (y_46_re <= 8.2e+179) {
tmp = Math.log(Math.pow(Math.exp(y_46_re), Math.atan2(x_46_im, x_46_re)));
} else if ((y_46_re <= 1e+281) || !(y_46_re <= 6.5e+284)) {
tmp = t_1 * t_3;
} 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) t_1 = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) t_2 = math.log(math.hypot(x_46_im, x_46_re)) t_3 = math.sin((y_46_im * t_2)) tmp = 0 if y_46_re <= -7e-7: tmp = t_1 * math.fabs(t_3) elif y_46_re <= 4900000.0: tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) * math.sin((y_46_im * (t_2 + (y_46_re * (math.atan2(x_46_im, x_46_re) / y_46_im))))) elif y_46_re <= 9e+145: tmp = t_1 * math.sin(math.fabs(t_0)) elif y_46_re <= 8.2e+179: tmp = math.log(math.pow(math.exp(y_46_re), math.atan2(x_46_im, x_46_re))) elif (y_46_re <= 1e+281) or not (y_46_re <= 6.5e+284): tmp = t_1 * t_3 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)) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_2 = log(hypot(x_46_im, x_46_re)) t_3 = sin(Float64(y_46_im * t_2)) tmp = 0.0 if (y_46_re <= -7e-7) tmp = Float64(t_1 * abs(t_3)); elseif (y_46_re <= 4900000.0) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) * sin(Float64(y_46_im * Float64(t_2 + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); elseif (y_46_re <= 9e+145) tmp = Float64(t_1 * sin(abs(t_0))); elseif (y_46_re <= 8.2e+179) tmp = log((exp(y_46_re) ^ atan(x_46_im, x_46_re))); elseif ((y_46_re <= 1e+281) || !(y_46_re <= 6.5e+284)) tmp = Float64(t_1 * t_3); 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]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(y$46$im * t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7e-7], N[(t$95$1 * N[Abs[t$95$3], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4900000.0], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$im * N[(t$95$2 + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9e+145], N[(t$95$1 * N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.2e+179], N[Log[N[Power[N[Exp[y$46$re], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[y$46$re, 1e+281], N[Not[LessEqual[y$46$re, 6.5e+284]], $MachinePrecision]], N[(t$95$1 * t$95$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}\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_3 := \sin \left(y.im \cdot t\_2\right)\\
\mathbf{if}\;y.re \leq -7 \cdot 10^{-7}:\\
\;\;\;\;t\_1 \cdot \left|t\_3\right|\\
\mathbf{elif}\;y.re \leq 4900000:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sin \left(y.im \cdot \left(t\_2 + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\mathbf{elif}\;y.re \leq 9 \cdot 10^{+145}:\\
\;\;\;\;t\_1 \cdot \sin \left(\left|t\_0\right|\right)\\
\mathbf{elif}\;y.re \leq 8.2 \cdot 10^{+179}:\\
\;\;\;\;\log \left({\left(e^{y.re}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{elif}\;y.re \leq 10^{+281} \lor \neg \left(y.re \leq 6.5 \cdot 10^{+284}\right):\\
\;\;\;\;t\_1 \cdot t\_3\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_0\right)\right)\\
\end{array}
\end{array}
if y.re < -6.99999999999999968e-7Initial program 41.3%
Taylor expanded in y.re around 0 41.3%
unpow241.3%
unpow241.3%
hypot-undefine87.4%
Simplified87.4%
add-sqr-sqrt42.9%
sqrt-unprod89.2%
pow289.2%
hypot-undefine43.1%
+-commutative43.1%
hypot-define89.2%
Applied egg-rr89.2%
unpow289.2%
rem-sqrt-square89.2%
hypot-undefine43.1%
unpow243.1%
unpow243.1%
+-commutative43.1%
unpow243.1%
unpow243.1%
hypot-define89.2%
Simplified89.2%
if -6.99999999999999968e-7 < y.re < 4.9e6Initial program 42.7%
exp-diff42.7%
exp-to-pow42.7%
hypot-define42.7%
*-commutative42.7%
exp-prod42.7%
fma-define42.7%
hypot-define81.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in y.im around inf 42.7%
unpow242.7%
unpow242.7%
hypot-undefine81.9%
associate-/l*81.9%
Simplified81.9%
if 4.9e6 < y.re < 8.9999999999999996e145Initial program 22.2%
Taylor expanded in y.im around 0 51.9%
*-commutative51.9%
add-sqr-sqrt25.9%
sqrt-unprod55.6%
pow255.6%
Applied egg-rr55.6%
*-commutative55.6%
unpow255.6%
rem-sqrt-square66.7%
Simplified66.7%
if 8.9999999999999996e145 < y.re < 8.20000000000000021e179Initial program 9.1%
Taylor expanded in y.im around 0 18.3%
Taylor expanded in y.re around 0 29.7%
*-commutative29.7%
distribute-lft-neg-in29.7%
Simplified29.7%
Taylor expanded in y.im around 0 3.7%
*-commutative3.7%
add-log-exp64.1%
*-commutative64.1%
exp-prod73.0%
Applied egg-rr73.0%
if 8.20000000000000021e179 < y.re < 1e281 or 6.50000000000000027e284 < y.re Initial program 35.7%
Taylor expanded in y.re around 0 50.0%
unpow250.0%
unpow250.0%
hypot-undefine78.6%
Simplified78.6%
if 1e281 < y.re < 6.50000000000000027e284Initial program 33.3%
Taylor expanded in y.im around 0 66.7%
Taylor expanded in y.re around 0 67.2%
*-commutative67.2%
distribute-lft-neg-in67.2%
Simplified67.2%
Taylor expanded in y.im around 0 8.8%
*-commutative8.8%
log1p-expm1-u100.0%
Applied egg-rr100.0%
Final simplification81.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_1
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im))))))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (sin (* y.im (log (hypot x.im x.re))))))
(if (<= y.im -3.95e+136)
t_1
(if (<= y.im -7.5e-30)
(* t_0 t_3)
(if (<= y.im 3.1e+16)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_2))
(pow (hypot x.re x.im) y.re))
(if (<= y.im 9.4e+95)
(* t_0 (fabs t_3))
(if (<= y.im 9.2e+258) t_1 (* t_0 (fabs (sin t_2))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -3.95e+136) {
tmp = t_1;
} else if (y_46_im <= -7.5e-30) {
tmp = t_0 * t_3;
} else if (y_46_im <= 3.1e+16) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_im <= 9.4e+95) {
tmp = t_0 * fabs(t_3);
} else if (y_46_im <= 9.2e+258) {
tmp = t_1;
} else {
tmp = t_0 * fabs(sin(t_2));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_1 = 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))))) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -3.95e+136) tmp = t_1; elseif (y_46_im <= -7.5e-30) tmp = Float64(t_0 * t_3); elseif (y_46_im <= 3.1e+16) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif (y_46_im <= 9.4e+95) tmp = Float64(t_0 * abs(t_3)); elseif (y_46_im <= 9.2e+258) tmp = t_1; else tmp = Float64(t_0 * abs(sin(t_2))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -3.95e+136], t$95$1, If[LessEqual[y$46$im, -7.5e-30], N[(t$95$0 * t$95$3), $MachinePrecision], If[LessEqual[y$46$im, 3.1e+16], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9.4e+95], N[(t$95$0 * N[Abs[t$95$3], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9.2e+258], t$95$1, N[(t$95$0 * N[Abs[N[Sin[t$95$2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := 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)\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.im \leq -3.95 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -7.5 \cdot 10^{-30}:\\
\;\;\;\;t\_0 \cdot t\_3\\
\mathbf{elif}\;y.im \leq 3.1 \cdot 10^{+16}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_2\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 9.4 \cdot 10^{+95}:\\
\;\;\;\;t\_0 \cdot \left|t\_3\right|\\
\mathbf{elif}\;y.im \leq 9.2 \cdot 10^{+258}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left|\sin t\_2\right|\\
\end{array}
\end{array}
if y.im < -3.9500000000000002e136 or 9.39999999999999945e95 < y.im < 9.2000000000000004e258Initial program 31.5%
Taylor expanded in y.im around 0 49.7%
Taylor expanded in y.re around 0 64.7%
*-commutative64.7%
distribute-lft-neg-in64.7%
Simplified64.7%
if -3.9500000000000002e136 < y.im < -7.5000000000000006e-30Initial program 33.4%
Taylor expanded in y.re around 0 44.5%
unpow244.5%
unpow244.5%
hypot-undefine66.9%
Simplified66.9%
if -7.5000000000000006e-30 < y.im < 3.1e16Initial program 44.1%
exp-diff44.1%
exp-to-pow44.1%
hypot-define44.1%
*-commutative44.1%
exp-prod44.1%
fma-define44.1%
hypot-define87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in y.im around 0 88.2%
if 3.1e16 < y.im < 9.39999999999999945e95Initial program 37.0%
Taylor expanded in y.re around 0 42.3%
unpow242.3%
unpow242.3%
hypot-undefine63.4%
Simplified63.4%
add-sqr-sqrt42.2%
sqrt-unprod74.8%
pow274.8%
hypot-undefine43.1%
+-commutative43.1%
hypot-define74.8%
Applied egg-rr74.8%
unpow274.8%
rem-sqrt-square74.8%
hypot-undefine43.1%
unpow243.1%
unpow243.1%
+-commutative43.1%
unpow243.1%
unpow243.1%
hypot-define74.8%
Simplified74.8%
if 9.2000000000000004e258 < y.im Initial program 25.0%
Taylor expanded in y.im around 0 50.2%
add-sqr-sqrt37.5%
sqrt-unprod50.2%
pow250.2%
*-commutative50.2%
Applied egg-rr50.2%
*-commutative50.2%
unpow250.2%
rem-sqrt-square75.2%
Simplified75.2%
Final simplification77.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_1
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im))))))
(t_2 (* y.re (atan2 x.im x.re))))
(if (<= y.im -6.6e+136)
t_1
(if (<= y.im -1e-29)
(* t_0 (sin (* y.im (log (hypot x.im x.re)))))
(if (<= y.im 3.1e+16)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_2))
(pow (hypot x.re x.im) y.re))
(if (or (<= y.im 1.45e+105) (not (<= y.im 5.6e+259)))
(* t_0 (fabs (sin t_2)))
t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -6.6e+136) {
tmp = t_1;
} else if (y_46_im <= -1e-29) {
tmp = t_0 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_im <= 3.1e+16) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if ((y_46_im <= 1.45e+105) || !(y_46_im <= 5.6e+259)) {
tmp = t_0 * fabs(sin(t_2));
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_1 = 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))))) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -6.6e+136) tmp = t_1; elseif (y_46_im <= -1e-29) tmp = Float64(t_0 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (y_46_im <= 3.1e+16) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif ((y_46_im <= 1.45e+105) || !(y_46_im <= 5.6e+259)) tmp = Float64(t_0 * abs(sin(t_2))); else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -6.6e+136], t$95$1, If[LessEqual[y$46$im, -1e-29], N[(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]), $MachinePrecision], If[LessEqual[y$46$im, 3.1e+16], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, 1.45e+105], N[Not[LessEqual[y$46$im, 5.6e+259]], $MachinePrecision]], N[(t$95$0 * N[Abs[N[Sin[t$95$2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := 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)\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -6.6 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -1 \cdot 10^{-29}:\\
\;\;\;\;t\_0 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.im \leq 3.1 \cdot 10^{+16}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_2\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 1.45 \cdot 10^{+105} \lor \neg \left(y.im \leq 5.6 \cdot 10^{+259}\right):\\
\;\;\;\;t\_0 \cdot \left|\sin t\_2\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -6.59999999999999984e136 or 1.45000000000000005e105 < y.im < 5.6000000000000001e259Initial program 31.5%
Taylor expanded in y.im around 0 49.7%
Taylor expanded in y.re around 0 64.7%
*-commutative64.7%
distribute-lft-neg-in64.7%
Simplified64.7%
if -6.59999999999999984e136 < y.im < -9.99999999999999943e-30Initial program 33.4%
Taylor expanded in y.re around 0 44.5%
unpow244.5%
unpow244.5%
hypot-undefine66.9%
Simplified66.9%
if -9.99999999999999943e-30 < y.im < 3.1e16Initial program 44.1%
exp-diff44.1%
exp-to-pow44.1%
hypot-define44.1%
*-commutative44.1%
exp-prod44.1%
fma-define44.1%
hypot-define87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in y.im around 0 88.2%
if 3.1e16 < y.im < 1.45000000000000005e105 or 5.6000000000000001e259 < y.im Initial program 33.4%
Taylor expanded in y.im around 0 55.9%
add-sqr-sqrt41.0%
sqrt-unprod67.0%
pow267.0%
*-commutative67.0%
Applied egg-rr67.0%
*-commutative67.0%
unpow267.0%
rem-sqrt-square74.4%
Simplified74.4%
Final simplification77.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im))))))
(t_1 (* y.re (atan2 x.im x.re))))
(if (<= y.im -2.1e+19)
t_0
(if (<= y.im 3.1e+16)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_1))
(pow (hypot x.re x.im) y.re))
(if (or (<= y.im 7.4e+104) (not (<= y.im 2.65e+258)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(fabs (sin t_1)))
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) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -2.1e+19) {
tmp = t_0;
} else if (y_46_im <= 3.1e+16) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if ((y_46_im <= 7.4e+104) || !(y_46_im <= 2.65e+258)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * fabs(sin(t_1));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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))))) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -2.1e+19) tmp = t_0; elseif (y_46_im <= 3.1e+16) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif ((y_46_im <= 7.4e+104) || !(y_46_im <= 2.65e+258)) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * abs(sin(t_1))); else tmp = 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[(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]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.1e+19], t$95$0, If[LessEqual[y$46$im, 3.1e+16], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, 7.4e+104], N[Not[LessEqual[y$46$im, 2.65e+258]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[N[Sin[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -2.1 \cdot 10^{+19}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 3.1 \cdot 10^{+16}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 7.4 \cdot 10^{+104} \lor \neg \left(y.im \leq 2.65 \cdot 10^{+258}\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left|\sin t\_1\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -2.1e19 or 7.3999999999999997e104 < y.im < 2.65000000000000003e258Initial program 33.0%
Taylor expanded in y.im around 0 51.4%
Taylor expanded in y.re around 0 61.4%
*-commutative61.4%
distribute-lft-neg-in61.4%
Simplified61.4%
if -2.1e19 < y.im < 3.1e16Initial program 42.5%
exp-diff42.5%
exp-to-pow42.5%
hypot-define42.5%
*-commutative42.5%
exp-prod42.5%
fma-define42.5%
hypot-define85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y.im around 0 86.0%
if 3.1e16 < y.im < 7.3999999999999997e104 or 2.65000000000000003e258 < y.im Initial program 33.4%
Taylor expanded in y.im around 0 55.9%
add-sqr-sqrt41.0%
sqrt-unprod67.0%
pow267.0%
*-commutative67.0%
Applied egg-rr67.0%
*-commutative67.0%
unpow267.0%
rem-sqrt-square74.4%
Simplified74.4%
Final simplification75.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -4.2e+17)
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.im 1.15e+46)
(*
(sin (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(pow (hypot x.re x.im) y.re))
(* y.re (* (atan2 x.im x.re) (pow (exp (- y.im)) (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -4.2e+17) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else if (y_46_im <= 1.15e+46) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(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) tmp = 0.0 if (y_46_im <= -4.2e+17) 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))))); elseif (y_46_im <= 1.15e+46) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(Float64(-y_46_im)) ^ 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[LessEqual[y$46$im, -4.2e+17], 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], If[LessEqual[y$46$im, 1.15e+46], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.2 \cdot 10^{+17}:\\
\;\;\;\;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{elif}\;y.im \leq 1.15 \cdot 10^{+46}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\end{array}
\end{array}
if y.im < -4.2e17Initial program 29.9%
Taylor expanded in y.im around 0 46.0%
Taylor expanded in y.re around 0 53.1%
*-commutative53.1%
distribute-lft-neg-in53.1%
Simplified53.1%
if -4.2e17 < y.im < 1.15e46Initial program 42.0%
exp-diff41.3%
exp-to-pow41.3%
hypot-define41.3%
*-commutative41.3%
exp-prod41.3%
fma-define41.3%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y.im around 0 85.7%
if 1.15e46 < y.im Initial program 36.4%
Taylor expanded in y.im around 0 56.5%
Taylor expanded in y.re around 0 61.0%
*-commutative61.0%
distribute-lft-neg-in61.0%
exp-prod62.5%
Simplified62.5%
Final simplification72.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2 (sin (* y.im (log (hypot x.im x.re)))))
(t_3 (* t_2 (exp (- (* y.re (log x.im)) t_1))))
(t_4
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_1))
(sin t_0))))
(if (<= x.im -3.2e-64)
(* t_2 (exp (- (* y.re (log (- x.im))) t_1)))
(if (<= x.im -3.5e-254)
t_4
(if (<= x.im 4.5e-306)
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= x.im 1.52e-248)
t_3
(if (<= x.im 2.9e-235)
(*
(exp (- (* y.re (log (- x.re))) t_1))
(sin (+ t_0 (* y.im (log x.im)))))
(if (or (<= x.im 1.06e-218) (not (<= x.im 2e+29))) t_3 t_4))))))))
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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_3 = t_2 * exp(((y_46_re * log(x_46_im)) - t_1));
double t_4 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_1)) * sin(t_0);
double tmp;
if (x_46_im <= -3.2e-64) {
tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_1));
} else if (x_46_im <= -3.5e-254) {
tmp = t_4;
} else if (x_46_im <= 4.5e-306) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else if (x_46_im <= 1.52e-248) {
tmp = t_3;
} else if (x_46_im <= 2.9e-235) {
tmp = exp(((y_46_re * log(-x_46_re)) - t_1)) * sin((t_0 + (y_46_im * log(x_46_im))));
} else if ((x_46_im <= 1.06e-218) || !(x_46_im <= 2e+29)) {
tmp = t_3;
} else {
tmp = t_4;
}
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.atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_3 = t_2 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_1));
double t_4 = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_1)) * Math.sin(t_0);
double tmp;
if (x_46_im <= -3.2e-64) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_1));
} else if (x_46_im <= -3.5e-254) {
tmp = t_4;
} else if (x_46_im <= 4.5e-306) {
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 if (x_46_im <= 1.52e-248) {
tmp = t_3;
} else if (x_46_im <= 2.9e-235) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_re)) - t_1)) * Math.sin((t_0 + (y_46_im * Math.log(x_46_im))));
} else if ((x_46_im <= 1.06e-218) || !(x_46_im <= 2e+29)) {
tmp = t_3;
} else {
tmp = t_4;
}
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.atan2(x_46_im, x_46_re) * y_46_im t_2 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_3 = t_2 * math.exp(((y_46_re * math.log(x_46_im)) - t_1)) t_4 = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_1)) * math.sin(t_0) tmp = 0 if x_46_im <= -3.2e-64: tmp = t_2 * math.exp(((y_46_re * math.log(-x_46_im)) - t_1)) elif x_46_im <= -3.5e-254: tmp = t_4 elif x_46_im <= 4.5e-306: 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))) elif x_46_im <= 1.52e-248: tmp = t_3 elif x_46_im <= 2.9e-235: tmp = math.exp(((y_46_re * math.log(-x_46_re)) - t_1)) * math.sin((t_0 + (y_46_im * math.log(x_46_im)))) elif (x_46_im <= 1.06e-218) or not (x_46_im <= 2e+29): tmp = t_3 else: tmp = t_4 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(atan(x_46_im, x_46_re) * y_46_im) t_2 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_3 = Float64(t_2 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_1))) t_4 = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_1)) * sin(t_0)) tmp = 0.0 if (x_46_im <= -3.2e-64) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_1))); elseif (x_46_im <= -3.5e-254) tmp = t_4; elseif (x_46_im <= 4.5e-306) 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))))); elseif (x_46_im <= 1.52e-248) tmp = t_3; elseif (x_46_im <= 2.9e-235) tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_1)) * sin(Float64(t_0 + Float64(y_46_im * log(x_46_im))))); elseif ((x_46_im <= 1.06e-218) || !(x_46_im <= 2e+29)) tmp = t_3; else tmp = t_4; 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 = atan2(x_46_im, x_46_re) * y_46_im; t_2 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); t_3 = t_2 * exp(((y_46_re * log(x_46_im)) - t_1)); t_4 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_1)) * sin(t_0); tmp = 0.0; if (x_46_im <= -3.2e-64) tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_1)); elseif (x_46_im <= -3.5e-254) tmp = t_4; elseif (x_46_im <= 4.5e-306) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); elseif (x_46_im <= 1.52e-248) tmp = t_3; elseif (x_46_im <= 2.9e-235) tmp = exp(((y_46_re * log(-x_46_re)) - t_1)) * sin((t_0 + (y_46_im * log(x_46_im)))); elseif ((x_46_im <= 1.06e-218) || ~((x_46_im <= 2e+29))) tmp = t_3; else tmp = t_4; 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -3.2e-64], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -3.5e-254], t$95$4, If[LessEqual[x$46$im, 4.5e-306], 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], If[LessEqual[x$46$im, 1.52e-248], t$95$3, If[LessEqual[x$46$im, 2.9e-235], N[(N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$im, 1.06e-218], N[Not[LessEqual[x$46$im, 2e+29]], $MachinePrecision]], t$95$3, t$95$4]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_3 := t\_2 \cdot e^{y.re \cdot \log x.im - t\_1}\\
t_4 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_1} \cdot \sin t\_0\\
\mathbf{if}\;x.im \leq -3.2 \cdot 10^{-64}:\\
\;\;\;\;t\_2 \cdot e^{y.re \cdot \log \left(-x.im\right) - t\_1}\\
\mathbf{elif}\;x.im \leq -3.5 \cdot 10^{-254}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x.im \leq 4.5 \cdot 10^{-306}:\\
\;\;\;\;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{elif}\;x.im \leq 1.52 \cdot 10^{-248}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x.im \leq 2.9 \cdot 10^{-235}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - t\_1} \cdot \sin \left(t\_0 + y.im \cdot \log x.im\right)\\
\mathbf{elif}\;x.im \leq 1.06 \cdot 10^{-218} \lor \neg \left(x.im \leq 2 \cdot 10^{+29}\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if x.im < -3.19999999999999975e-64Initial program 31.3%
Taylor expanded in y.re around 0 26.7%
unpow226.7%
unpow226.7%
hypot-undefine56.4%
Simplified56.4%
Taylor expanded in x.im around -inf 72.3%
mul-1-neg62.0%
Simplified72.3%
if -3.19999999999999975e-64 < x.im < -3.50000000000000007e-254 or 1.0600000000000001e-218 < x.im < 1.99999999999999983e29Initial program 56.1%
Taylor expanded in y.im around 0 65.1%
if -3.50000000000000007e-254 < x.im < 4.50000000000000005e-306Initial program 29.4%
Taylor expanded in y.im around 0 41.7%
Taylor expanded in y.re around 0 65.2%
*-commutative65.2%
distribute-lft-neg-in65.2%
Simplified65.2%
if 4.50000000000000005e-306 < x.im < 1.52e-248 or 2.90000000000000009e-235 < x.im < 1.0600000000000001e-218 or 1.99999999999999983e29 < x.im Initial program 27.5%
Taylor expanded in y.re around 0 29.4%
unpow229.4%
unpow229.4%
hypot-undefine61.9%
Simplified61.9%
Taylor expanded in x.re around 0 77.7%
if 1.52e-248 < x.im < 2.90000000000000009e-235Initial program 20.0%
Taylor expanded in x.im around -inf 0.0%
mul-1-neg0.0%
Simplified0.0%
Taylor expanded in x.re around -inf 0.0%
mul-1-neg0.0%
Simplified0.0%
pow10.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-prod99.7%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
unpow199.7%
Simplified99.7%
Final simplification71.5%
(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))))
(t_2 (* t_1 (exp (- (* y.re (log (- x.im))) t_0)))))
(if (<= x.im -1.85e-30)
t_2
(if (<= x.im -2.7e-153)
(* (pow (hypot x.re x.im) y.re) t_1)
(if (<= x.im -5.2e-249)
t_2
(if (<= x.im 4.1e-306)
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))
(*
(sin (* y.im (log (hypot x.im x.re))))
(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 t_2 = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0));
double tmp;
if (x_46_im <= -1.85e-30) {
tmp = t_2;
} else if (x_46_im <= -2.7e-153) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * t_1;
} else if (x_46_im <= -5.2e-249) {
tmp = t_2;
} else if (x_46_im <= 4.1e-306) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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 t_2 = t_1 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
double tmp;
if (x_46_im <= -1.85e-30) {
tmp = t_2;
} else if (x_46_im <= -2.7e-153) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * t_1;
} else if (x_46_im <= -5.2e-249) {
tmp = t_2;
} else if (x_46_im <= 4.1e-306) {
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.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * 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))) t_2 = t_1 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) tmp = 0 if x_46_im <= -1.85e-30: tmp = t_2 elif x_46_im <= -2.7e-153: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * t_1 elif x_46_im <= -5.2e-249: tmp = t_2 elif x_46_im <= 4.1e-306: 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.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * 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))) t_2 = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))) tmp = 0.0 if (x_46_im <= -1.85e-30) tmp = t_2; elseif (x_46_im <= -2.7e-153) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * t_1); elseif (x_46_im <= -5.2e-249) tmp = t_2; elseif (x_46_im <= 4.1e-306) 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 = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * 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))); t_2 = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0)); tmp = 0.0; if (x_46_im <= -1.85e-30) tmp = t_2; elseif (x_46_im <= -2.7e-153) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * t_1; elseif (x_46_im <= -5.2e-249) tmp = t_2; elseif (x_46_im <= 4.1e-306) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); else tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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]}, Block[{t$95$2 = 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.85e-30], t$95$2, If[LessEqual[x$46$im, -2.7e-153], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[x$46$im, -5.2e-249], t$95$2, If[LessEqual[x$46$im, 4.1e-306], 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[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 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)\\
t_2 := t\_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{if}\;x.im \leq -1.85 \cdot 10^{-30}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x.im \leq -2.7 \cdot 10^{-153}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_1\\
\mathbf{elif}\;x.im \leq -5.2 \cdot 10^{-249}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x.im \leq 4.1 \cdot 10^{-306}:\\
\;\;\;\;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}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log x.im - t\_0}\\
\end{array}
\end{array}
if x.im < -1.8500000000000002e-30 or -2.70000000000000009e-153 < x.im < -5.19999999999999954e-249Initial program 33.3%
Taylor expanded in y.im around 0 50.7%
Taylor expanded in x.im around -inf 64.9%
mul-1-neg64.9%
Simplified64.9%
if -1.8500000000000002e-30 < x.im < -2.70000000000000009e-153Initial program 50.1%
Taylor expanded in y.im around 0 63.4%
Taylor expanded in y.im around 0 51.5%
+-commutative51.5%
unpow251.5%
unpow251.5%
hypot-undefine51.7%
Simplified51.7%
if -5.19999999999999954e-249 < x.im < 4.09999999999999985e-306Initial program 31.6%
Taylor expanded in y.im around 0 42.6%
Taylor expanded in y.re around 0 58.6%
*-commutative58.6%
distribute-lft-neg-in58.6%
Simplified58.6%
if 4.09999999999999985e-306 < x.im Initial program 40.2%
Taylor expanded in y.re around 0 38.0%
unpow238.0%
unpow238.0%
hypot-undefine62.4%
Simplified62.4%
Taylor expanded in x.re around 0 67.5%
Final simplification64.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (- x.im)))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2 (sin (* y.im (log (hypot x.im x.re)))))
(t_3 (* t_2 (exp (- (* y.re t_0) t_1)))))
(if (<= x.im -5.8e-41)
t_3
(if (<= x.im -1.75e-193)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_1))
(sin (* y.im t_0)))
(if (<= x.im -6.4e-218)
t_3
(if (<= x.im 7.5e-305)
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))
(* t_2 (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 = log(-x_46_im);
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_3 = t_2 * exp(((y_46_re * t_0) - t_1));
double tmp;
if (x_46_im <= -5.8e-41) {
tmp = t_3;
} else if (x_46_im <= -1.75e-193) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_1)) * sin((y_46_im * t_0));
} else if (x_46_im <= -6.4e-218) {
tmp = t_3;
} else if (x_46_im <= 7.5e-305) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = t_2 * 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.log(-x_46_im);
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_3 = t_2 * Math.exp(((y_46_re * t_0) - t_1));
double tmp;
if (x_46_im <= -5.8e-41) {
tmp = t_3;
} else if (x_46_im <= -1.75e-193) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_1)) * Math.sin((y_46_im * t_0));
} else if (x_46_im <= -6.4e-218) {
tmp = t_3;
} else if (x_46_im <= 7.5e-305) {
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 = t_2 * 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.log(-x_46_im) t_1 = math.atan2(x_46_im, x_46_re) * y_46_im t_2 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_3 = t_2 * math.exp(((y_46_re * t_0) - t_1)) tmp = 0 if x_46_im <= -5.8e-41: tmp = t_3 elif x_46_im <= -1.75e-193: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_1)) * math.sin((y_46_im * t_0)) elif x_46_im <= -6.4e-218: tmp = t_3 elif x_46_im <= 7.5e-305: 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 = t_2 * 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 = log(Float64(-x_46_im)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_3 = Float64(t_2 * exp(Float64(Float64(y_46_re * t_0) - t_1))) tmp = 0.0 if (x_46_im <= -5.8e-41) tmp = t_3; elseif (x_46_im <= -1.75e-193) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_1)) * sin(Float64(y_46_im * t_0))); elseif (x_46_im <= -6.4e-218) tmp = t_3; elseif (x_46_im <= 7.5e-305) 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 = Float64(t_2 * 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 = log(-x_46_im); t_1 = atan2(x_46_im, x_46_re) * y_46_im; t_2 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); t_3 = t_2 * exp(((y_46_re * t_0) - t_1)); tmp = 0.0; if (x_46_im <= -5.8e-41) tmp = t_3; elseif (x_46_im <= -1.75e-193) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_1)) * sin((y_46_im * t_0)); elseif (x_46_im <= -6.4e-218) tmp = t_3; elseif (x_46_im <= 7.5e-305) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); else tmp = t_2 * 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[Log[(-x$46$im)], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[(t$95$2 * N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -5.8e-41], t$95$3, If[LessEqual[x$46$im, -1.75e-193], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -6.4e-218], t$95$3, If[LessEqual[x$46$im, 7.5e-305], 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[(t$95$2 * 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 := \log \left(-x.im\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_3 := t\_2 \cdot e^{y.re \cdot t\_0 - t\_1}\\
\mathbf{if}\;x.im \leq -5.8 \cdot 10^{-41}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x.im \leq -1.75 \cdot 10^{-193}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_1} \cdot \sin \left(y.im \cdot t\_0\right)\\
\mathbf{elif}\;x.im \leq -6.4 \cdot 10^{-218}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x.im \leq 7.5 \cdot 10^{-305}:\\
\;\;\;\;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}:\\
\;\;\;\;t\_2 \cdot e^{y.re \cdot \log x.im - t\_1}\\
\end{array}
\end{array}
if x.im < -5.79999999999999955e-41 or -1.75000000000000002e-193 < x.im < -6.4000000000000002e-218Initial program 28.8%
Taylor expanded in y.re around 0 24.2%
unpow224.2%
unpow224.2%
hypot-undefine55.2%
Simplified55.2%
Taylor expanded in x.im around -inf 72.2%
mul-1-neg61.0%
Simplified72.2%
if -5.79999999999999955e-41 < x.im < -1.75000000000000002e-193Initial program 56.8%
Taylor expanded in x.im around -inf 77.0%
mul-1-neg50.3%
Simplified77.0%
Taylor expanded in y.re around 0 61.4%
if -6.4000000000000002e-218 < x.im < 7.5000000000000003e-305Initial program 34.6%
Taylor expanded in y.im around 0 50.3%
Taylor expanded in y.re around 0 62.0%
*-commutative62.0%
distribute-lft-neg-in62.0%
Simplified62.0%
if 7.5000000000000003e-305 < x.im Initial program 40.2%
Taylor expanded in y.re around 0 38.0%
unpow238.0%
unpow238.0%
hypot-undefine62.4%
Simplified62.4%
Taylor expanded in x.re around 0 67.5%
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.im (log (hypot x.im x.re))))))
(if (<= x.im -2.2e-149)
(* t_1 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 2.1e-305)
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))
(* 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_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (x_46_im <= -2.2e-149) {
tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 2.1e-305) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} 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_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (x_46_im <= -2.2e-149) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 2.1e-305) {
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 = 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_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if x_46_im <= -2.2e-149: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 2.1e-305: 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 = 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_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (x_46_im <= -2.2e-149) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 2.1e-305) 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 = 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_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (x_46_im <= -2.2e-149) tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 2.1e-305) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); 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$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -2.2e-149], 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, 2.1e-305], 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[(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.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;x.im \leq -2.2 \cdot 10^{-149}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{elif}\;x.im \leq 2.1 \cdot 10^{-305}:\\
\;\;\;\;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}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log x.im - t\_0}\\
\end{array}
\end{array}
if x.im < -2.1999999999999998e-149Initial program 34.6%
Taylor expanded in y.re around 0 29.8%
unpow229.8%
unpow229.8%
hypot-undefine58.0%
Simplified58.0%
Taylor expanded in x.im around -inf 67.5%
mul-1-neg58.8%
Simplified67.5%
if -2.1999999999999998e-149 < x.im < 2.1e-305Initial program 39.0%
Taylor expanded in y.im around 0 51.5%
Taylor expanded in y.re around 0 56.6%
*-commutative56.6%
distribute-lft-neg-in56.6%
Simplified56.6%
if 2.1e-305 < x.im Initial program 40.2%
Taylor expanded in y.re around 0 38.0%
unpow238.0%
unpow238.0%
hypot-undefine62.4%
Simplified62.4%
Taylor expanded in x.re around 0 67.5%
Final simplification65.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (pow (hypot x.re x.im) y.re) (sin (* y.re (atan2 x.im x.re))))))
(if (<= y.re -2.25e-7)
t_0
(if (<= y.re 4.7e-26)
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))
(if (or (<= y.re 2.7e+117) (not (<= y.re 1.08e+182)))
t_0
(log (pow (exp 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 = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -2.25e-7) {
tmp = t_0;
} else if (y_46_re <= 4.7e-26) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else if ((y_46_re <= 2.7e+117) || !(y_46_re <= 1.08e+182)) {
tmp = t_0;
} else {
tmp = log(pow(exp(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.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -2.25e-7) {
tmp = t_0;
} else if (y_46_re <= 4.7e-26) {
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 if ((y_46_re <= 2.7e+117) || !(y_46_re <= 1.08e+182)) {
tmp = t_0;
} else {
tmp = Math.log(Math.pow(Math.exp(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.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -2.25e-7: tmp = t_0 elif y_46_re <= 4.7e-26: 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))) elif (y_46_re <= 2.7e+117) or not (y_46_re <= 1.08e+182): tmp = t_0 else: tmp = math.log(math.pow(math.exp(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((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -2.25e-7) tmp = t_0; elseif (y_46_re <= 4.7e-26) 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))))); elseif ((y_46_re <= 2.7e+117) || !(y_46_re <= 1.08e+182)) tmp = t_0; else tmp = log((exp(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 = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -2.25e-7) tmp = t_0; elseif (y_46_re <= 4.7e-26) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); elseif ((y_46_re <= 2.7e+117) || ~((y_46_re <= 1.08e+182))) tmp = t_0; else tmp = log((exp(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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.25e-7], t$95$0, If[LessEqual[y$46$re, 4.7e-26], 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], If[Or[LessEqual[y$46$re, 2.7e+117], N[Not[LessEqual[y$46$re, 1.08e+182]], $MachinePrecision]], t$95$0, N[Log[N[Power[N[Exp[y$46$re], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -2.25 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4.7 \cdot 10^{-26}:\\
\;\;\;\;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{elif}\;y.re \leq 2.7 \cdot 10^{+117} \lor \neg \left(y.re \leq 1.08 \cdot 10^{+182}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\log \left({\left(e^{y.re}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\end{array}
\end{array}
if y.re < -2.2499999999999999e-7 or 4.69999999999999989e-26 < y.re < 2.7000000000000002e117 or 1.08000000000000003e182 < y.re Initial program 36.5%
Taylor expanded in y.im around 0 73.0%
Taylor expanded in y.im around 0 72.2%
+-commutative72.2%
unpow272.2%
unpow272.2%
hypot-undefine72.2%
Simplified72.2%
if -2.2499999999999999e-7 < y.re < 4.69999999999999989e-26Initial program 42.2%
Taylor expanded in y.im around 0 41.4%
Taylor expanded in y.re around 0 57.3%
*-commutative57.3%
distribute-lft-neg-in57.3%
Simplified57.3%
if 2.7000000000000002e117 < y.re < 1.08000000000000003e182Initial program 13.3%
Taylor expanded in y.im around 0 13.4%
Taylor expanded in y.re around 0 28.6%
*-commutative28.6%
distribute-lft-neg-in28.6%
Simplified28.6%
Taylor expanded in y.im around 0 3.4%
*-commutative3.4%
add-log-exp60.3%
*-commutative60.3%
exp-prod66.9%
Applied egg-rr66.9%
Final simplification64.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 5.2e+142) (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im))))) (log (pow (exp 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_re <= 5.2e+142) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = log(pow(exp(y_46_re), atan2(x_46_im, x_46_re)));
}
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 <= 5.2d+142) then
tmp = y_46re * (atan2(x_46im, x_46re) * exp((atan2(x_46im, x_46re) * -y_46im)))
else
tmp = log((exp(y_46re) ** atan2(x_46im, x_46re)))
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 <= 5.2e+142) {
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.log(Math.pow(Math.exp(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_re <= 5.2e+142: 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.log(math.pow(math.exp(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_re <= 5.2e+142) 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 = log((exp(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) tmp = 0.0; if (y_46_re <= 5.2e+142) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); else tmp = log((exp(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_] := If[LessEqual[y$46$re, 5.2e+142], 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[N[Power[N[Exp[y$46$re], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 5.2 \cdot 10^{+142}:\\
\;\;\;\;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}:\\
\;\;\;\;\log \left({\left(e^{y.re}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\end{array}
\end{array}
if y.re < 5.20000000000000043e142Initial program 39.7%
Taylor expanded in y.im around 0 56.1%
Taylor expanded in y.re around 0 42.9%
*-commutative42.9%
distribute-lft-neg-in42.9%
Simplified42.9%
if 5.20000000000000043e142 < y.re Initial program 28.6%
Taylor expanded in y.im around 0 45.3%
Taylor expanded in y.re around 0 21.0%
*-commutative21.0%
distribute-lft-neg-in21.0%
Simplified21.0%
Taylor expanded in y.im around 0 3.4%
*-commutative3.4%
add-log-exp45.6%
*-commutative45.6%
exp-prod47.9%
Applied egg-rr47.9%
Final simplification43.7%
(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.65e-128)
(cbrt (pow t_0 3.0))
(if (<= y.im 1.05e+92) (log1p (expm1 t_0)) (+ (exp (log1p t_0)) -1.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.65e-128) {
tmp = cbrt(pow(t_0, 3.0));
} else if (y_46_im <= 1.05e+92) {
tmp = log1p(expm1(t_0));
} else {
tmp = exp(log1p(t_0)) + -1.0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -1.65e-128) {
tmp = Math.cbrt(Math.pow(t_0, 3.0));
} else if (y_46_im <= 1.05e+92) {
tmp = Math.log1p(Math.expm1(t_0));
} else {
tmp = Math.exp(Math.log1p(t_0)) + -1.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.65e-128) tmp = cbrt((t_0 ^ 3.0)); elseif (y_46_im <= 1.05e+92) tmp = log1p(expm1(t_0)); else tmp = Float64(exp(log1p(t_0)) + -1.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.65e-128], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[y$46$im, 1.05e+92], N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision], N[(N[Exp[N[Log[1 + t$95$0], $MachinePrecision]], $MachinePrecision] + -1.0), $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.65 \cdot 10^{-128}:\\
\;\;\;\;\sqrt[3]{{t\_0}^{3}}\\
\mathbf{elif}\;y.im \leq 1.05 \cdot 10^{+92}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{log1p}\left(t\_0\right)} + -1\\
\end{array}
\end{array}
if y.im < -1.65e-128Initial program 34.5%
Taylor expanded in y.im around 0 55.2%
Taylor expanded in y.re around 0 39.2%
*-commutative39.2%
distribute-lft-neg-in39.2%
Simplified39.2%
Taylor expanded in y.im around 0 5.2%
*-commutative5.2%
add-cbrt-cube29.8%
pow329.8%
Applied egg-rr29.8%
if -1.65e-128 < y.im < 1.04999999999999993e92Initial program 41.1%
Taylor expanded in y.im around 0 51.7%
Taylor expanded in y.re around 0 26.5%
*-commutative26.5%
distribute-lft-neg-in26.5%
Simplified26.5%
Taylor expanded in y.im around 0 21.8%
*-commutative21.8%
log1p-expm1-u31.1%
Applied egg-rr31.1%
if 1.04999999999999993e92 < y.im Initial program 35.9%
Taylor expanded in y.im around 0 58.8%
Taylor expanded in y.re around 0 68.1%
*-commutative68.1%
distribute-lft-neg-in68.1%
Simplified68.1%
Taylor expanded in y.im around 0 6.9%
*-commutative6.9%
expm1-log1p-u6.6%
expm1-undefine34.9%
Applied egg-rr34.9%
Final simplification31.5%
(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.65e-128) (not (<= y.im 20000000.0)))
(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 <= -1.65e-128) || !(y_46_im <= 20000000.0)) {
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 <= -1.65e-128) || !(y_46_im <= 20000000.0)) {
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 <= -1.65e-128) || !(y_46_im <= 20000000.0)) 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, -1.65e-128], N[Not[LessEqual[y$46$im, 20000000.0]], $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 -1.65 \cdot 10^{-128} \lor \neg \left(y.im \leq 20000000\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 < -1.65e-128 or 2e7 < y.im Initial program 34.8%
Taylor expanded in y.im around 0 56.1%
Taylor expanded in y.re around 0 47.0%
*-commutative47.0%
distribute-lft-neg-in47.0%
Simplified47.0%
Taylor expanded in y.im around 0 5.4%
*-commutative5.4%
add-cbrt-cube28.5%
pow328.5%
Applied egg-rr28.5%
if -1.65e-128 < y.im < 2e7Initial program 42.7%
Taylor expanded in y.im around 0 51.4%
Taylor expanded in y.re around 0 26.9%
*-commutative26.9%
distribute-lft-neg-in26.9%
Simplified26.9%
Taylor expanded in y.im around 0 25.9%
*-commutative25.9%
log1p-expm1-u34.4%
Applied egg-rr34.4%
Final simplification30.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 4e+144) (* 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_re <= 4e+144) {
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_re <= 4e+144) {
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_re <= 4e+144: 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_re <= 4e+144) 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[LessEqual[y$46$re, 4e+144], 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.re \leq 4 \cdot 10^{+144}:\\
\;\;\;\;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.re < 4.00000000000000009e144Initial program 39.7%
Taylor expanded in y.im around 0 56.1%
Taylor expanded in y.re around 0 42.9%
*-commutative42.9%
distribute-lft-neg-in42.9%
Simplified42.9%
if 4.00000000000000009e144 < y.re Initial program 28.6%
Taylor expanded in y.im around 0 45.3%
Taylor expanded in y.re around 0 21.0%
*-commutative21.0%
distribute-lft-neg-in21.0%
Simplified21.0%
Taylor expanded in y.im around 0 3.4%
*-commutative3.4%
log1p-expm1-u45.6%
Applied egg-rr45.6%
Final simplification43.4%
(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%
Taylor expanded in y.im around 0 54.3%
Taylor expanded in y.re around 0 39.3%
*-commutative39.3%
distribute-lft-neg-in39.3%
Simplified39.3%
Taylor expanded in y.im around 0 13.3%
*-commutative13.3%
log1p-expm1-u23.0%
Applied egg-rr23.0%
Final simplification23.0%
(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%
Taylor expanded in y.im around 0 54.3%
Taylor expanded in y.re around 0 39.3%
*-commutative39.3%
distribute-lft-neg-in39.3%
Simplified39.3%
Taylor expanded in y.im around 0 13.3%
Final simplification13.3%
herbie shell --seed 2024076
(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)))))