
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.im (log (hypot x.im x.re))))
(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_0))
(+ (sin t_2) t_1))))
(if (<= y.re -2.6e+20)
t_3
(if (<= y.re 1.55e-12)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_2))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 1e+276)
t_3
(* (/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0)) (sin (fabs 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_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_im * log(hypot(x_46_im, x_46_re));
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_0)) * (sin(t_2) + t_1);
double tmp;
if (y_46_re <= -2.6e+20) {
tmp = t_3;
} else if (y_46_re <= 1.55e-12) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1e+276) {
tmp = t_3;
} else {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * sin(fabs(t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = 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)) * Float64(sin(t_2) + t_1)) tmp = 0.0 if (y_46_re <= -2.6e+20) tmp = t_3; elseif (y_46_re <= 1.55e-12) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 1e+276) tmp = t_3; else tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.0)) * sin(abs(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$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $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[(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[(N[Sin[t$95$2], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.6e+20], t$95$3, If[LessEqual[y$46$re, 1.55e-12], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1e+276], t$95$3, N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sin[N[Abs[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
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_0} \cdot \left(\sin t_2 + t_1\right)\\
\mathbf{if}\;y.re \leq -2.6 \cdot 10^{+20}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.re \leq 1.55 \cdot 10^{-12}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_2\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 10^{+276}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_0 + 1} \cdot \sin \left(\left|t_1\right|\right)\\
\end{array}
\end{array}
if y.re < -2.6e20 or 1.5500000000000001e-12 < y.re < 1.0000000000000001e276Initial program 42.9%
Taylor expanded in y.im around 0 55.5%
+-commutative55.5%
*-commutative55.5%
unpow255.5%
unpow255.5%
hypot-def77.4%
Simplified77.4%
Taylor expanded in y.re around 0 81.6%
if -2.6e20 < y.re < 1.5500000000000001e-12Initial program 43.5%
fma-neg43.5%
hypot-def43.5%
distribute-rgt-neg-out43.5%
fma-def44.3%
hypot-def81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.re around 0 78.7%
neg-mul-178.7%
distribute-lft-neg-in78.7%
Simplified78.7%
if 1.0000000000000001e276 < y.re Initial program 0.0%
exp-diff0.0%
exp-to-pow0.0%
hypot-def0.0%
*-commutative0.0%
exp-prod0.0%
fma-def0.0%
hypot-def25.0%
*-commutative25.0%
Simplified25.0%
Taylor expanded in y.im around 0 25.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
pow20.0%
Applied egg-rr0.0%
unpow20.0%
rem-sqrt-square37.5%
fma-def37.5%
*-commutative37.5%
hypot-def0.0%
unpow20.0%
unpow20.0%
+-commutative0.0%
unpow20.0%
unpow20.0%
hypot-def37.5%
fma-udef37.5%
Simplified37.5%
Taylor expanded in y.im around inf 12.5%
unpow212.5%
unpow212.5%
hypot-def75.0%
Simplified75.0%
Final simplification79.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (* (atan2 x.im x.re) (- y.im))))
(if (<= y.im -4.4e+219)
(* y.re (* (atan2 x.im x.re) (exp t_1)))
(*
(exp (fma t_0 y.re t_1))
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = atan2(x_46_im, x_46_re) * -y_46_im;
double tmp;
if (y_46_im <= -4.4e+219) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp(t_1));
} else {
tmp = exp(fma(t_0, y_46_re, t_1)) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) tmp = 0.0 if (y_46_im <= -4.4e+219) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(t_1))); else tmp = Float64(exp(fma(t_0, y_46_re, t_1)) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$im, -4.4e+219], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$0 * y$46$re + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\\
\mathbf{if}\;y.im \leq -4.4 \cdot 10^{+219}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t_0, y.re, t_1\right)} \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if y.im < -4.4000000000000003e219Initial program 18.8%
Taylor expanded in y.im around 0 25.5%
Taylor expanded in y.re around 0 62.6%
if -4.4000000000000003e219 < y.im Initial program 43.4%
fma-neg43.4%
hypot-def43.4%
distribute-rgt-neg-out43.4%
fma-def43.8%
hypot-def81.0%
*-commutative81.0%
Simplified81.0%
Final simplification79.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0)))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (sin (fma (log (hypot x.re x.im)) y.im t_2)))
(t_4
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))))
(if (<= y.re -2.6e+20)
(* t_2 t_4)
(if (<= y.re 0.00032)
(* t_3 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 2.3e+143)
(* t_3 t_1)
(if (<= y.re 7.5e+180)
(* t_4 (fabs t_2))
(* 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_im * atan2(x_46_im, x_46_re);
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0);
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, 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));
double tmp;
if (y_46_re <= -2.6e+20) {
tmp = t_2 * t_4;
} else if (y_46_re <= 0.00032) {
tmp = t_3 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 2.3e+143) {
tmp = t_3 * t_1;
} else if (y_46_re <= 7.5e+180) {
tmp = t_4 * fabs(t_2);
} 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_im * atan(x_46_im, x_46_re)) t_1 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.0)) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) t_4 = 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 <= -2.6e+20) tmp = Float64(t_2 * t_4); elseif (y_46_re <= 0.00032) tmp = Float64(t_3 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 2.3e+143) tmp = Float64(t_3 * t_1); elseif (y_46_re <= 7.5e+180) tmp = Float64(t_4 * abs(t_2)); 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$im * N[ArcTan[x$46$im / x$46$re], $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[(t$95$0 + 1.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[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = 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, -2.6e+20], N[(t$95$2 * t$95$4), $MachinePrecision], If[LessEqual[y$46$re, 0.00032], N[(t$95$3 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.3e+143], N[(t$95$3 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 7.5e+180], N[(t$95$4 * N[Abs[t$95$2], $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.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_0 + 1}\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_2\right)\right)\\
t_4 := 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 -2.6 \cdot 10^{+20}:\\
\;\;\;\;t_2 \cdot t_4\\
\mathbf{elif}\;y.re \leq 0.00032:\\
\;\;\;\;t_3 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 2.3 \cdot 10^{+143}:\\
\;\;\;\;t_3 \cdot t_1\\
\mathbf{elif}\;y.re \leq 7.5 \cdot 10^{+180}:\\
\;\;\;\;t_4 \cdot \left|t_2\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 < -2.6e20Initial program 42.2%
Taylor expanded in y.im around 0 78.2%
Taylor expanded in y.re around 0 78.2%
if -2.6e20 < y.re < 3.20000000000000026e-4Initial program 43.5%
fma-neg43.5%
hypot-def43.5%
distribute-rgt-neg-out43.5%
fma-def44.3%
hypot-def81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.re around 0 78.7%
neg-mul-178.7%
distribute-lft-neg-in78.7%
Simplified78.7%
if 3.20000000000000026e-4 < y.re < 2.3e143Initial program 48.3%
exp-diff41.4%
exp-to-pow41.4%
hypot-def41.4%
*-commutative41.4%
exp-prod41.4%
fma-def41.4%
hypot-def65.5%
*-commutative65.5%
Simplified65.5%
Taylor expanded in y.im around 0 72.6%
if 2.3e143 < y.re < 7.5000000000000003e180Initial program 33.3%
Taylor expanded in y.im around 0 58.3%
Taylor expanded in y.re around 0 58.3%
*-commutative58.3%
add-sqr-sqrt58.3%
sqrt-unprod83.3%
pow283.3%
*-commutative83.3%
Applied egg-rr83.3%
unpow283.3%
rem-sqrt-square91.7%
Simplified91.7%
if 7.5000000000000003e180 < y.re Initial program 27.3%
exp-diff18.2%
exp-to-pow18.2%
hypot-def18.2%
*-commutative18.2%
exp-prod18.2%
fma-def18.2%
hypot-def45.5%
*-commutative45.5%
Simplified45.5%
Taylor expanded in y.im around 0 63.6%
Taylor expanded in y.im around inf 31.8%
unpow231.8%
unpow231.8%
hypot-def72.7%
Simplified72.7%
Final simplification78.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin (fma (log (hypot x.re x.im)) y.im t_1)))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))))
(if (<= y.re -2.6e+20)
(* t_1 t_3)
(if (<= y.re 7.5e-9)
(* t_2 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 1.2e+148)
(* t_2 (pow (hypot x.im x.re) y.re))
(if (<= y.re 4e+186)
(* t_3 (fabs t_1))
(*
(/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0))
(sin (* y.im (log (hypot x.im x.re)))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1));
double t_3 = 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 <= -2.6e+20) {
tmp = t_1 * t_3;
} else if (y_46_re <= 7.5e-9) {
tmp = t_2 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1.2e+148) {
tmp = t_2 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 4e+186) {
tmp = t_3 * fabs(t_1);
} else {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.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(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) 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_0)) tmp = 0.0 if (y_46_re <= -2.6e+20) tmp = Float64(t_1 * t_3); elseif (y_46_re <= 7.5e-9) tmp = Float64(t_2 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 1.2e+148) tmp = Float64(t_2 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 4e+186) tmp = Float64(t_3 * abs(t_1)); else tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $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[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $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$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.6e+20], N[(t$95$1 * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 7.5e-9], N[(t$95$2 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.2e+148], N[(t$95$2 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4e+186], N[(t$95$3 * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_1\right)\right)\\
t_3 := 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 -2.6 \cdot 10^{+20}:\\
\;\;\;\;t_1 \cdot t_3\\
\mathbf{elif}\;y.re \leq 7.5 \cdot 10^{-9}:\\
\;\;\;\;t_2 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{+148}:\\
\;\;\;\;t_2 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{+186}:\\
\;\;\;\;t_3 \cdot \left|t_1\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_0 + 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 < -2.6e20Initial program 42.2%
Taylor expanded in y.im around 0 78.2%
Taylor expanded in y.re around 0 78.2%
if -2.6e20 < y.re < 7.49999999999999933e-9Initial program 43.5%
fma-neg43.5%
hypot-def43.5%
distribute-rgt-neg-out43.5%
fma-def44.3%
hypot-def81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.re around 0 78.7%
neg-mul-178.7%
distribute-lft-neg-in78.7%
Simplified78.7%
if 7.49999999999999933e-9 < y.re < 1.19999999999999997e148Initial program 48.3%
exp-diff41.4%
exp-to-pow41.4%
hypot-def41.4%
*-commutative41.4%
exp-prod41.4%
fma-def41.4%
hypot-def65.5%
*-commutative65.5%
Simplified65.5%
Taylor expanded in y.im around 0 69.2%
unpow269.2%
unpow269.2%
hypot-def69.2%
Simplified69.2%
if 1.19999999999999997e148 < y.re < 3.99999999999999992e186Initial program 30.8%
Taylor expanded in y.im around 0 53.8%
Taylor expanded in y.re around 0 53.8%
*-commutative53.8%
add-sqr-sqrt53.8%
sqrt-unprod84.6%
pow284.6%
*-commutative84.6%
Applied egg-rr84.6%
unpow284.6%
rem-sqrt-square92.3%
Simplified92.3%
if 3.99999999999999992e186 < y.re Initial program 28.6%
exp-diff19.0%
exp-to-pow19.0%
hypot-def19.0%
*-commutative19.0%
exp-prod19.0%
fma-def19.0%
hypot-def47.6%
*-commutative47.6%
Simplified47.6%
Taylor expanded in y.im around 0 66.7%
Taylor expanded in y.im around inf 33.3%
unpow233.3%
unpow233.3%
hypot-def71.4%
Simplified71.4%
Final simplification77.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.im -2.75e+104)
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.im 2.2e+22)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(pow (hypot x.im x.re) y.re))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
(fabs t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -2.75e+104) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else if (y_46_im <= 2.2e+22) {
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 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * fabs(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -2.75e+104) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); elseif (y_46_im <= 2.2e+22) 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(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * abs(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.75e+104], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.2e+22], 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[(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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[t$95$0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -2.75 \cdot 10^{+104}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\mathbf{elif}\;y.im \leq 2.2 \cdot 10^{+22}:\\
\;\;\;\;\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}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left|t_0\right|\\
\end{array}
\end{array}
if y.im < -2.75000000000000008e104Initial program 28.2%
Taylor expanded in y.im around 0 41.4%
Taylor expanded in y.re around 0 56.9%
if -2.75000000000000008e104 < y.im < 2.2e22Initial program 44.1%
exp-diff41.5%
exp-to-pow41.5%
hypot-def41.5%
*-commutative41.5%
exp-prod41.0%
fma-def41.6%
hypot-def82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in y.im around 0 66.1%
unpow266.1%
unpow266.1%
hypot-def81.9%
Simplified81.9%
if 2.2e22 < y.im Initial program 44.7%
Taylor expanded in y.im around 0 54.9%
Taylor expanded in y.re around 0 54.9%
*-commutative54.9%
add-sqr-sqrt27.7%
sqrt-unprod45.8%
pow245.8%
*-commutative45.8%
Applied egg-rr45.8%
unpow245.8%
rem-sqrt-square56.4%
Simplified56.4%
Final simplification71.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1
(*
(/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0))
(sin (* y.im (log (hypot x.im x.re))))))
(t_2 (* y.re (atan2 x.im x.re))))
(if (<= y.im -1.6e+103)
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.im -3.6e-235)
t_1
(if (<= y.im 4.3e-268)
(* (sin t_2) (pow (hypot x.im x.re) y.re))
(if (<= y.im 5.2e+22)
t_1
(*
t_2
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
t_0)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -1.6e+103) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else if (y_46_im <= -3.6e-235) {
tmp = t_1;
} else if (y_46_im <= 4.3e-268) {
tmp = sin(t_2) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 5.2e+22) {
tmp = t_1;
} else {
tmp = t_2 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_2 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -1.6e+103) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
} else if (y_46_im <= -3.6e-235) {
tmp = t_1;
} else if (y_46_im <= 4.3e-268) {
tmp = Math.sin(t_2) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 5.2e+22) {
tmp = t_1;
} else {
tmp = 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));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_2 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_im <= -1.6e+103: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) elif y_46_im <= -3.6e-235: tmp = t_1 elif y_46_im <= 4.3e-268: tmp = math.sin(t_2) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_im <= 5.2e+22: tmp = t_1 else: tmp = 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)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.0)) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -1.6e+103) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); elseif (y_46_im <= -3.6e-235) tmp = t_1; elseif (y_46_im <= 4.3e-268) tmp = Float64(sin(t_2) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 5.2e+22) tmp = t_1; else tmp = 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))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (t_0 + 1.0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); t_2 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_im <= -1.6e+103) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); elseif (y_46_im <= -3.6e-235) tmp = t_1; elseif (y_46_im <= 4.3e-268) tmp = sin(t_2) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_im <= 5.2e+22) tmp = t_1; else tmp = t_2 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision] * 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$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.6e+103], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -3.6e-235], t$95$1, If[LessEqual[y$46$im, 4.3e-268], N[(N[Sin[t$95$2], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5.2e+22], t$95$1, 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]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_0 + 1} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -1.6 \cdot 10^{+103}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\mathbf{elif}\;y.im \leq -3.6 \cdot 10^{-235}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 4.3 \cdot 10^{-268}:\\
\;\;\;\;\sin t_2 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 5.2 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\
\end{array}
\end{array}
if y.im < -1.59999999999999996e103Initial program 28.2%
Taylor expanded in y.im around 0 41.4%
Taylor expanded in y.re around 0 56.9%
if -1.59999999999999996e103 < y.im < -3.59999999999999999e-235 or 4.3e-268 < y.im < 5.2e22Initial program 42.6%
exp-diff39.4%
exp-to-pow39.4%
hypot-def39.4%
*-commutative39.4%
exp-prod38.8%
fma-def39.6%
hypot-def82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in y.im around 0 80.4%
Taylor expanded in y.im around inf 35.9%
unpow235.9%
unpow235.9%
hypot-def71.2%
Simplified71.2%
if -3.59999999999999999e-235 < y.im < 4.3e-268Initial program 51.9%
Taylor expanded in y.im around 0 75.9%
Taylor expanded in y.im around 0 75.9%
+-commutative75.9%
unpow275.9%
unpow275.9%
hypot-def76.6%
hypot-def75.9%
unpow275.9%
unpow275.9%
+-commutative75.9%
unpow275.9%
unpow275.9%
hypot-def76.6%
Simplified76.6%
if 5.2e22 < y.im Initial program 44.7%
Taylor expanded in y.im around 0 54.9%
Taylor expanded in y.re around 0 54.9%
Final simplification65.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (- x.im)))
(t_2 (* y.im (atan2 x.im x.re))))
(if (<= x.im -1.95e-22)
(* (exp (- (* y.re t_1) t_2)) (sin (+ t_0 (* y.im t_1))))
(if (<= x.im 7e-149)
(*
(/ (pow (hypot x.re x.im) y.re) (+ t_2 1.0))
(sin (* y.im (log (hypot x.im x.re)))))
(if (<= x.im 1e-9)
(*
t_0
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2)))
(*
(sin t_0)
(exp
(-
(* y.re (log (+ x.im (* 0.5 (/ (pow x.re 2.0) x.im)))))
t_2))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(-x_46_im);
double t_2 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -1.95e-22) {
tmp = exp(((y_46_re * t_1) - t_2)) * sin((t_0 + (y_46_im * t_1)));
} else if (x_46_im <= 7e-149) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_2 + 1.0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (x_46_im <= 1e-9) {
tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
} else {
tmp = sin(t_0) * exp(((y_46_re * log((x_46_im + (0.5 * (pow(x_46_re, 2.0) / x_46_im))))) - t_2));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.log(-x_46_im);
double t_2 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -1.95e-22) {
tmp = Math.exp(((y_46_re * t_1) - t_2)) * Math.sin((t_0 + (y_46_im * t_1)));
} else if (x_46_im <= 7e-149) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (t_2 + 1.0)) * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
} else if (x_46_im <= 1e-9) {
tmp = t_0 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
} else {
tmp = Math.sin(t_0) * Math.exp(((y_46_re * Math.log((x_46_im + (0.5 * (Math.pow(x_46_re, 2.0) / x_46_im))))) - t_2));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.log(-x_46_im) t_2 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_im <= -1.95e-22: tmp = math.exp(((y_46_re * t_1) - t_2)) * math.sin((t_0 + (y_46_im * t_1))) elif x_46_im <= 7e-149: tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (t_2 + 1.0)) * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) elif x_46_im <= 1e-9: tmp = t_0 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)) else: tmp = math.sin(t_0) * math.exp(((y_46_re * math.log((x_46_im + (0.5 * (math.pow(x_46_re, 2.0) / x_46_im))))) - t_2)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(Float64(-x_46_im)) t_2 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -1.95e-22) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - t_2)) * sin(Float64(t_0 + Float64(y_46_im * t_1)))); elseif (x_46_im <= 7e-149) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_2 + 1.0)) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (x_46_im <= 1e-9) 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))))) - t_2))); else tmp = Float64(sin(t_0) * exp(Float64(Float64(y_46_re * log(Float64(x_46_im + Float64(0.5 * Float64((x_46_re ^ 2.0) / x_46_im))))) - t_2))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = log(-x_46_im); t_2 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_im <= -1.95e-22) tmp = exp(((y_46_re * t_1) - t_2)) * sin((t_0 + (y_46_im * t_1))); elseif (x_46_im <= 7e-149) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (t_2 + 1.0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); elseif (x_46_im <= 1e-9) tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)); else tmp = sin(t_0) * exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re ^ 2.0) / x_46_im))))) - t_2)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[(-x$46$im)], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -1.95e-22], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 + N[(y$46$im * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 7e-149], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$2 + 1.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], If[LessEqual[x$46$im, 1e-9], 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] - t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$0], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[N[(x$46$im + N[(0.5 * N[(N[Power[x$46$re, 2.0], $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(-x.im\right)\\
t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -1.95 \cdot 10^{-22}:\\
\;\;\;\;e^{y.re \cdot t_1 - t_2} \cdot \sin \left(t_0 + y.im \cdot t_1\right)\\
\mathbf{elif}\;x.im \leq 7 \cdot 10^{-149}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_2 + 1} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;x.im \leq 10^{-9}:\\
\;\;\;\;t_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_2}\\
\mathbf{else}:\\
\;\;\;\;\sin t_0 \cdot e^{y.re \cdot \log \left(x.im + 0.5 \cdot \frac{{x.re}^{2}}{x.im}\right) - t_2}\\
\end{array}
\end{array}
if x.im < -1.94999999999999999e-22Initial program 32.7%
Taylor expanded in x.im around -inf 58.7%
mul-1-neg58.7%
Simplified58.7%
Taylor expanded in x.im around -inf 81.7%
mul-1-neg58.7%
Simplified81.7%
if -1.94999999999999999e-22 < x.im < 7e-149Initial program 43.2%
exp-diff38.6%
exp-to-pow38.6%
hypot-def38.6%
*-commutative38.6%
exp-prod37.6%
fma-def37.6%
hypot-def66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in y.im around 0 63.4%
Taylor expanded in y.im around inf 32.2%
unpow232.2%
unpow232.2%
hypot-def61.3%
Simplified61.3%
if 7e-149 < x.im < 1.00000000000000006e-9Initial program 57.9%
Taylor expanded in y.im around 0 63.1%
Taylor expanded in y.re around 0 74.5%
if 1.00000000000000006e-9 < x.im Initial program 40.2%
Taylor expanded in y.im around 0 49.7%
Taylor expanded in x.re around 0 56.4%
Final simplification66.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (- x.im)))
(t_2 (* y.im (atan2 x.im x.re))))
(if (<= x.im -2.56e-23)
(* (exp (- (* y.re t_1) t_2)) (sin (+ t_0 (* y.im t_1))))
(if (<= x.im 1.55e-147)
(*
(/ (pow (hypot x.re x.im) y.re) (+ t_2 1.0))
(sin (* y.im (log (hypot x.im x.re)))))
(*
t_0
(exp
(- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(-x_46_im);
double t_2 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -2.56e-23) {
tmp = exp(((y_46_re * t_1) - t_2)) * sin((t_0 + (y_46_im * t_1)));
} else if (x_46_im <= 1.55e-147) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_2 + 1.0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.log(-x_46_im);
double t_2 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -2.56e-23) {
tmp = Math.exp(((y_46_re * t_1) - t_2)) * Math.sin((t_0 + (y_46_im * t_1)));
} else if (x_46_im <= 1.55e-147) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (t_2 + 1.0)) * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
} else {
tmp = t_0 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.log(-x_46_im) t_2 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_im <= -2.56e-23: tmp = math.exp(((y_46_re * t_1) - t_2)) * math.sin((t_0 + (y_46_im * t_1))) elif x_46_im <= 1.55e-147: tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (t_2 + 1.0)) * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) else: tmp = t_0 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(Float64(-x_46_im)) t_2 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -2.56e-23) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - t_2)) * sin(Float64(t_0 + Float64(y_46_im * t_1)))); elseif (x_46_im <= 1.55e-147) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_2 + 1.0)) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else 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))))) - t_2))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = log(-x_46_im); t_2 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_im <= -2.56e-23) tmp = exp(((y_46_re * t_1) - t_2)) * sin((t_0 + (y_46_im * t_1))); elseif (x_46_im <= 1.55e-147) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (t_2 + 1.0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); else tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[(-x$46$im)], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -2.56e-23], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 + N[(y$46$im * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.55e-147], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$2 + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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] - t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(-x.im\right)\\
t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -2.56 \cdot 10^{-23}:\\
\;\;\;\;e^{y.re \cdot t_1 - t_2} \cdot \sin \left(t_0 + y.im \cdot t_1\right)\\
\mathbf{elif}\;x.im \leq 1.55 \cdot 10^{-147}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_2 + 1} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_2}\\
\end{array}
\end{array}
if x.im < -2.5600000000000001e-23Initial program 32.7%
Taylor expanded in x.im around -inf 58.7%
mul-1-neg58.7%
Simplified58.7%
Taylor expanded in x.im around -inf 81.7%
mul-1-neg58.7%
Simplified81.7%
if -2.5600000000000001e-23 < x.im < 1.5500000000000001e-147Initial program 43.2%
exp-diff38.6%
exp-to-pow38.6%
hypot-def38.6%
*-commutative38.6%
exp-prod37.6%
fma-def37.6%
hypot-def66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in y.im around 0 63.4%
Taylor expanded in y.im around inf 32.2%
unpow232.2%
unpow232.2%
hypot-def61.3%
Simplified61.3%
if 1.5500000000000001e-147 < x.im Initial program 46.0%
Taylor expanded in y.im around 0 54.1%
Taylor expanded in y.re around 0 57.8%
Final simplification64.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.re -9.2e-138)
(* t_1 (exp (- (* y.re (log (- x.re))) t_0)))
(if (<= x.re 1.75e-182)
(* y.re (* (atan2 x.im x.re) (pow (hypot x.im x.re) y.re)))
(if (<= x.re 7000.0)
(* t_1 (exp (- (* y.re (log x.re)) t_0)))
(if (or (<= x.re 3.4e+87) (not (<= x.re 1.05e+99)))
(*
(/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0))
(sin (* y.im (log x.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_im * atan2(x_46_im, x_46_re);
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -9.2e-138) {
tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0));
} else if (x_46_re <= 1.75e-182) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(hypot(x_46_im, x_46_re), y_46_re));
} else if (x_46_re <= 7000.0) {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
} else if ((x_46_re <= 3.4e+87) || !(x_46_re <= 1.05e+99)) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * sin((y_46_im * log(x_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;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -9.2e-138) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else if (x_46_re <= 1.75e-182) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re));
} else if (x_46_re <= 7000.0) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
} else if ((x_46_re <= 3.4e+87) || !(x_46_re <= 1.05e+99)) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * Math.sin((y_46_im * Math.log(x_46_re)));
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= -9.2e-138: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) elif x_46_re <= 1.75e-182: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)) elif x_46_re <= 7000.0: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) elif (x_46_re <= 3.4e+87) or not (x_46_re <= 1.05e+99): tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * math.sin((y_46_im * math.log(x_46_re))) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -9.2e-138) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); elseif (x_46_re <= 1.75e-182) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (hypot(x_46_im, x_46_re) ^ y_46_re))); elseif (x_46_re <= 7000.0) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); elseif ((x_46_re <= 3.4e+87) || !(x_46_re <= 1.05e+99)) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.0)) * sin(Float64(y_46_im * log(x_46_re)))); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= -9.2e-138) tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0)); elseif (x_46_re <= 1.75e-182) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (x_46_re <= 7000.0) tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0)); elseif ((x_46_re <= 3.4e+87) || ~((x_46_re <= 1.05e+99))) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (t_0 + 1.0)) * sin((y_46_im * log(x_46_re))); else tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -9.2e-138], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.75e-182], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 7000.0], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$re, 3.4e+87], N[Not[LessEqual[x$46$re, 1.05e+99]], $MachinePrecision]], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $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.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -9.2 \cdot 10^{-138}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\
\mathbf{elif}\;x.re \leq 1.75 \cdot 10^{-182}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\
\mathbf{elif}\;x.re \leq 7000:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.re - t_0}\\
\mathbf{elif}\;x.re \leq 3.4 \cdot 10^{+87} \lor \neg \left(x.re \leq 1.05 \cdot 10^{+99}\right):\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_0 + 1} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if x.re < -9.1999999999999996e-138Initial program 44.7%
Taylor expanded in y.im around 0 57.9%
Taylor expanded in x.re around -inf 59.1%
mul-1-neg59.1%
Simplified59.1%
if -9.1999999999999996e-138 < x.re < 1.74999999999999992e-182Initial program 50.8%
Taylor expanded in y.im around 0 51.8%
Taylor expanded in y.re around 0 59.4%
Taylor expanded in y.im around 0 54.0%
unpow254.0%
unpow254.0%
hypot-def55.8%
Simplified55.8%
if 1.74999999999999992e-182 < x.re < 7e3Initial program 58.1%
Taylor expanded in y.im around 0 67.1%
Taylor expanded in x.im around 0 63.5%
*-commutative63.5%
Simplified63.5%
if 7e3 < x.re < 3.4000000000000002e87 or 1.05000000000000005e99 < x.re Initial program 24.6%
exp-diff19.0%
exp-to-pow19.0%
hypot-def19.0%
*-commutative19.0%
exp-prod18.4%
fma-def18.4%
hypot-def62.6%
*-commutative62.6%
Simplified62.6%
Taylor expanded in y.im around 0 67.6%
Taylor expanded in x.im around 0 63.8%
Taylor expanded in y.re around 0 59.6%
if 3.4000000000000002e87 < x.re < 1.05000000000000005e99Initial program 19.7%
Taylor expanded in y.im around 0 35.2%
Taylor expanded in y.re around 0 84.1%
Final simplification59.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1)))
(if (<= x.re -1.35e-93)
(* t_2 (exp (- (* y.re (log (- x.re))) t_0)))
(if (<= x.re 2600.0)
(*
t_1
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))
(if (or (<= x.re 1.15e+77) (not (<= x.re 7.8e+155)))
(*
(/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0))
(sin (* y.im (log x.re))))
(* t_2 (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 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double tmp;
if (x_46_re <= -1.35e-93) {
tmp = t_2 * exp(((y_46_re * log(-x_46_re)) - t_0));
} else if (x_46_re <= 2600.0) {
tmp = t_1 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
} else if ((x_46_re <= 1.15e+77) || !(x_46_re <= 7.8e+155)) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * sin((y_46_im * log(x_46_re)));
} else {
tmp = t_2 * exp(((y_46_re * log(x_46_re)) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double tmp;
if (x_46_re <= -1.35e-93) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else if (x_46_re <= 2600.0) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
} else if ((x_46_re <= 1.15e+77) || !(x_46_re <= 7.8e+155)) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * Math.sin((y_46_im * Math.log(x_46_re)));
} else {
tmp = t_2 * 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 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) tmp = 0 if x_46_re <= -1.35e-93: tmp = t_2 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) elif x_46_re <= 2600.0: tmp = t_1 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) elif (x_46_re <= 1.15e+77) or not (x_46_re <= 7.8e+155): tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * math.sin((y_46_im * math.log(x_46_re))) else: tmp = t_2 * 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(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) tmp = 0.0 if (x_46_re <= -1.35e-93) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); elseif (x_46_re <= 2600.0) tmp = Float64(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))))) - t_0))); elseif ((x_46_re <= 1.15e+77) || !(x_46_re <= 7.8e+155)) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.0)) * sin(Float64(y_46_im * log(x_46_re)))); else tmp = Float64(t_2 * 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 = y_46_im * atan2(x_46_im, x_46_re); t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); tmp = 0.0; if (x_46_re <= -1.35e-93) tmp = t_2 * exp(((y_46_re * log(-x_46_re)) - t_0)); elseif (x_46_re <= 2600.0) tmp = t_1 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)); elseif ((x_46_re <= 1.15e+77) || ~((x_46_re <= 7.8e+155))) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (t_0 + 1.0)) * sin((y_46_im * log(x_46_re))); else tmp = t_2 * 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $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[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[x$46$re, -1.35e-93], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2600.0], N[(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] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$re, 1.15e+77], N[Not[LessEqual[x$46$re, 7.8e+155]], $MachinePrecision]], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * 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 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t_1\\
\mathbf{if}\;x.re \leq -1.35 \cdot 10^{-93}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\
\mathbf{elif}\;x.re \leq 2600:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\
\mathbf{elif}\;x.re \leq 1.15 \cdot 10^{+77} \lor \neg \left(x.re \leq 7.8 \cdot 10^{+155}\right):\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_0 + 1} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log x.re - t_0}\\
\end{array}
\end{array}
if x.re < -1.3500000000000001e-93Initial program 42.7%
Taylor expanded in y.im around 0 58.7%
Taylor expanded in x.re around -inf 62.5%
mul-1-neg62.5%
Simplified62.5%
if -1.3500000000000001e-93 < x.re < 2600Initial program 54.5%
Taylor expanded in y.im around 0 57.7%
Taylor expanded in y.re around 0 59.6%
if 2600 < x.re < 1.14999999999999997e77 or 7.7999999999999996e155 < x.re Initial program 18.6%
exp-diff15.3%
exp-to-pow15.3%
hypot-def15.3%
*-commutative15.3%
exp-prod15.3%
fma-def15.3%
hypot-def63.4%
*-commutative63.4%
Simplified63.4%
Taylor expanded in y.im around 0 67.0%
Taylor expanded in x.im around 0 64.1%
Taylor expanded in y.re around 0 62.3%
if 1.14999999999999997e77 < x.re < 7.7999999999999996e155Initial program 42.6%
Taylor expanded in y.im around 0 46.0%
Taylor expanded in x.im around 0 56.6%
*-commutative56.6%
Simplified56.6%
Final simplification60.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -4.8e-22) (not (<= y.re 0.00019))) (* (sin (* y.re (atan2 x.im x.re))) (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 tmp;
if ((y_46_re <= -4.8e-22) || !(y_46_re <= 0.00019)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.8e-22) || !(y_46_re <= 0.00019)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -4.8e-22) or not (y_46_re <= 0.00019): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -4.8e-22) || !(y_46_re <= 0.00019)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -4.8e-22) || ~((y_46_re <= 0.00019))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (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))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -4.8e-22], N[Not[LessEqual[y$46$re, 0.00019]], $MachinePrecision]], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -4.8 \cdot 10^{-22} \lor \neg \left(y.re \leq 0.00019\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.re < -4.80000000000000005e-22 or 1.9000000000000001e-4 < y.re Initial program 37.9%
Taylor expanded in y.im around 0 64.5%
Taylor expanded in y.im around 0 61.8%
+-commutative61.8%
unpow261.8%
unpow261.8%
hypot-def63.2%
hypot-def61.8%
unpow261.8%
unpow261.8%
+-commutative61.8%
unpow261.8%
unpow261.8%
hypot-def63.2%
Simplified63.2%
if -4.80000000000000005e-22 < y.re < 1.9000000000000001e-4Initial program 46.9%
Taylor expanded in y.im around 0 32.4%
Taylor expanded in y.re around 0 42.7%
Final simplification54.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -4.8e-22) (not (<= y.re 1.55e+36))) (* y.re (* (atan2 x.im x.re) (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 tmp;
if ((y_46_re <= -4.8e-22) || !(y_46_re <= 1.55e+36)) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * 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;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.8e-22) || !(y_46_re <= 1.55e+36)) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re));
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -4.8e-22) or not (y_46_re <= 1.55e+36): tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -4.8e-22) || !(y_46_re <= 1.55e+36)) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (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
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -4.8e-22) || ~((y_46_re <= 1.55e+36))) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (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))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -4.8e-22], N[Not[LessEqual[y$46$re, 1.55e+36]], $MachinePrecision]], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $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}
\mathbf{if}\;y.re \leq -4.8 \cdot 10^{-22} \lor \neg \left(y.re \leq 1.55 \cdot 10^{+36}\right):\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.re < -4.80000000000000005e-22 or 1.55e36 < y.re Initial program 36.4%
Taylor expanded in y.im around 0 63.9%
Taylor expanded in y.re around 0 63.1%
Taylor expanded in y.im around 0 62.4%
unpow262.4%
unpow262.4%
hypot-def64.0%
Simplified64.0%
if -4.80000000000000005e-22 < y.re < 1.55e36Initial program 47.9%
Taylor expanded in y.im around 0 35.2%
Taylor expanded in y.re around 0 42.4%
Final simplification53.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.45e-126) (not (<= y.re 2.9e-112))) (* y.re (* (atan2 x.im x.re) (pow (hypot x.im x.re) y.re))) (cbrt (pow (* y.re (atan2 x.im x.re)) 3.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.45e-126) || !(y_46_re <= 2.9e-112)) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(hypot(x_46_im, x_46_re), y_46_re));
} else {
tmp = cbrt(pow((y_46_re * atan2(x_46_im, x_46_re)), 3.0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.45e-126) || !(y_46_re <= 2.9e-112)) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re));
} else {
tmp = Math.cbrt(Math.pow((y_46_re * Math.atan2(x_46_im, x_46_re)), 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.45e-126) || !(y_46_re <= 2.9e-112)) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (hypot(x_46_im, x_46_re) ^ y_46_re))); else tmp = cbrt((Float64(y_46_re * atan(x_46_im, x_46_re)) ^ 3.0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.45e-126], N[Not[LessEqual[y$46$re, 2.9e-112]], $MachinePrecision]], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.45 \cdot 10^{-126} \lor \neg \left(y.re \leq 2.9 \cdot 10^{-112}\right):\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{3}}\\
\end{array}
\end{array}
if y.re < -1.44999999999999994e-126 or 2.89999999999999992e-112 < y.re Initial program 39.7%
Taylor expanded in y.im around 0 58.6%
Taylor expanded in y.re around 0 57.5%
Taylor expanded in y.im around 0 52.1%
unpow252.1%
unpow252.1%
hypot-def55.1%
Simplified55.1%
if -1.44999999999999994e-126 < y.re < 2.89999999999999992e-112Initial program 47.0%
Taylor expanded in y.im around 0 30.8%
Taylor expanded in y.re around 0 36.5%
Taylor expanded in y.im around 0 9.1%
*-commutative9.1%
add-cbrt-cube21.3%
pow321.3%
*-commutative21.3%
Applied egg-rr21.3%
Final simplification45.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (expm1 (* y.re (atan2 x.im x.re)))))
(if (or (<= y.im -2e+21) (not (<= y.im 8.2e-7)))
(log (+ 1.0 t_0))
(log1p t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = expm1((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -2e+21) || !(y_46_im <= 8.2e-7)) {
tmp = log((1.0 + t_0));
} else {
tmp = log1p(t_0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.expm1((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -2e+21) || !(y_46_im <= 8.2e-7)) {
tmp = Math.log((1.0 + t_0));
} else {
tmp = Math.log1p(t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.expm1((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_im <= -2e+21) or not (y_46_im <= 8.2e-7): tmp = math.log((1.0 + t_0)) else: tmp = math.log1p(t_0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = expm1(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_im <= -2e+21) || !(y_46_im <= 8.2e-7)) tmp = log(Float64(1.0 + t_0)); else tmp = log1p(t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -2e+21], N[Not[LessEqual[y$46$im, 8.2e-7]], $MachinePrecision]], N[Log[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision], N[Log[1 + t$95$0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{+21} \lor \neg \left(y.im \leq 8.2 \cdot 10^{-7}\right):\\
\;\;\;\;\log \left(1 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(t_0\right)\\
\end{array}
\end{array}
if y.im < -2e21 or 8.1999999999999998e-7 < y.im Initial program 38.4%
Taylor expanded in y.im around 0 52.0%
Taylor expanded in y.re around 0 49.0%
Taylor expanded in y.im around 0 4.4%
*-commutative4.4%
log1p-expm1-u14.9%
log1p-udef30.1%
*-commutative30.1%
Applied egg-rr30.1%
if -2e21 < y.im < 8.1999999999999998e-7Initial program 45.0%
Taylor expanded in y.im around 0 48.8%
Taylor expanded in y.re around 0 18.3%
Taylor expanded in y.im around 0 16.9%
log1p-expm1-u26.8%
Applied egg-rr26.8%
Final simplification28.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* y.re (atan2 x.im x.re)))) (if (<= y.im 2.2e+166) (log1p (expm1 t_0)) (cbrt (pow t_0 3.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= 2.2e+166) {
tmp = log1p(expm1(t_0));
} else {
tmp = cbrt(pow(t_0, 3.0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= 2.2e+166) {
tmp = Math.log1p(Math.expm1(t_0));
} else {
tmp = Math.cbrt(Math.pow(t_0, 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= 2.2e+166) tmp = log1p(expm1(t_0)); else tmp = cbrt((t_0 ^ 3.0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, 2.2e+166], N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq 2.2 \cdot 10^{+166}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{t_0}^{3}}\\
\end{array}
\end{array}
if y.im < 2.1999999999999999e166Initial program 41.0%
Taylor expanded in y.im around 0 50.3%
Taylor expanded in y.re around 0 31.0%
Taylor expanded in y.im around 0 12.1%
log1p-expm1-u23.4%
Applied egg-rr23.4%
if 2.1999999999999999e166 < y.im Initial program 47.1%
Taylor expanded in y.im around 0 50.3%
Taylor expanded in y.re around 0 47.5%
Taylor expanded in y.im around 0 2.7%
*-commutative2.7%
add-cbrt-cube21.9%
pow321.9%
*-commutative21.9%
Applied egg-rr21.9%
Final simplification23.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (log1p (expm1 (* y.re (atan2 x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return log1p(expm1((y_46_re * atan2(x_46_im, x_46_re))));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.log1p(Math.expm1((y_46_re * Math.atan2(x_46_im, x_46_re))));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.log1p(math.expm1((y_46_re * math.atan2(x_46_im, x_46_re))))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return log1p(expm1(Float64(y_46_re * atan(x_46_im, x_46_re)))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Log[1 + N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{log1p}\left(\mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
Initial program 41.8%
Taylor expanded in y.im around 0 50.3%
Taylor expanded in y.re around 0 33.2%
Taylor expanded in y.im around 0 10.8%
log1p-expm1-u21.0%
Applied egg-rr21.0%
Final simplification21.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (atan2 x.im x.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * atan2(x_46_im, x_46_re);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = y_46re * atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * Math.atan2(x_46_im, x_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * math.atan2(x_46_im, x_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 41.8%
Taylor expanded in y.im around 0 50.3%
Taylor expanded in y.re around 0 33.2%
Taylor expanded in y.im around 0 10.8%
Final simplification10.8%
herbie shell --seed 2024020
(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)))))