
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)) (t_1 (log (hypot x.re x.im))))
(if (<= y.re 2e+118)
(*
(exp (- (* y.re t_1) t_0))
(sin (fma t_1 y.im (* y.re (atan2 x.im x.re)))))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(sin (* y.im (log (hypot x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 2e+118) {
tmp = exp(((y_46_re * t_1) - t_0)) * sin(fma(t_1, 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))))) - t_0)) * 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 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 2e+118) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - t_0)) * sin(fma(t_1, 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))))) - t_0)) * 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 2e+118], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 2 \cdot 10^{+118}:\\
\;\;\;\;e^{y.re \cdot t_1 - t_0} \cdot \sin \left(\mathsf{fma}\left(t_1, 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) - t_0} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < 1.99999999999999993e118Initial program 44.4%
hypot-def44.4%
fma-def44.4%
hypot-def81.9%
*-commutative81.9%
Simplified81.9%
if 1.99999999999999993e118 < y.re Initial program 30.3%
Taylor expanded in y.re around 0 36.4%
unpow236.4%
unpow236.4%
hypot-def78.8%
Simplified78.8%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2
(sin (fma y.re (atan2 x.im x.re) (* (log (hypot x.re x.im)) y.im))))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1)))
(t_4 (* y.re (atan2 x.im x.re)))
(t_5 (* t_3 (sqrt (pow (sin t_4) 2.0)))))
(if (<= y.im -78.0)
t_5
(if (<= y.im 4.2e-208)
(* (/ t_0 (+ t_1 1.0)) t_2)
(if (<= y.im 2.45e-173)
t_5
(if (<= y.im 4.2e-18)
(* t_0 t_2)
(if (or (<= y.im 6.9e+224) (not (<= y.im 1e+274)))
(* t_3 (sin (* y.im (log (hypot x.im x.re)))))
(* t_4 (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 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = sin(fma(y_46_re, atan2(x_46_im, x_46_re), (log(hypot(x_46_re, x_46_im)) * y_46_im)));
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
double t_4 = y_46_re * atan2(x_46_im, x_46_re);
double t_5 = t_3 * sqrt(pow(sin(t_4), 2.0));
double tmp;
if (y_46_im <= -78.0) {
tmp = t_5;
} else if (y_46_im <= 4.2e-208) {
tmp = (t_0 / (t_1 + 1.0)) * t_2;
} else if (y_46_im <= 2.45e-173) {
tmp = t_5;
} else if (y_46_im <= 4.2e-18) {
tmp = t_0 * t_2;
} else if ((y_46_im <= 6.9e+224) || !(y_46_im <= 1e+274)) {
tmp = t_3 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = t_4 * 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 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1)) t_4 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_5 = Float64(t_3 * sqrt((sin(t_4) ^ 2.0))) tmp = 0.0 if (y_46_im <= -78.0) tmp = t_5; elseif (y_46_im <= 4.2e-208) tmp = Float64(Float64(t_0 / Float64(t_1 + 1.0)) * t_2); elseif (y_46_im <= 2.45e-173) tmp = t_5; elseif (y_46_im <= 4.2e-18) tmp = Float64(t_0 * t_2); elseif ((y_46_im <= 6.9e+224) || !(y_46_im <= 1e+274)) tmp = Float64(t_3 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(t_4 * 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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = 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$1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 * N[Sqrt[N[Power[N[Sin[t$95$4], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -78.0], t$95$5, If[LessEqual[y$46$im, 4.2e-208], N[(N[(t$95$0 / N[(t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 2.45e-173], t$95$5, If[LessEqual[y$46$im, 4.2e-18], N[(t$95$0 * t$95$2), $MachinePrecision], If[Or[LessEqual[y$46$im, 6.9e+224], N[Not[LessEqual[y$46$im, 1e+274]], $MachinePrecision]], N[(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]), $MachinePrecision], N[(t$95$4 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right)\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1}\\
t_4 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_5 := t_3 \cdot \sqrt{{\sin t_4}^{2}}\\
\mathbf{if}\;y.im \leq -78:\\
\;\;\;\;t_5\\
\mathbf{elif}\;y.im \leq 4.2 \cdot 10^{-208}:\\
\;\;\;\;\frac{t_0}{t_1 + 1} \cdot t_2\\
\mathbf{elif}\;y.im \leq 2.45 \cdot 10^{-173}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;y.im \leq 4.2 \cdot 10^{-18}:\\
\;\;\;\;t_0 \cdot t_2\\
\mathbf{elif}\;y.im \leq 6.9 \cdot 10^{+224} \lor \neg \left(y.im \leq 10^{+274}\right):\\
\;\;\;\;t_3 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.im < -78 or 4.20000000000000024e-208 < y.im < 2.44999999999999996e-173Initial program 43.6%
Taylor expanded in y.im around 0 61.5%
add-sqr-sqrt40.6%
sqrt-unprod74.0%
pow274.0%
Applied egg-rr74.0%
if -78 < y.im < 4.20000000000000024e-208Initial program 46.4%
exp-diff46.4%
exp-to-pow46.4%
hypot-def46.4%
*-commutative46.4%
exp-prod46.4%
+-commutative46.4%
*-commutative46.4%
fma-def46.4%
+-commutative46.4%
Simplified89.2%
Taylor expanded in y.im around 0 89.2%
if 2.44999999999999996e-173 < y.im < 4.19999999999999999e-18Initial program 46.9%
exp-diff46.9%
exp-to-pow46.9%
hypot-def46.9%
*-commutative46.9%
exp-prod46.9%
+-commutative46.9%
*-commutative46.9%
fma-def46.9%
+-commutative46.9%
Simplified93.9%
Taylor expanded in y.im around 0 93.9%
if 4.19999999999999999e-18 < y.im < 6.9000000000000002e224 or 9.99999999999999921e273 < y.im Initial program 35.7%
Taylor expanded in y.re around 0 35.7%
unpow235.7%
unpow235.7%
hypot-def69.8%
Simplified69.8%
if 6.9000000000000002e224 < y.im < 9.99999999999999921e273Initial program 26.5%
Taylor expanded in y.im around 0 59.0%
Taylor expanded in x.re around 0 58.3%
Taylor expanded in y.re around 0 58.3%
Taylor expanded in y.re around 0 75.3%
distribute-rgt-neg-in75.3%
Simplified75.3%
Final simplification81.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(sin (fma y.re (atan2 x.im x.re) (* (log (hypot x.re x.im)) y.im))))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1)))
(t_4 (* t_3 (sin (* y.im (log (hypot x.im x.re))))))
(t_5 (pow (hypot x.re x.im) y.re)))
(if (<= y.im -1.15e+17)
(* t_3 (sin t_2))
(if (<= y.im 4.2e-208)
(* (/ t_5 (+ t_1 1.0)) t_0)
(if (<= y.im 2.45e-173)
t_4
(if (<= y.im 1.36e-18)
(* t_5 t_0)
(if (or (<= y.im 9.7e+222) (not (<= y.im 6.8e+273)))
t_4
(* t_2 (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 = sin(fma(y_46_re, atan2(x_46_im, x_46_re), (log(hypot(x_46_re, x_46_im)) * y_46_im)));
double t_1 = 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 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
double t_4 = t_3 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_5 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_im <= -1.15e+17) {
tmp = t_3 * sin(t_2);
} else if (y_46_im <= 4.2e-208) {
tmp = (t_5 / (t_1 + 1.0)) * t_0;
} else if (y_46_im <= 2.45e-173) {
tmp = t_4;
} else if (y_46_im <= 1.36e-18) {
tmp = t_5 * t_0;
} else if ((y_46_im <= 9.7e+222) || !(y_46_im <= 6.8e+273)) {
tmp = t_4;
} else {
tmp = t_2 * 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 = sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1)) t_4 = Float64(t_3 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) t_5 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_im <= -1.15e+17) tmp = Float64(t_3 * sin(t_2)); elseif (y_46_im <= 4.2e-208) tmp = Float64(Float64(t_5 / Float64(t_1 + 1.0)) * t_0); elseif (y_46_im <= 2.45e-173) tmp = t_4; elseif (y_46_im <= 1.36e-18) tmp = Float64(t_5 * t_0); elseif ((y_46_im <= 9.7e+222) || !(y_46_im <= 6.8e+273)) tmp = t_4; else tmp = Float64(t_2 * 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[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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$1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(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]), $MachinePrecision]}, Block[{t$95$5 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$im, -1.15e+17], N[(t$95$3 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.2e-208], N[(N[(t$95$5 / N[(t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 2.45e-173], t$95$4, If[LessEqual[y$46$im, 1.36e-18], N[(t$95$5 * t$95$0), $MachinePrecision], If[Or[LessEqual[y$46$im, 9.7e+222], N[Not[LessEqual[y$46$im, 6.8e+273]], $MachinePrecision]], t$95$4, N[(t$95$2 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1}\\
t_4 := t_3 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_5 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -1.15 \cdot 10^{+17}:\\
\;\;\;\;t_3 \cdot \sin t_2\\
\mathbf{elif}\;y.im \leq 4.2 \cdot 10^{-208}:\\
\;\;\;\;\frac{t_5}{t_1 + 1} \cdot t_0\\
\mathbf{elif}\;y.im \leq 2.45 \cdot 10^{-173}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y.im \leq 1.36 \cdot 10^{-18}:\\
\;\;\;\;t_5 \cdot t_0\\
\mathbf{elif}\;y.im \leq 9.7 \cdot 10^{+222} \lor \neg \left(y.im \leq 6.8 \cdot 10^{+273}\right):\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.im < -1.15e17Initial program 44.6%
Taylor expanded in y.im around 0 63.7%
if -1.15e17 < y.im < 4.20000000000000024e-208Initial program 47.6%
exp-diff47.6%
exp-to-pow47.6%
hypot-def47.6%
*-commutative47.6%
exp-prod47.6%
+-commutative47.6%
*-commutative47.6%
fma-def47.7%
+-commutative47.7%
Simplified88.6%
Taylor expanded in y.im around 0 88.6%
if 4.20000000000000024e-208 < y.im < 2.44999999999999996e-173 or 1.3600000000000001e-18 < y.im < 9.69999999999999949e222 or 6.79999999999999997e273 < y.im Initial program 34.2%
Taylor expanded in y.re around 0 35.9%
unpow235.9%
unpow235.9%
hypot-def73.6%
Simplified73.6%
if 2.44999999999999996e-173 < y.im < 1.3600000000000001e-18Initial program 46.9%
exp-diff46.9%
exp-to-pow46.9%
hypot-def46.9%
*-commutative46.9%
exp-prod46.9%
+-commutative46.9%
*-commutative46.9%
fma-def46.9%
+-commutative46.9%
Simplified93.9%
Taylor expanded in y.im around 0 93.9%
if 9.69999999999999949e222 < y.im < 6.79999999999999997e273Initial program 26.5%
Taylor expanded in y.im around 0 59.0%
Taylor expanded in x.re around 0 58.3%
Taylor expanded in y.re around 0 58.3%
Taylor expanded in y.re around 0 75.3%
distribute-rgt-neg-in75.3%
Simplified75.3%
Final simplification79.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(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))))))
(t_1
(*
(pow (hypot x.re x.im) y.re)
(sin
(fma y.re (atan2 x.im x.re) (* (log (hypot x.re x.im)) y.im))))))
(if (<= y.im -35.0)
t_0
(if (<= y.im 4.2e-208)
t_1
(if (<= y.im 2.45e-173)
t_0
(if (<= y.im 1.8e-16)
t_1
(if (or (<= y.im 7.5e+223) (not (<= y.im 5.2e+273)))
t_0
(*
(* y.re (atan2 x.im x.re))
(exp (* (atan2 x.im x.re) (- y.im)))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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))));
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (log(hypot(x_46_re, x_46_im)) * y_46_im)));
double tmp;
if (y_46_im <= -35.0) {
tmp = t_0;
} else if (y_46_im <= 4.2e-208) {
tmp = t_1;
} else if (y_46_im <= 2.45e-173) {
tmp = t_0;
} else if (y_46_im <= 1.8e-16) {
tmp = t_1;
} else if ((y_46_im <= 7.5e+223) || !(y_46_im <= 5.2e+273)) {
tmp = t_0;
} else {
tmp = (y_46_re * atan2(x_46_im, x_46_re)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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))))) t_1 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)))) tmp = 0.0 if (y_46_im <= -35.0) tmp = t_0; elseif (y_46_im <= 4.2e-208) tmp = t_1; elseif (y_46_im <= 2.45e-173) tmp = t_0; elseif (y_46_im <= 1.8e-16) tmp = t_1; elseif ((y_46_im <= 7.5e+223) || !(y_46_im <= 5.2e+273)) tmp = t_0; else tmp = Float64(Float64(y_46_re * 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[(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]}, Block[{t$95$1 = 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] + N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -35.0], t$95$0, If[LessEqual[y$46$im, 4.2e-208], t$95$1, If[LessEqual[y$46$im, 2.45e-173], t$95$0, If[LessEqual[y$46$im, 1.8e-16], t$95$1, If[Or[LessEqual[y$46$im, 7.5e+223], N[Not[LessEqual[y$46$im, 5.2e+273]], $MachinePrecision]], t$95$0, N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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)\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right)\\
\mathbf{if}\;y.im \leq -35:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 4.2 \cdot 10^{-208}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 2.45 \cdot 10^{-173}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+223} \lor \neg \left(y.im \leq 5.2 \cdot 10^{+273}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.im < -35 or 4.20000000000000024e-208 < y.im < 2.44999999999999996e-173 or 1.79999999999999991e-16 < y.im < 7.5000000000000003e223 or 5.19999999999999986e273 < y.im Initial program 40.3%
Taylor expanded in y.re around 0 40.4%
unpow240.4%
unpow240.4%
hypot-def68.5%
Simplified68.5%
if -35 < y.im < 4.20000000000000024e-208 or 2.44999999999999996e-173 < y.im < 1.79999999999999991e-16Initial program 46.5%
exp-diff46.5%
exp-to-pow46.5%
hypot-def46.5%
*-commutative46.5%
exp-prod46.5%
+-commutative46.5%
*-commutative46.5%
fma-def46.5%
+-commutative46.5%
Simplified90.6%
Taylor expanded in y.im around 0 90.4%
if 7.5000000000000003e223 < y.im < 5.19999999999999986e273Initial program 26.5%
Taylor expanded in y.im around 0 59.0%
Taylor expanded in x.re around 0 58.3%
Taylor expanded in y.re around 0 58.3%
Taylor expanded in y.re around 0 75.3%
distribute-rgt-neg-in75.3%
Simplified75.3%
Final simplification79.1%
(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.im -1.15e+17)
(* t_1 (sin t_0))
(if (<= y.im 0.00016)
(*
(pow (hypot x.re x.im) y.re)
(sin (fma y.re (atan2 x.im x.re) (* (log (hypot x.re x.im)) y.im))))
(* t_0 t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((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_im <= -1.15e+17) {
tmp = t_1 * sin(t_0);
} else if (y_46_im <= 0.00016) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (log(hypot(x_46_re, x_46_im)) * y_46_im)));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = exp(Float64(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_im <= -1.15e+17) tmp = Float64(t_1 * sin(t_0)); elseif (y_46_im <= 0.00016) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)))); else tmp = Float64(t_0 * t_1); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(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$im, -1.15e+17], N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 0.00016], 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] + N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$1), $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.im \leq -1.15 \cdot 10^{+17}:\\
\;\;\;\;t_1 \cdot \sin t_0\\
\mathbf{elif}\;y.im \leq 0.00016:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot t_1\\
\end{array}
\end{array}
if y.im < -1.15e17Initial program 44.6%
Taylor expanded in y.im around 0 63.7%
if -1.15e17 < y.im < 1.60000000000000013e-4Initial program 45.8%
exp-diff45.8%
exp-to-pow45.8%
hypot-def45.8%
*-commutative45.8%
exp-prod45.8%
+-commutative45.8%
*-commutative45.8%
fma-def45.8%
+-commutative45.8%
Simplified86.7%
Taylor expanded in y.im around 0 85.2%
if 1.60000000000000013e-4 < y.im Initial program 33.4%
Taylor expanded in y.im around 0 61.0%
Taylor expanded in y.re around 0 61.0%
Final simplification74.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))))
(exp
(- (* y.re (log (+ x.im (* 0.5 (/ (* x.re x.re) x.im))))) t_0))))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (sin t_2))
(t_4
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_3))
(t_5 (exp (- (* y.re (log x.im)) t_0))))
(if (<= x.im -1.18e-20)
(* t_3 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 8.2e-151)
t_4
(if (<= x.im 7.5e-80)
t_1
(if (<= x.im 2.9)
t_4
(if (<= x.im 2.5e+79)
t_1
(if (<= x.im 1e+148)
(* t_2 t_5)
(* t_5 (sin (+ t_2 (* y.im (log x.im)))))))))))))
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)))) * exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = sin(t_2);
double t_4 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_3;
double t_5 = exp(((y_46_re * log(x_46_im)) - t_0));
double tmp;
if (x_46_im <= -1.18e-20) {
tmp = t_3 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 8.2e-151) {
tmp = t_4;
} else if (x_46_im <= 7.5e-80) {
tmp = t_1;
} else if (x_46_im <= 2.9) {
tmp = t_4;
} else if (x_46_im <= 2.5e+79) {
tmp = t_1;
} else if (x_46_im <= 1e+148) {
tmp = t_2 * t_5;
} else {
tmp = t_5 * sin((t_2 + (y_46_im * log(x_46_im))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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)))) * Math.exp(((y_46_re * Math.log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0));
double t_2 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_3 = Math.sin(t_2);
double t_4 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_3;
double t_5 = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
double tmp;
if (x_46_im <= -1.18e-20) {
tmp = t_3 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 8.2e-151) {
tmp = t_4;
} else if (x_46_im <= 7.5e-80) {
tmp = t_1;
} else if (x_46_im <= 2.9) {
tmp = t_4;
} else if (x_46_im <= 2.5e+79) {
tmp = t_1;
} else if (x_46_im <= 1e+148) {
tmp = t_2 * t_5;
} else {
tmp = t_5 * Math.sin((t_2 + (y_46_im * Math.log(x_46_im))));
}
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)))) * math.exp(((y_46_re * math.log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0)) t_2 = y_46_re * math.atan2(x_46_im, x_46_re) t_3 = math.sin(t_2) t_4 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_3 t_5 = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) tmp = 0 if x_46_im <= -1.18e-20: tmp = t_3 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 8.2e-151: tmp = t_4 elif x_46_im <= 7.5e-80: tmp = t_1 elif x_46_im <= 2.9: tmp = t_4 elif x_46_im <= 2.5e+79: tmp = t_1 elif x_46_im <= 1e+148: tmp = t_2 * t_5 else: tmp = t_5 * math.sin((t_2 + (y_46_im * math.log(x_46_im)))) 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(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(Float64(y_46_re * log(Float64(x_46_im + Float64(0.5 * Float64(Float64(x_46_re * x_46_re) / x_46_im))))) - t_0))) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = sin(t_2) t_4 = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * t_3) t_5 = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) tmp = 0.0 if (x_46_im <= -1.18e-20) tmp = Float64(t_3 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 8.2e-151) tmp = t_4; elseif (x_46_im <= 7.5e-80) tmp = t_1; elseif (x_46_im <= 2.9) tmp = t_4; elseif (x_46_im <= 2.5e+79) tmp = t_1; elseif (x_46_im <= 1e+148) tmp = Float64(t_2 * t_5); else tmp = Float64(t_5 * sin(Float64(t_2 + Float64(y_46_im * log(x_46_im))))); 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)))) * exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0)); t_2 = y_46_re * atan2(x_46_im, x_46_re); t_3 = sin(t_2); t_4 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_3; t_5 = exp(((y_46_re * log(x_46_im)) - t_0)); tmp = 0.0; if (x_46_im <= -1.18e-20) tmp = t_3 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 8.2e-151) tmp = t_4; elseif (x_46_im <= 7.5e-80) tmp = t_1; elseif (x_46_im <= 2.9) tmp = t_4; elseif (x_46_im <= 2.5e+79) tmp = t_1; elseif (x_46_im <= 1e+148) tmp = t_2 * t_5; else tmp = t_5 * sin((t_2 + (y_46_im * log(x_46_im)))); 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[(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[N[(x$46$im + N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $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[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.18e-20], N[(t$95$3 * 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, 8.2e-151], t$95$4, If[LessEqual[x$46$im, 7.5e-80], t$95$1, If[LessEqual[x$46$im, 2.9], t$95$4, If[LessEqual[x$46$im, 2.5e+79], t$95$1, If[LessEqual[x$46$im, 1e+148], N[(t$95$2 * t$95$5), $MachinePrecision], N[(t$95$5 * N[Sin[N[(t$95$2 + N[(y$46$im * N[Log[x$46$im], $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 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log \left(x.im + 0.5 \cdot \frac{x.re \cdot x.re}{x.im}\right) - t_0}\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \sin t_2\\
t_4 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot t_3\\
t_5 := e^{y.re \cdot \log x.im - t_0}\\
\mathbf{if}\;x.im \leq -1.18 \cdot 10^{-20}:\\
\;\;\;\;t_3 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 8.2 \cdot 10^{-151}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x.im \leq 7.5 \cdot 10^{-80}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq 2.9:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x.im \leq 2.5 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq 10^{+148}:\\
\;\;\;\;t_2 \cdot t_5\\
\mathbf{else}:\\
\;\;\;\;t_5 \cdot \sin \left(t_2 + y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -1.1800000000000001e-20Initial program 43.2%
Taylor expanded in y.im around 0 59.2%
Taylor expanded in x.im around -inf 68.1%
neg-mul-168.1%
Simplified68.1%
if -1.1800000000000001e-20 < x.im < 8.2000000000000002e-151 or 7.49999999999999999e-80 < x.im < 2.89999999999999991Initial program 44.6%
Taylor expanded in y.im around 0 58.9%
if 8.2000000000000002e-151 < x.im < 7.49999999999999999e-80 or 2.89999999999999991 < x.im < 2.5e79Initial program 66.3%
Taylor expanded in x.re around 0 57.3%
unpow257.3%
Simplified57.3%
Taylor expanded in y.re around 0 66.6%
unpow275.7%
unpow275.7%
hypot-def85.3%
Simplified76.2%
if 2.5e79 < x.im < 1e148Initial program 53.2%
Taylor expanded in y.im around 0 67.6%
Taylor expanded in x.re around 0 69.6%
Taylor expanded in y.re around 0 76.3%
if 1e148 < x.im Initial program 0.0%
Taylor expanded in x.re around 0 0.0%
unpow20.0%
Simplified0.0%
Taylor expanded in x.re around 0 75.4%
Taylor expanded in x.re around 0 83.6%
Final simplification67.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (exp (- (* y.re (log x.im)) t_0)))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3
(*
t_2
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))))
(t_4 (* y.im (log x.im)))
(t_5 (* t_1 (sin (+ t_2 t_4)))))
(if (<= x.im -8e+47)
(* (sin t_2) (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 1.5e-175)
t_3
(if (<= x.im 9.5e-107)
t_5
(if (<= x.im 1.25)
t_3
(if (<= x.im 2.9e+46)
(*
(exp
(- (* y.re (log (+ x.im (* 0.5 (/ (* x.re x.re) x.im))))) t_0))
(sin t_4))
(if (<= x.im 4.3e+167) (* t_2 t_1) t_5))))))))
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 = exp(((y_46_re * log(x_46_im)) - t_0));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = t_2 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double t_4 = y_46_im * log(x_46_im);
double t_5 = t_1 * sin((t_2 + t_4));
double tmp;
if (x_46_im <= -8e+47) {
tmp = sin(t_2) * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 1.5e-175) {
tmp = t_3;
} else if (x_46_im <= 9.5e-107) {
tmp = t_5;
} else if (x_46_im <= 1.25) {
tmp = t_3;
} else if (x_46_im <= 2.9e+46) {
tmp = exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0)) * sin(t_4);
} else if (x_46_im <= 4.3e+167) {
tmp = t_2 * t_1;
} else {
tmp = t_5;
}
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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = exp(((y_46re * log(x_46im)) - t_0))
t_2 = y_46re * atan2(x_46im, x_46re)
t_3 = t_2 * exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - t_0))
t_4 = y_46im * log(x_46im)
t_5 = t_1 * sin((t_2 + t_4))
if (x_46im <= (-8d+47)) then
tmp = sin(t_2) * exp(((y_46re * log(-x_46im)) - t_0))
else if (x_46im <= 1.5d-175) then
tmp = t_3
else if (x_46im <= 9.5d-107) then
tmp = t_5
else if (x_46im <= 1.25d0) then
tmp = t_3
else if (x_46im <= 2.9d+46) then
tmp = exp(((y_46re * log((x_46im + (0.5d0 * ((x_46re * x_46re) / x_46im))))) - t_0)) * sin(t_4)
else if (x_46im <= 4.3d+167) then
tmp = t_2 * t_1
else
tmp = t_5
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 t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
double t_2 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_3 = t_2 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double t_4 = y_46_im * Math.log(x_46_im);
double t_5 = t_1 * Math.sin((t_2 + t_4));
double tmp;
if (x_46_im <= -8e+47) {
tmp = Math.sin(t_2) * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 1.5e-175) {
tmp = t_3;
} else if (x_46_im <= 9.5e-107) {
tmp = t_5;
} else if (x_46_im <= 1.25) {
tmp = t_3;
} else if (x_46_im <= 2.9e+46) {
tmp = Math.exp(((y_46_re * Math.log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0)) * Math.sin(t_4);
} else if (x_46_im <= 4.3e+167) {
tmp = t_2 * t_1;
} else {
tmp = t_5;
}
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.exp(((y_46_re * math.log(x_46_im)) - t_0)) t_2 = y_46_re * math.atan2(x_46_im, x_46_re) t_3 = t_2 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) t_4 = y_46_im * math.log(x_46_im) t_5 = t_1 * math.sin((t_2 + t_4)) tmp = 0 if x_46_im <= -8e+47: tmp = math.sin(t_2) * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 1.5e-175: tmp = t_3 elif x_46_im <= 9.5e-107: tmp = t_5 elif x_46_im <= 1.25: tmp = t_3 elif x_46_im <= 2.9e+46: tmp = math.exp(((y_46_re * math.log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0)) * math.sin(t_4) elif x_46_im <= 4.3e+167: tmp = t_2 * t_1 else: tmp = t_5 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 = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = Float64(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_4 = Float64(y_46_im * log(x_46_im)) t_5 = Float64(t_1 * sin(Float64(t_2 + t_4))) tmp = 0.0 if (x_46_im <= -8e+47) tmp = Float64(sin(t_2) * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 1.5e-175) tmp = t_3; elseif (x_46_im <= 9.5e-107) tmp = t_5; elseif (x_46_im <= 1.25) tmp = t_3; elseif (x_46_im <= 2.9e+46) tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(x_46_im + Float64(0.5 * Float64(Float64(x_46_re * x_46_re) / x_46_im))))) - t_0)) * sin(t_4)); elseif (x_46_im <= 4.3e+167) tmp = Float64(t_2 * t_1); else tmp = t_5; 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 = exp(((y_46_re * log(x_46_im)) - t_0)); t_2 = y_46_re * atan2(x_46_im, x_46_re); t_3 = t_2 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)); t_4 = y_46_im * log(x_46_im); t_5 = t_1 * sin((t_2 + t_4)); tmp = 0.0; if (x_46_im <= -8e+47) tmp = sin(t_2) * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 1.5e-175) tmp = t_3; elseif (x_46_im <= 9.5e-107) tmp = t_5; elseif (x_46_im <= 1.25) tmp = t_3; elseif (x_46_im <= 2.9e+46) tmp = exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0)) * sin(t_4); elseif (x_46_im <= 4.3e+167) tmp = t_2 * t_1; else tmp = t_5; 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[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $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[(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]), $MachinePrecision]}, Block[{t$95$4 = N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 * N[Sin[N[(t$95$2 + t$95$4), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -8e+47], N[(N[Sin[t$95$2], $MachinePrecision] * 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.5e-175], t$95$3, If[LessEqual[x$46$im, 9.5e-107], t$95$5, If[LessEqual[x$46$im, 1.25], t$95$3, If[LessEqual[x$46$im, 2.9e+46], N[(N[Exp[N[(N[(y$46$re * N[Log[N[(x$46$im + N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4.3e+167], N[(t$95$2 * t$95$1), $MachinePrecision], t$95$5]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{y.re \cdot \log x.im - t_0}\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := t_2 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\
t_4 := y.im \cdot \log x.im\\
t_5 := t_1 \cdot \sin \left(t_2 + t_4\right)\\
\mathbf{if}\;x.im \leq -8 \cdot 10^{+47}:\\
\;\;\;\;\sin t_2 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 1.5 \cdot 10^{-175}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x.im \leq 9.5 \cdot 10^{-107}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x.im \leq 1.25:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x.im \leq 2.9 \cdot 10^{+46}:\\
\;\;\;\;e^{y.re \cdot \log \left(x.im + 0.5 \cdot \frac{x.re \cdot x.re}{x.im}\right) - t_0} \cdot \sin t_4\\
\mathbf{elif}\;x.im \leq 4.3 \cdot 10^{+167}:\\
\;\;\;\;t_2 \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_5\\
\end{array}
\end{array}
if x.im < -8.0000000000000004e47Initial program 37.7%
Taylor expanded in y.im around 0 59.3%
Taylor expanded in x.im around -inf 70.5%
neg-mul-170.5%
Simplified70.5%
if -8.0000000000000004e47 < x.im < 1.5e-175 or 9.4999999999999999e-107 < x.im < 1.25Initial program 47.7%
Taylor expanded in y.im around 0 58.1%
Taylor expanded in y.re around 0 55.5%
if 1.5e-175 < x.im < 9.4999999999999999e-107 or 4.3000000000000002e167 < x.im Initial program 23.7%
Taylor expanded in x.re around 0 16.1%
unpow216.1%
Simplified16.1%
Taylor expanded in x.re around 0 65.0%
Taylor expanded in x.re around 0 75.7%
if 1.25 < x.im < 2.9000000000000002e46Initial program 75.0%
Taylor expanded in x.re around 0 75.0%
unpow275.0%
Simplified75.0%
Taylor expanded in x.re around 0 84.8%
Taylor expanded in y.re around 0 93.1%
if 2.9000000000000002e46 < x.im < 4.3000000000000002e167Initial program 39.9%
Taylor expanded in y.im around 0 57.0%
Taylor expanded in x.re around 0 66.3%
Taylor expanded in y.re around 0 74.3%
Final simplification65.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (exp (- (* y.re (log x.im)) t_0)))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (sin t_2))
(t_4 (* y.im (log x.im))))
(if (<= x.im -1.35e-20)
(* t_3 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 1.9)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_3)
(if (<= x.im 1.18e+79)
(*
(exp (- (* y.re (log (+ x.im (* 0.5 (/ (* x.re x.re) x.im))))) t_0))
(sin t_4))
(if (<= x.im 5.2e+150) (* t_2 t_1) (* t_1 (sin (+ t_2 t_4)))))))))
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 = exp(((y_46_re * log(x_46_im)) - t_0));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = sin(t_2);
double t_4 = y_46_im * log(x_46_im);
double tmp;
if (x_46_im <= -1.35e-20) {
tmp = t_3 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 1.9) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_3;
} else if (x_46_im <= 1.18e+79) {
tmp = exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0)) * sin(t_4);
} else if (x_46_im <= 5.2e+150) {
tmp = t_2 * t_1;
} else {
tmp = t_1 * sin((t_2 + t_4));
}
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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = exp(((y_46re * log(x_46im)) - t_0))
t_2 = y_46re * atan2(x_46im, x_46re)
t_3 = sin(t_2)
t_4 = y_46im * log(x_46im)
if (x_46im <= (-1.35d-20)) then
tmp = t_3 * exp(((y_46re * log(-x_46im)) - t_0))
else if (x_46im <= 1.9d0) then
tmp = exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - t_0)) * t_3
else if (x_46im <= 1.18d+79) then
tmp = exp(((y_46re * log((x_46im + (0.5d0 * ((x_46re * x_46re) / x_46im))))) - t_0)) * sin(t_4)
else if (x_46im <= 5.2d+150) then
tmp = t_2 * t_1
else
tmp = t_1 * sin((t_2 + t_4))
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 t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
double t_2 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_3 = Math.sin(t_2);
double t_4 = y_46_im * Math.log(x_46_im);
double tmp;
if (x_46_im <= -1.35e-20) {
tmp = t_3 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 1.9) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_3;
} else if (x_46_im <= 1.18e+79) {
tmp = Math.exp(((y_46_re * Math.log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0)) * Math.sin(t_4);
} else if (x_46_im <= 5.2e+150) {
tmp = t_2 * t_1;
} else {
tmp = t_1 * Math.sin((t_2 + t_4));
}
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.exp(((y_46_re * math.log(x_46_im)) - t_0)) t_2 = y_46_re * math.atan2(x_46_im, x_46_re) t_3 = math.sin(t_2) t_4 = y_46_im * math.log(x_46_im) tmp = 0 if x_46_im <= -1.35e-20: tmp = t_3 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 1.9: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_3 elif x_46_im <= 1.18e+79: tmp = math.exp(((y_46_re * math.log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0)) * math.sin(t_4) elif x_46_im <= 5.2e+150: tmp = t_2 * t_1 else: tmp = t_1 * math.sin((t_2 + t_4)) 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 = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = sin(t_2) t_4 = Float64(y_46_im * log(x_46_im)) tmp = 0.0 if (x_46_im <= -1.35e-20) tmp = Float64(t_3 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 1.9) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * t_3); elseif (x_46_im <= 1.18e+79) tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(x_46_im + Float64(0.5 * Float64(Float64(x_46_re * x_46_re) / x_46_im))))) - t_0)) * sin(t_4)); elseif (x_46_im <= 5.2e+150) tmp = Float64(t_2 * t_1); else tmp = Float64(t_1 * sin(Float64(t_2 + t_4))); 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 = exp(((y_46_re * log(x_46_im)) - t_0)); t_2 = y_46_re * atan2(x_46_im, x_46_re); t_3 = sin(t_2); t_4 = y_46_im * log(x_46_im); tmp = 0.0; if (x_46_im <= -1.35e-20) tmp = t_3 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 1.9) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_3; elseif (x_46_im <= 1.18e+79) tmp = exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0)) * sin(t_4); elseif (x_46_im <= 5.2e+150) tmp = t_2 * t_1; else tmp = t_1 * sin((t_2 + 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $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[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -1.35e-20], N[(t$95$3 * 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.9], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[x$46$im, 1.18e+79], N[(N[Exp[N[(N[(y$46$re * N[Log[N[(x$46$im + N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 5.2e+150], N[(t$95$2 * t$95$1), $MachinePrecision], N[(t$95$1 * N[Sin[N[(t$95$2 + t$95$4), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{y.re \cdot \log x.im - t_0}\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \sin t_2\\
t_4 := y.im \cdot \log x.im\\
\mathbf{if}\;x.im \leq -1.35 \cdot 10^{-20}:\\
\;\;\;\;t_3 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 1.9:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot t_3\\
\mathbf{elif}\;x.im \leq 1.18 \cdot 10^{+79}:\\
\;\;\;\;e^{y.re \cdot \log \left(x.im + 0.5 \cdot \frac{x.re \cdot x.re}{x.im}\right) - t_0} \cdot \sin t_4\\
\mathbf{elif}\;x.im \leq 5.2 \cdot 10^{+150}:\\
\;\;\;\;t_2 \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(t_2 + t_4\right)\\
\end{array}
\end{array}
if x.im < -1.35e-20Initial program 43.2%
Taylor expanded in y.im around 0 59.2%
Taylor expanded in x.im around -inf 68.1%
neg-mul-168.1%
Simplified68.1%
if -1.35e-20 < x.im < 1.8999999999999999Initial program 47.3%
Taylor expanded in y.im around 0 55.5%
if 1.8999999999999999 < x.im < 1.18e79Initial program 64.7%
Taylor expanded in x.re around 0 64.7%
unpow264.7%
Simplified64.7%
Taylor expanded in x.re around 0 77.5%
Taylor expanded in y.re around 0 89.3%
if 1.18e79 < x.im < 5.20000000000000012e150Initial program 53.2%
Taylor expanded in y.im around 0 67.6%
Taylor expanded in x.re around 0 69.6%
Taylor expanded in y.re around 0 76.3%
if 5.20000000000000012e150 < x.im Initial program 0.0%
Taylor expanded in x.re around 0 0.0%
unpow20.0%
Simplified0.0%
Taylor expanded in x.re around 0 75.4%
Taylor expanded in x.re around 0 83.6%
Final simplification65.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -0.0055) (not (<= y.re 4.7e+58)))
(*
t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(* t_0 (exp (* (atan2 x.im x.re) (- y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -0.0055) || !(y_46_re <= 4.7e+58)) {
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 = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
if ((y_46re <= (-0.0055d0)) .or. (.not. (y_46re <= 4.7d+58))) then
tmp = t_0 * exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - (atan2(x_46im, x_46re) * y_46im)))
else
tmp = t_0 * exp((atan2(x_46im, x_46re) * -y_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -0.0055) || !(y_46_re <= 4.7e+58)) {
tmp = t_0 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_re <= -0.0055) or not (y_46_re <= 4.7e+58): tmp = t_0 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) else: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -0.0055) || !(y_46_re <= 4.7e+58)) 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(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_re <= -0.0055) || ~((y_46_re <= 4.7e+58))) 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 = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -0.0055], N[Not[LessEqual[y$46$re, 4.7e+58]], $MachinePrecision]], 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[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -0.0055 \lor \neg \left(y.re \leq 4.7 \cdot 10^{+58}\right):\\
\;\;\;\;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}:\\
\;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -0.0054999999999999997 or 4.69999999999999972e58 < y.re Initial program 42.7%
Taylor expanded in y.im around 0 71.8%
Taylor expanded in y.re around 0 68.8%
if -0.0054999999999999997 < y.re < 4.69999999999999972e58Initial program 42.4%
Taylor expanded in y.im around 0 39.2%
Taylor expanded in x.re around 0 22.6%
Taylor expanded in y.re around 0 22.3%
Taylor expanded in y.re around 0 49.2%
distribute-rgt-neg-in49.2%
Simplified49.2%
Final simplification58.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -1e-310)
(* t_1 (exp (- (* y.re (log (- x.im))) t_0)))
(* t_1 (exp (- (* y.re (log x.im)) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -1e-310) {
tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0));
}
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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46im <= (-1d-310)) then
tmp = t_1 * exp(((y_46re * log(-x_46im)) - t_0))
else
tmp = t_1 * exp(((y_46re * log(x_46im)) - t_0))
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 t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -1e-310) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -1e-310: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -1e-310) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -1e-310) tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0)); else tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1e-310], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -9.999999999999969e-311Initial program 46.8%
Taylor expanded in y.im around 0 59.6%
Taylor expanded in x.im around -inf 59.9%
neg-mul-159.9%
Simplified59.9%
if -9.999999999999969e-311 < x.im Initial program 38.6%
Taylor expanded in y.im around 0 50.7%
Taylor expanded in x.re around 0 48.9%
Final simplification54.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.re -1e-309)
(* t_1 (exp (- (* y.re (log (- x.re))) t_0)))
(* t_1 (exp (- (* y.re (log x.re)) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -1e-309) {
tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0));
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
}
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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46re <= (-1d-309)) then
tmp = t_1 * exp(((y_46re * log(-x_46re)) - t_0))
else
tmp = t_1 * exp(((y_46re * log(x_46re)) - t_0))
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 t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -1e-309) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= -1e-309: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -1e-309) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= -1e-309) tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0)); else tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -1e-309], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.re - t_0}\\
\end{array}
\end{array}
if x.re < -1.000000000000002e-309Initial program 47.4%
Taylor expanded in y.im around 0 62.2%
Taylor expanded in x.re around -inf 65.7%
mul-1-neg65.7%
Simplified65.7%
if -1.000000000000002e-309 < x.re Initial program 37.8%
Taylor expanded in y.im around 0 47.9%
Taylor expanded in x.re around inf 50.2%
Final simplification57.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -1.6e-9) (not (<= y.re 1.12e+27)))
(* t_0 (pow x.im y.re))
(* t_0 (exp (* (atan2 x.im x.re) (- y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -1.6e-9) || !(y_46_re <= 1.12e+27)) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
if ((y_46re <= (-1.6d-9)) .or. (.not. (y_46re <= 1.12d+27))) then
tmp = t_0 * (x_46im ** y_46re)
else
tmp = t_0 * exp((atan2(x_46im, x_46re) * -y_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -1.6e-9) || !(y_46_re <= 1.12e+27)) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_re <= -1.6e-9) or not (y_46_re <= 1.12e+27): tmp = t_0 * math.pow(x_46_im, y_46_re) else: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -1.6e-9) || !(y_46_re <= 1.12e+27)) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_re <= -1.6e-9) || ~((y_46_re <= 1.12e+27))) tmp = t_0 * (x_46_im ^ y_46_re); else tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -1.6e-9], N[Not[LessEqual[y$46$re, 1.12e+27]], $MachinePrecision]], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1.6 \cdot 10^{-9} \lor \neg \left(y.re \leq 1.12 \cdot 10^{+27}\right):\\
\;\;\;\;t_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.60000000000000006e-9 or 1.12e27 < y.re Initial program 40.3%
Taylor expanded in y.im around 0 68.0%
Taylor expanded in x.re around 0 28.5%
Taylor expanded in y.re around 0 26.9%
Taylor expanded in y.im around 0 49.6%
if -1.60000000000000006e-9 < y.re < 1.12e27Initial program 45.1%
Taylor expanded in y.im around 0 40.7%
Taylor expanded in x.re around 0 22.0%
Taylor expanded in y.re around 0 21.2%
Taylor expanded in y.re around 0 51.0%
distribute-rgt-neg-in51.0%
Simplified51.0%
Final simplification50.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (* y.re (atan2 x.im x.re)) (pow x.im y.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)) * pow(x_46_im, 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
code = (y_46re * atan2(x_46im, x_46re)) * (x_46im ** y_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (y_46_re * Math.atan2(x_46_im, x_46_re)) * Math.pow(x_46_im, y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return (y_46_re * math.atan2(x_46_im, x_46_re)) * math.pow(x_46_im, y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (x_46_im ^ y_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)) * (x_46_im ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}
\end{array}
Initial program 42.6%
Taylor expanded in y.im around 0 55.0%
Taylor expanded in x.re around 0 25.4%
Taylor expanded in y.re around 0 24.2%
Taylor expanded in y.im around 0 30.4%
Final simplification30.4%
herbie shell --seed 2023279
(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)))))