
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= y.re 2.5e+111)
(*
(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)))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (* y.im (log (hypot x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 2.5e+111) {
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, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 2.5e+111) 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, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 2.5e+111], 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], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 2.5 \cdot 10^{+111}:\\
\;\;\;\;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)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < 2.4999999999999998e111Initial program 43.9%
cancel-sign-sub-inv43.9%
fma-def43.9%
hypot-def43.9%
distribute-lft-neg-in43.9%
distribute-rgt-neg-out43.9%
fma-def43.9%
hypot-def87.8%
*-commutative87.8%
Simplified87.8%
if 2.4999999999999998e111 < y.re Initial program 34.1%
Taylor expanded in y.re around 0 46.3%
unpow246.3%
unpow246.3%
hypot-def75.7%
Simplified75.7%
Final simplification85.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))))
(if (<= y.re -225.0)
(* t_2 (sin t_1))
(if (<= y.re 9500.0)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_1))
(/ 1.0 (/ (exp t_0) (pow (hypot x.re x.im) y.re))))
(* t_2 (sin (* y.im (log (hypot x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double tmp;
if (y_46_re <= -225.0) {
tmp = t_2 * sin(t_1);
} else if (y_46_re <= 9500.0) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * (1.0 / (exp(t_0) / pow(hypot(x_46_re, x_46_im), y_46_re)));
} else {
tmp = t_2 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) tmp = 0.0 if (y_46_re <= -225.0) tmp = Float64(t_2 * sin(t_1)); elseif (y_46_re <= 9500.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * Float64(1.0 / Float64(exp(t_0) / (hypot(x_46_re, x_46_im) ^ y_46_re)))); else tmp = Float64(t_2 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -225.0], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9500.0], 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[(1.0 / N[(N[Exp[t$95$0], $MachinePrecision] / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\
\mathbf{if}\;y.re \leq -225:\\
\;\;\;\;t_2 \cdot \sin t_1\\
\mathbf{elif}\;y.re \leq 9500:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_1\right)\right) \cdot \frac{1}{\frac{e^{t_0}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -225Initial program 47.3%
Taylor expanded in y.im around 0 86.6%
if -225 < y.re < 9500Initial program 40.9%
exp-diff40.9%
exp-to-pow40.9%
hypot-def40.9%
*-commutative40.9%
exp-prod40.4%
fma-def40.4%
hypot-def87.2%
*-commutative87.2%
Simplified87.2%
clear-num87.3%
inv-pow87.3%
Applied egg-rr87.3%
unpow-187.3%
exp-prod87.9%
Simplified87.9%
if 9500 < y.re Initial program 39.4%
Taylor expanded in y.re around 0 43.9%
unpow243.9%
unpow243.9%
hypot-def65.3%
Simplified65.3%
Final simplification81.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))
(t_3 (log (hypot x.re x.im))))
(if (<= y.re -2.15e-7)
(* t_2 (sin t_1))
(if (<= y.re 410000000000.0)
(* (sin (fma t_3 y.im t_1)) (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 4.8e+100)
(* t_2 (sin (fabs t_1)))
(*
(sin (* y.im (log (hypot x.im x.re))))
(exp (+ t_0 (* y.re t_3)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double t_3 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -2.15e-7) {
tmp = t_2 * sin(t_1);
} else if (y_46_re <= 410000000000.0) {
tmp = sin(fma(t_3, y_46_im, t_1)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 4.8e+100) {
tmp = t_2 * sin(fabs(t_1));
} else {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((t_0 + (y_46_re * t_3)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) t_3 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -2.15e-7) tmp = Float64(t_2 * sin(t_1)); elseif (y_46_re <= 410000000000.0) tmp = Float64(sin(fma(t_3, y_46_im, t_1)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 4.8e+100) tmp = Float64(t_2 * sin(abs(t_1))); else tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(t_0 + Float64(y_46_re * t_3)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.15e-7], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 410000000000.0], N[(N[Sin[N[(t$95$3 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.8e+100], N[(t$95$2 * N[Sin[N[Abs[t$95$1], $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[(t$95$0 + N[(y$46$re * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -2.15 \cdot 10^{-7}:\\
\;\;\;\;t_2 \cdot \sin t_1\\
\mathbf{elif}\;y.re \leq 410000000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_3, y.im, t_1\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 4.8 \cdot 10^{+100}:\\
\;\;\;\;t_2 \cdot \sin \left(\left|t_1\right|\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{t_0 + y.re \cdot t_3}\\
\end{array}
\end{array}
if y.re < -2.1500000000000001e-7Initial program 46.7%
Taylor expanded in y.im around 0 86.8%
if -2.1500000000000001e-7 < y.re < 4.1e11Initial program 40.5%
exp-diff40.5%
exp-to-pow40.5%
hypot-def40.5%
*-commutative40.5%
exp-prod40.1%
fma-def40.1%
hypot-def85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y.re around 0 85.4%
rec-exp85.4%
distribute-rgt-neg-in85.4%
Simplified85.4%
if 4.1e11 < y.re < 4.80000000000000023e100Initial program 50.0%
Taylor expanded in y.im around 0 65.2%
add-sqr-sqrt35.2%
sqrt-unprod55.2%
pow255.2%
Applied egg-rr70.2%
unpow255.2%
rem-sqrt-square60.2%
Simplified75.2%
if 4.80000000000000023e100 < y.re Initial program 36.4%
cancel-sign-sub-inv36.4%
fma-def36.4%
hypot-def36.4%
distribute-lft-neg-in36.4%
distribute-rgt-neg-out36.4%
fma-def36.4%
hypot-def65.9%
*-commutative65.9%
Simplified65.9%
fma-udef65.9%
*-commutative65.9%
*-commutative65.9%
add-sqr-sqrt45.5%
sqrt-unprod57.0%
sqr-neg57.0%
sqrt-unprod16.0%
add-sqr-sqrt50.2%
Applied egg-rr50.2%
Taylor expanded in y.re around 0 38.7%
unpow238.7%
unpow238.7%
hypot-def66.2%
Simplified66.2%
Final simplification81.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -1.35e-5)
(* t_1 (sin t_0))
(if (<= y.re 170000000000.0)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_1 (sin (* y.im (log (hypot x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -1.35e-5) {
tmp = t_1 * sin(t_0);
} else if (y_46_re <= 170000000000.0) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_1 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -1.35e-5) tmp = Float64(t_1 * sin(t_0)); elseif (y_46_re <= 170000000000.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_1 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.35e-5], N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 170000000000.0], 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -1.35 \cdot 10^{-5}:\\
\;\;\;\;t_1 \cdot \sin t_0\\
\mathbf{elif}\;y.re \leq 170000000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -1.3499999999999999e-5Initial program 46.7%
Taylor expanded in y.im around 0 86.8%
if -1.3499999999999999e-5 < y.re < 1.7e11Initial program 40.5%
exp-diff40.5%
exp-to-pow40.5%
hypot-def40.5%
*-commutative40.5%
exp-prod40.1%
fma-def40.1%
hypot-def85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y.re around 0 85.4%
rec-exp85.4%
distribute-rgt-neg-in85.4%
Simplified85.4%
if 1.7e11 < y.re Initial program 40.6%
Taylor expanded in y.re around 0 45.3%
unpow245.3%
unpow245.3%
hypot-def67.3%
Simplified67.3%
Final simplification81.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(sin t_1)))
(t_3 (log (hypot x.re x.im))))
(if (<= y.re -0.0037)
t_2
(if (<= y.re 170000000000.0)
(* (sin (fma t_3 y.im t_1)) (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 3.5e+109)
t_2
(*
(sin (* y.im (log (hypot x.im x.re))))
(exp (+ t_0 (* y.re t_3)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin(t_1);
double t_3 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -0.0037) {
tmp = t_2;
} else if (y_46_re <= 170000000000.0) {
tmp = sin(fma(t_3, y_46_im, t_1)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 3.5e+109) {
tmp = t_2;
} else {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((t_0 + (y_46_re * t_3)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * sin(t_1)) t_3 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -0.0037) tmp = t_2; elseif (y_46_re <= 170000000000.0) tmp = Float64(sin(fma(t_3, y_46_im, t_1)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 3.5e+109) tmp = t_2; else tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(t_0 + Float64(y_46_re * t_3)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.0037], t$95$2, If[LessEqual[y$46$re, 170000000000.0], N[(N[Sin[N[(t$95$3 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.5e+109], t$95$2, 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[(t$95$0 + N[(y$46$re * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot \sin t_1\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -0.0037:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq 170000000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_3, y.im, t_1\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 3.5 \cdot 10^{+109}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{t_0 + y.re \cdot t_3}\\
\end{array}
\end{array}
if y.re < -0.0037000000000000002 or 1.7e11 < y.re < 3.49999999999999983e109Initial program 47.9%
Taylor expanded in y.im around 0 82.5%
if -0.0037000000000000002 < y.re < 1.7e11Initial program 40.5%
exp-diff40.5%
exp-to-pow40.5%
hypot-def40.5%
*-commutative40.5%
exp-prod40.1%
fma-def40.1%
hypot-def85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y.re around 0 85.4%
rec-exp85.4%
distribute-rgt-neg-in85.4%
Simplified85.4%
if 3.49999999999999983e109 < y.re Initial program 34.9%
cancel-sign-sub-inv34.9%
fma-def34.9%
hypot-def34.9%
distribute-lft-neg-in34.9%
distribute-rgt-neg-out34.9%
fma-def34.9%
hypot-def65.1%
*-commutative65.1%
Simplified65.1%
fma-udef65.1%
*-commutative65.1%
*-commutative65.1%
add-sqr-sqrt44.2%
sqrt-unprod56.0%
sqr-neg56.0%
sqrt-unprod16.4%
add-sqr-sqrt49.1%
Applied egg-rr49.1%
Taylor expanded in y.re around 0 39.6%
unpow239.6%
unpow239.6%
hypot-def67.7%
Simplified67.7%
Final simplification81.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* (sin t_0) (pow (exp y.im) (- (atan2 x.im x.re))))))
(if (<= y.im -4e+184)
t_1
(if (<= y.im -2.35e+101)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(fabs t_0))
(if (<= y.im -2e+30)
t_1
(if (<= y.im 4e+23)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(pow (hypot x.im x.re) y.re))
(*
y.re
(* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -4e+184) {
tmp = t_1;
} else if (y_46_im <= -2.35e+101) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * fabs(t_0);
} else if (y_46_im <= -2e+30) {
tmp = t_1;
} else if (y_46_im <= 4e+23) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
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(sin(t_0) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -4e+184) tmp = t_1; elseif (y_46_im <= -2.35e+101) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * abs(t_0)); elseif (y_46_im <= -2e+30) tmp = t_1; elseif (y_46_im <= 4e+23) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); end return tmp end
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[Sin[t$95$0], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -4e+184], t$95$1, If[LessEqual[y$46$im, -2.35e+101], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -2e+30], t$95$1, If[LessEqual[y$46$im, 4e+23], 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t_0 \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;y.im \leq -4 \cdot 10^{+184}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -2.35 \cdot 10^{+101}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left|t_0\right|\\
\mathbf{elif}\;y.im \leq -2 \cdot 10^{+30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 4 \cdot 10^{+23}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.im < -4.00000000000000007e184 or -2.34999999999999985e101 < y.im < -2e30Initial program 41.2%
exp-diff23.5%
exp-to-pow23.5%
hypot-def23.5%
*-commutative23.5%
exp-prod23.5%
fma-def23.5%
hypot-def53.0%
*-commutative53.0%
Simplified53.0%
Taylor expanded in y.re around 0 73.8%
rec-exp73.8%
distribute-rgt-neg-in73.8%
exp-prod73.8%
Simplified73.8%
Taylor expanded in y.im around 0 82.5%
if -4.00000000000000007e184 < y.im < -2.34999999999999985e101Initial program 41.7%
Taylor expanded in y.im around 0 58.6%
Taylor expanded in y.re around 0 50.3%
add-sqr-sqrt25.3%
sqrt-unprod58.6%
pow258.6%
Applied egg-rr58.6%
unpow258.6%
rem-sqrt-square83.6%
Simplified83.6%
if -2e30 < y.im < 3.9999999999999997e23Initial program 43.7%
exp-diff42.3%
exp-to-pow42.3%
hypot-def42.3%
*-commutative42.3%
exp-prod42.0%
fma-def42.0%
hypot-def84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in y.im around 0 63.2%
unpow263.2%
unpow263.2%
hypot-def87.3%
Simplified87.3%
if 3.9999999999999997e23 < y.im Initial program 40.3%
Taylor expanded in y.im around 0 52.0%
Taylor expanded in y.re around 0 67.6%
*-commutative67.6%
distribute-lft-neg-in67.6%
Simplified67.6%
Final simplification81.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(sin t_1)))
(t_3 (log (hypot x.re x.im))))
(if (<= y.re -0.0017)
t_2
(if (<= y.re 170000000000.0)
(* (sin (fma t_3 y.im t_1)) (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 2.15e+108)
t_2
(* (* y.im (log (hypot x.im x.re))) (exp (+ t_0 (* y.re t_3)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin(t_1);
double t_3 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -0.0017) {
tmp = t_2;
} else if (y_46_re <= 170000000000.0) {
tmp = sin(fma(t_3, y_46_im, t_1)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 2.15e+108) {
tmp = t_2;
} else {
tmp = (y_46_im * log(hypot(x_46_im, x_46_re))) * exp((t_0 + (y_46_re * t_3)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * sin(t_1)) t_3 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -0.0017) tmp = t_2; elseif (y_46_re <= 170000000000.0) tmp = Float64(sin(fma(t_3, y_46_im, t_1)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 2.15e+108) tmp = t_2; else tmp = Float64(Float64(y_46_im * log(hypot(x_46_im, x_46_re))) * exp(Float64(t_0 + Float64(y_46_re * t_3)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.0017], t$95$2, If[LessEqual[y$46$re, 170000000000.0], N[(N[Sin[N[(t$95$3 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.15e+108], t$95$2, N[(N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(t$95$0 + N[(y$46$re * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot \sin t_1\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -0.0017:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq 170000000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_3, y.im, t_1\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 2.15 \cdot 10^{+108}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{t_0 + y.re \cdot t_3}\\
\end{array}
\end{array}
if y.re < -0.00169999999999999991 or 1.7e11 < y.re < 2.14999999999999998e108Initial program 47.9%
Taylor expanded in y.im around 0 82.5%
if -0.00169999999999999991 < y.re < 1.7e11Initial program 40.5%
exp-diff40.5%
exp-to-pow40.5%
hypot-def40.5%
*-commutative40.5%
exp-prod40.1%
fma-def40.1%
hypot-def85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y.re around 0 85.4%
rec-exp85.4%
distribute-rgt-neg-in85.4%
Simplified85.4%
if 2.14999999999999998e108 < y.re Initial program 34.9%
cancel-sign-sub-inv34.9%
fma-def34.9%
hypot-def34.9%
distribute-lft-neg-in34.9%
distribute-rgt-neg-out34.9%
fma-def34.9%
hypot-def65.1%
*-commutative65.1%
Simplified65.1%
fma-udef65.1%
*-commutative65.1%
*-commutative65.1%
add-sqr-sqrt44.2%
sqrt-unprod56.0%
sqr-neg56.0%
sqrt-unprod16.4%
add-sqr-sqrt49.1%
Applied egg-rr49.1%
Taylor expanded in y.re around 0 39.6%
unpow239.6%
unpow239.6%
hypot-def67.7%
Simplified67.7%
Taylor expanded in y.im around 0 58.4%
unpow258.4%
unpow258.4%
hypot-def58.4%
Simplified58.4%
Final simplification79.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin t_0))
(t_2 (* (atan2 x.im x.re) y.im))
(t_3
(*
(* y.im (log (hypot x.im x.re)))
(exp (+ t_2 (* y.re (log (hypot x.re x.im)))))))
(t_4 (pow (exp y.im) (- (atan2 x.im x.re))))
(t_5 (* t_1 t_4)))
(if (<= y.im -6e+183)
t_5
(if (<= y.im -4.2e+99)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2))
(fabs t_0))
(if (<= y.im -9e+29)
t_5
(if (<= y.im -4.3e-122)
t_3
(if (<= y.im 9e-226)
(* t_1 (pow (hypot x.im x.re) y.re))
(if (<= y.im 800000000.0)
t_3
(* (atan2 x.im x.re) (* y.re 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 = sin(t_0);
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = (y_46_im * log(hypot(x_46_im, x_46_re))) * exp((t_2 + (y_46_re * log(hypot(x_46_re, x_46_im)))));
double t_4 = pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
double t_5 = t_1 * t_4;
double tmp;
if (y_46_im <= -6e+183) {
tmp = t_5;
} else if (y_46_im <= -4.2e+99) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)) * fabs(t_0);
} else if (y_46_im <= -9e+29) {
tmp = t_5;
} else if (y_46_im <= -4.3e-122) {
tmp = t_3;
} else if (y_46_im <= 9e-226) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 800000000.0) {
tmp = t_3;
} else {
tmp = atan2(x_46_im, x_46_re) * (y_46_re * 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.sin(t_0);
double t_2 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = (y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))) * Math.exp((t_2 + (y_46_re * Math.log(Math.hypot(x_46_re, x_46_im)))));
double t_4 = Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
double t_5 = t_1 * t_4;
double tmp;
if (y_46_im <= -6e+183) {
tmp = t_5;
} else if (y_46_im <= -4.2e+99) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)) * Math.abs(t_0);
} else if (y_46_im <= -9e+29) {
tmp = t_5;
} else if (y_46_im <= -4.3e-122) {
tmp = t_3;
} else if (y_46_im <= 9e-226) {
tmp = t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 800000000.0) {
tmp = t_3;
} else {
tmp = Math.atan2(x_46_im, x_46_re) * (y_46_re * 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.sin(t_0) t_2 = math.atan2(x_46_im, x_46_re) * y_46_im t_3 = (y_46_im * math.log(math.hypot(x_46_im, x_46_re))) * math.exp((t_2 + (y_46_re * math.log(math.hypot(x_46_re, x_46_im))))) t_4 = math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) t_5 = t_1 * t_4 tmp = 0 if y_46_im <= -6e+183: tmp = t_5 elif y_46_im <= -4.2e+99: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)) * math.fabs(t_0) elif y_46_im <= -9e+29: tmp = t_5 elif y_46_im <= -4.3e-122: tmp = t_3 elif y_46_im <= 9e-226: tmp = t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_im <= 800000000.0: tmp = t_3 else: tmp = math.atan2(x_46_im, x_46_re) * (y_46_re * 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 = sin(t_0) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = Float64(Float64(y_46_im * log(hypot(x_46_im, x_46_re))) * exp(Float64(t_2 + Float64(y_46_re * log(hypot(x_46_re, x_46_im)))))) t_4 = exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)) t_5 = Float64(t_1 * t_4) tmp = 0.0 if (y_46_im <= -6e+183) tmp = t_5; elseif (y_46_im <= -4.2e+99) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_2)) * abs(t_0)); elseif (y_46_im <= -9e+29) tmp = t_5; elseif (y_46_im <= -4.3e-122) tmp = t_3; elseif (y_46_im <= 9e-226) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 800000000.0) tmp = t_3; else tmp = Float64(atan(x_46_im, x_46_re) * Float64(y_46_re * 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 = sin(t_0); t_2 = atan2(x_46_im, x_46_re) * y_46_im; t_3 = (y_46_im * log(hypot(x_46_im, x_46_re))) * exp((t_2 + (y_46_re * log(hypot(x_46_re, x_46_im))))); t_4 = exp(y_46_im) ^ -atan2(x_46_im, x_46_re); t_5 = t_1 * t_4; tmp = 0.0; if (y_46_im <= -6e+183) tmp = t_5; elseif (y_46_im <= -4.2e+99) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)) * abs(t_0); elseif (y_46_im <= -9e+29) tmp = t_5; elseif (y_46_im <= -4.3e-122) tmp = t_3; elseif (y_46_im <= 9e-226) tmp = t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_im <= 800000000.0) tmp = t_3; else tmp = atan2(x_46_im, x_46_re) * (y_46_re * 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[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(t$95$2 + N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 * t$95$4), $MachinePrecision]}, If[LessEqual[y$46$im, -6e+183], t$95$5, If[LessEqual[y$46$im, -4.2e+99], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Abs[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -9e+29], t$95$5, If[LessEqual[y$46$im, -4.3e-122], t$95$3, If[LessEqual[y$46$im, 9e-226], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 800000000.0], t$95$3, N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(y$46$re * t$95$4), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t_0\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{t_2 + y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\\
t_4 := {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_5 := t_1 \cdot t_4\\
\mathbf{if}\;y.im \leq -6 \cdot 10^{+183}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;y.im \leq -4.2 \cdot 10^{+99}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_2} \cdot \left|t_0\right|\\
\mathbf{elif}\;y.im \leq -9 \cdot 10^{+29}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;y.im \leq -4.3 \cdot 10^{-122}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.im \leq 9 \cdot 10^{-226}:\\
\;\;\;\;t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 800000000:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(y.re \cdot t_4\right)\\
\end{array}
\end{array}
if y.im < -5.99999999999999992e183 or -4.2000000000000002e99 < y.im < -9.0000000000000005e29Initial program 41.2%
exp-diff23.5%
exp-to-pow23.5%
hypot-def23.5%
*-commutative23.5%
exp-prod23.5%
fma-def23.5%
hypot-def53.0%
*-commutative53.0%
Simplified53.0%
Taylor expanded in y.re around 0 73.8%
rec-exp73.8%
distribute-rgt-neg-in73.8%
exp-prod73.8%
Simplified73.8%
Taylor expanded in y.im around 0 82.5%
if -5.99999999999999992e183 < y.im < -4.2000000000000002e99Initial program 41.7%
Taylor expanded in y.im around 0 58.6%
Taylor expanded in y.re around 0 50.3%
add-sqr-sqrt25.3%
sqrt-unprod58.6%
pow258.6%
Applied egg-rr58.6%
unpow258.6%
rem-sqrt-square83.6%
Simplified83.6%
if -9.0000000000000005e29 < y.im < -4.30000000000000019e-122 or 9.00000000000000023e-226 < y.im < 8e8Initial program 40.2%
cancel-sign-sub-inv40.2%
fma-def40.2%
hypot-def40.2%
distribute-lft-neg-in40.2%
distribute-rgt-neg-out40.2%
fma-def40.2%
hypot-def88.0%
*-commutative88.0%
Simplified88.0%
fma-udef88.0%
*-commutative88.0%
*-commutative88.0%
add-sqr-sqrt33.4%
sqrt-unprod88.0%
sqr-neg88.0%
sqrt-unprod54.6%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
Taylor expanded in y.re around 0 39.0%
unpow239.0%
unpow239.0%
hypot-def81.8%
Simplified81.8%
Taylor expanded in y.im around 0 46.0%
unpow246.0%
unpow246.0%
hypot-def81.3%
Simplified81.3%
if -4.30000000000000019e-122 < y.im < 9.00000000000000023e-226Initial program 48.1%
Taylor expanded in y.im around 0 66.1%
Taylor expanded in y.im around 0 66.1%
unpow266.1%
unpow266.1%
hypot-def84.6%
Simplified84.6%
if 8e8 < y.im Initial program 40.7%
Taylor expanded in y.im around 0 53.7%
Taylor expanded in y.re around 0 65.1%
associate-*r*65.1%
distribute-rgt-neg-in65.1%
exp-prod66.3%
Simplified66.3%
Final simplification77.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(* y.im (log (hypot x.im x.re)))
(exp
(+ (* (atan2 x.im x.re) y.im) (* y.re (log (hypot x.re x.im)))))))
(t_1 (sin (* y.re (atan2 x.im x.re))))
(t_2 (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im -4.2e+31)
(* t_1 t_2)
(if (<= y.im -4.3e-122)
t_0
(if (<= y.im 2.4e-226)
(* t_1 (pow (hypot x.im x.re) y.re))
(if (<= y.im 760000000.0) t_0 (* (atan2 x.im x.re) (* y.re t_2))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_im * log(hypot(x_46_im, x_46_re))) * exp(((atan2(x_46_im, x_46_re) * y_46_im) + (y_46_re * log(hypot(x_46_re, x_46_im)))));
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -4.2e+31) {
tmp = t_1 * t_2;
} else if (y_46_im <= -4.3e-122) {
tmp = t_0;
} else if (y_46_im <= 2.4e-226) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 760000000.0) {
tmp = t_0;
} else {
tmp = atan2(x_46_im, x_46_re) * (y_46_re * t_2);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))) * Math.exp(((Math.atan2(x_46_im, x_46_re) * y_46_im) + (y_46_re * Math.log(Math.hypot(x_46_re, x_46_im)))));
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -4.2e+31) {
tmp = t_1 * t_2;
} else if (y_46_im <= -4.3e-122) {
tmp = t_0;
} else if (y_46_im <= 2.4e-226) {
tmp = t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 760000000.0) {
tmp = t_0;
} else {
tmp = Math.atan2(x_46_im, x_46_re) * (y_46_re * t_2);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (y_46_im * math.log(math.hypot(x_46_im, x_46_re))) * math.exp(((math.atan2(x_46_im, x_46_re) * y_46_im) + (y_46_re * math.log(math.hypot(x_46_re, x_46_im))))) t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_2 = math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) tmp = 0 if y_46_im <= -4.2e+31: tmp = t_1 * t_2 elif y_46_im <= -4.3e-122: tmp = t_0 elif y_46_im <= 2.4e-226: tmp = t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_im <= 760000000.0: tmp = t_0 else: tmp = math.atan2(x_46_im, x_46_re) * (y_46_re * t_2) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_im * log(hypot(x_46_im, x_46_re))) * exp(Float64(Float64(atan(x_46_im, x_46_re) * y_46_im) + Float64(y_46_re * log(hypot(x_46_re, x_46_im)))))) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -4.2e+31) tmp = Float64(t_1 * t_2); elseif (y_46_im <= -4.3e-122) tmp = t_0; elseif (y_46_im <= 2.4e-226) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 760000000.0) tmp = t_0; else tmp = Float64(atan(x_46_im, x_46_re) * Float64(y_46_re * t_2)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (y_46_im * log(hypot(x_46_im, x_46_re))) * exp(((atan2(x_46_im, x_46_re) * y_46_im) + (y_46_re * log(hypot(x_46_re, x_46_im))))); t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); t_2 = exp(y_46_im) ^ -atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_im <= -4.2e+31) tmp = t_1 * t_2; elseif (y_46_im <= -4.3e-122) tmp = t_0; elseif (y_46_im <= 2.4e-226) tmp = t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_im <= 760000000.0) tmp = t_0; else tmp = atan2(x_46_im, x_46_re) * (y_46_re * t_2); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision] + N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]}, If[LessEqual[y$46$im, -4.2e+31], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, -4.3e-122], t$95$0, If[LessEqual[y$46$im, 2.4e-226], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 760000000.0], t$95$0, N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(y$46$re * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;y.im \leq -4.2 \cdot 10^{+31}:\\
\;\;\;\;t_1 \cdot t_2\\
\mathbf{elif}\;y.im \leq -4.3 \cdot 10^{-122}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 2.4 \cdot 10^{-226}:\\
\;\;\;\;t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 760000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(y.re \cdot t_2\right)\\
\end{array}
\end{array}
if y.im < -4.19999999999999958e31Initial program 41.3%
exp-diff23.9%
exp-to-pow23.9%
hypot-def23.9%
*-commutative23.9%
exp-prod23.9%
fma-def23.9%
hypot-def52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in y.re around 0 66.0%
rec-exp66.0%
distribute-rgt-neg-in66.0%
exp-prod66.0%
Simplified66.0%
Taylor expanded in y.im around 0 69.9%
if -4.19999999999999958e31 < y.im < -4.30000000000000019e-122 or 2.4e-226 < y.im < 7.6e8Initial program 40.2%
cancel-sign-sub-inv40.2%
fma-def40.2%
hypot-def40.2%
distribute-lft-neg-in40.2%
distribute-rgt-neg-out40.2%
fma-def40.2%
hypot-def88.0%
*-commutative88.0%
Simplified88.0%
fma-udef88.0%
*-commutative88.0%
*-commutative88.0%
add-sqr-sqrt33.4%
sqrt-unprod88.0%
sqr-neg88.0%
sqrt-unprod54.6%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
Taylor expanded in y.re around 0 39.0%
unpow239.0%
unpow239.0%
hypot-def81.8%
Simplified81.8%
Taylor expanded in y.im around 0 46.0%
unpow246.0%
unpow246.0%
hypot-def81.3%
Simplified81.3%
if -4.30000000000000019e-122 < y.im < 2.4e-226Initial program 48.1%
Taylor expanded in y.im around 0 66.1%
Taylor expanded in y.im around 0 66.1%
unpow266.1%
unpow266.1%
hypot-def84.6%
Simplified84.6%
if 7.6e8 < y.im Initial program 40.7%
Taylor expanded in y.im around 0 53.7%
Taylor expanded in y.re around 0 65.1%
associate-*r*65.1%
distribute-rgt-neg-in65.1%
exp-prod66.3%
Simplified66.3%
Final simplification75.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (sin t_0)))
(if (<= y.im -1.6e+35)
(* t_1 (pow (exp y.im) (- (atan2 x.im x.re))))
(if (<= y.im 6.2e-148)
(* t_1 (pow (hypot x.im x.re) y.re))
(if (<= y.im 9.5e-52)
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(if (<= y.im 3.5e+77)
(*
t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(*
y.re
(* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double tmp;
if (y_46_im <= -1.6e+35) {
tmp = t_1 * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else if (y_46_im <= 6.2e-148) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 9.5e-52) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0));
} else if (y_46_im <= 3.5e+77) {
tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
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(t_0) tmp = 0.0 if (y_46_im <= -1.6e+35) tmp = Float64(t_1 * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); elseif (y_46_im <= 6.2e-148) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 9.5e-52) tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)); elseif (y_46_im <= 3.5e+77) tmp = Float64(t_0 * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$im, -1.6e+35], N[(t$95$1 * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 6.2e-148], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9.5e-52], 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], If[LessEqual[y$46$im, 3.5e+77], N[(t$95$0 * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t_0\\
\mathbf{if}\;y.im \leq -1.6 \cdot 10^{+35}:\\
\;\;\;\;t_1 \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.im \leq 6.2 \cdot 10^{-148}:\\
\;\;\;\;t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 9.5 \cdot 10^{-52}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right)\\
\mathbf{elif}\;y.im \leq 3.5 \cdot 10^{+77}:\\
\;\;\;\;t_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.im < -1.59999999999999991e35Initial program 41.3%
exp-diff23.9%
exp-to-pow23.9%
hypot-def23.9%
*-commutative23.9%
exp-prod23.9%
fma-def23.9%
hypot-def52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in y.re around 0 66.0%
rec-exp66.0%
distribute-rgt-neg-in66.0%
exp-prod66.0%
Simplified66.0%
Taylor expanded in y.im around 0 69.9%
if -1.59999999999999991e35 < y.im < 6.2000000000000003e-148Initial program 48.8%
Taylor expanded in y.im around 0 58.5%
Taylor expanded in y.im around 0 58.5%
unpow258.5%
unpow258.5%
hypot-def74.5%
Simplified74.5%
if 6.2000000000000003e-148 < y.im < 9.50000000000000007e-52Initial program 34.8%
exp-diff34.8%
exp-to-pow34.8%
hypot-def34.8%
*-commutative34.8%
exp-prod34.8%
fma-def34.8%
hypot-def94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in y.re around 0 80.2%
rec-exp80.2%
distribute-rgt-neg-in80.2%
exp-prod80.2%
Simplified80.2%
Taylor expanded in y.im around 0 80.2%
if 9.50000000000000007e-52 < y.im < 3.5000000000000001e77Initial program 30.9%
Taylor expanded in y.im around 0 60.9%
Taylor expanded in y.re around 0 63.9%
if 3.5000000000000001e77 < y.im Initial program 41.1%
Taylor expanded in y.im around 0 50.6%
Taylor expanded in y.re around 0 70.1%
*-commutative70.1%
distribute-lft-neg-in70.1%
Simplified70.1%
Final simplification71.8%
(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)))
(t_2 (* (sin t_1) (pow (hypot x.im x.re) y.re))))
(if (<= y.re -4.4e-10)
t_2
(if (<= y.re -1.8e-129)
t_0
(if (<= y.re 4e-265)
(sin (fma (log (hypot x.re x.im)) y.im t_1))
(if (<= y.re 410000000000.0) t_0 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * (atan2(x_46_im, x_46_re) * 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 t_2 = sin(t_1) * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -4.4e-10) {
tmp = t_2;
} else if (y_46_re <= -1.8e-129) {
tmp = t_0;
} else if (y_46_re <= 4e-265) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1));
} else if (y_46_re <= 410000000000.0) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * 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)) t_2 = Float64(sin(t_1) * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -4.4e-10) tmp = t_2; elseif (y_46_re <= -1.8e-129) tmp = t_0; elseif (y_46_re <= 4e-265) tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)); elseif (y_46_re <= 410000000000.0) tmp = t_0; else tmp = t_2; 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]}, Block[{t$95$2 = N[(N[Sin[t$95$1], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -4.4e-10], t$95$2, If[LessEqual[y$46$re, -1.8e-129], t$95$0, If[LessEqual[y$46$re, 4e-265], 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], If[LessEqual[y$46$re, 410000000000.0], t$95$0, t$95$2]]]]]]]
\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}\\
t_2 := \sin t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -4.4 \cdot 10^{-10}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq -1.8 \cdot 10^{-129}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{-265}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_1\right)\right)\\
\mathbf{elif}\;y.re \leq 410000000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y.re < -4.3999999999999998e-10 or 4.1e11 < y.re Initial program 43.3%
Taylor expanded in y.im around 0 71.1%
Taylor expanded in y.im around 0 65.5%
unpow265.5%
unpow265.5%
hypot-def66.9%
Simplified66.9%
if -4.3999999999999998e-10 < y.re < -1.8e-129 or 3.99999999999999994e-265 < y.re < 4.1e11Initial program 41.9%
Taylor expanded in y.im around 0 41.5%
Taylor expanded in y.re around 0 70.2%
*-commutative70.2%
distribute-lft-neg-in70.2%
Simplified70.2%
if -1.8e-129 < y.re < 3.99999999999999994e-265Initial program 39.8%
exp-diff39.8%
exp-to-pow39.8%
hypot-def39.8%
*-commutative39.8%
exp-prod39.4%
fma-def39.4%
hypot-def84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in y.re around 0 85.0%
rec-exp85.0%
distribute-rgt-neg-in85.0%
exp-prod84.1%
Simplified84.1%
Taylor expanded in y.im around 0 74.9%
Final simplification69.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin t_0))
(t_2 (* t_1 (pow (hypot x.im x.re) y.re))))
(if (<= y.im -1.7e+32)
(* t_1 (pow (exp y.im) (- (atan2 x.im x.re))))
(if (<= y.im 2e-148)
t_2
(if (<= y.im 6.8e-53)
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(if (<= y.im 7.5e+26)
t_2
(*
y.re
(* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double t_2 = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -1.7e+32) {
tmp = t_1 * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else if (y_46_im <= 2e-148) {
tmp = t_2;
} else if (y_46_im <= 6.8e-53) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0));
} else if (y_46_im <= 7.5e+26) {
tmp = t_2;
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
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(t_0) t_2 = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_im <= -1.7e+32) tmp = Float64(t_1 * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); elseif (y_46_im <= 2e-148) tmp = t_2; elseif (y_46_im <= 6.8e-53) tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)); elseif (y_46_im <= 7.5e+26) tmp = t_2; else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.7e+32], N[(t$95$1 * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2e-148], t$95$2, If[LessEqual[y$46$im, 6.8e-53], 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], If[LessEqual[y$46$im, 7.5e+26], t$95$2, N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t_0\\
t_2 := t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -1.7 \cdot 10^{+32}:\\
\;\;\;\;t_1 \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{-148}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq 6.8 \cdot 10^{-53}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right)\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+26}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.im < -1.69999999999999989e32Initial program 41.3%
exp-diff23.9%
exp-to-pow23.9%
hypot-def23.9%
*-commutative23.9%
exp-prod23.9%
fma-def23.9%
hypot-def52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in y.re around 0 66.0%
rec-exp66.0%
distribute-rgt-neg-in66.0%
exp-prod66.0%
Simplified66.0%
Taylor expanded in y.im around 0 69.9%
if -1.69999999999999989e32 < y.im < 1.99999999999999987e-148 or 6.8e-53 < y.im < 7.49999999999999941e26Initial program 45.2%
Taylor expanded in y.im around 0 59.3%
Taylor expanded in y.im around 0 58.5%
unpow258.5%
unpow258.5%
hypot-def72.0%
Simplified72.0%
if 1.99999999999999987e-148 < y.im < 6.8e-53Initial program 34.8%
exp-diff34.8%
exp-to-pow34.8%
hypot-def34.8%
*-commutative34.8%
exp-prod34.8%
fma-def34.8%
hypot-def94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in y.re around 0 80.2%
rec-exp80.2%
distribute-rgt-neg-in80.2%
exp-prod80.2%
Simplified80.2%
Taylor expanded in y.im around 0 80.2%
if 7.49999999999999941e26 < y.im Initial program 40.3%
Taylor expanded in y.im around 0 52.0%
Taylor expanded in y.re around 0 67.6%
*-commutative67.6%
distribute-lft-neg-in67.6%
Simplified67.6%
Final simplification71.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.2e+131) (not (<= y.im 1.8e+27))) (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im))))) (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.2e+131) || !(y_46_im <= 1.8e+27)) {
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_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.2e+131) || !(y_46_im <= 1.8e+27)) {
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_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.2e+131) or not (y_46_im <= 1.8e+27): 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_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.2e+131) || !(y_46_im <= 1.8e+27)) 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_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.2e+131) || ~((y_46_im <= 1.8e+27))) 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_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.2e+131], N[Not[LessEqual[y$46$im, 1.8e+27]], $MachinePrecision]], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.2 \cdot 10^{+131} \lor \neg \left(y.im \leq 1.8 \cdot 10^{+27}\right):\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -1.2e131 or 1.79999999999999991e27 < y.im Initial program 39.2%
Taylor expanded in y.im around 0 53.6%
Taylor expanded in y.re around 0 65.5%
*-commutative65.5%
distribute-lft-neg-in65.5%
Simplified65.5%
if -1.2e131 < y.im < 1.79999999999999991e27Initial program 44.4%
Taylor expanded in y.im around 0 56.2%
Taylor expanded in y.im around 0 53.7%
unpow253.7%
unpow253.7%
hypot-def64.2%
Simplified64.2%
Final simplification64.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = y_46re * (atan2(x_46im, x_46re) * exp((atan2(x_46im, x_46re) * -y_46im)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)
\end{array}
Initial program 42.3%
Taylor expanded in y.im around 0 55.1%
Taylor expanded in y.re around 0 44.2%
*-commutative44.2%
distribute-lft-neg-in44.2%
Simplified44.2%
Final simplification44.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (* (atan2 x.im x.re) (- 1.0 (* (atan2 x.im x.re) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * (atan2(x_46_im, x_46_re) * (1.0 - (atan2(x_46_im, x_46_re) * y_46_im)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = y_46re * (atan2(x_46im, x_46re) * (1.0d0 - (atan2(x_46im, x_46re) * y_46im)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * (Math.atan2(x_46_im, x_46_re) * (1.0 - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * (math.atan2(x_46_im, x_46_re) * (1.0 - (math.atan2(x_46_im, x_46_re) * y_46_im)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * Float64(1.0 - Float64(atan(x_46_im, x_46_re) * y_46_im)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (1.0 - (atan2(x_46_im, x_46_re) * y_46_im))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)
\end{array}
Initial program 42.3%
Taylor expanded in y.im around 0 55.1%
Taylor expanded in y.re around 0 44.2%
*-commutative44.2%
distribute-lft-neg-in44.2%
Simplified44.2%
Taylor expanded in y.im around 0 16.6%
neg-mul-116.6%
unsub-neg16.6%
*-commutative16.6%
Simplified16.6%
Final simplification16.6%
(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 42.3%
Taylor expanded in y.im around 0 55.1%
Taylor expanded in y.re around 0 44.2%
*-commutative44.2%
distribute-lft-neg-in44.2%
Simplified44.2%
Taylor expanded in y.im around 0 16.0%
Final simplification16.0%
herbie shell --seed 2023319
(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)))))