
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (fma t_0 y.re (* y.im (- (atan2 x.im x.re)))))))
(if (<= y.im 3e-84)
(* t_1 (sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(*
t_1
(sin
(pow (cbrt (pow (cbrt (* y.im (log (hypot x.im x.re)))) 3.0)) 3.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(fma(t_0, y_46_re, (y_46_im * -atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= 3e-84) {
tmp = t_1 * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = t_1 * sin(pow(cbrt(pow(cbrt((y_46_im * log(hypot(x_46_im, x_46_re)))), 3.0)), 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(fma(t_0, y_46_re, Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_im <= 3e-84) tmp = Float64(t_1 * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(t_1 * sin((cbrt((cbrt(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) ^ 3.0)) ^ 3.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(t$95$0 * y$46$re + N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, 3e-84], N[(t$95$1 * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[Power[N[Power[N[Power[N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{\mathsf{fma}\left(t\_0, y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)}\\
\mathbf{if}\;y.im \leq 3 \cdot 10^{-84}:\\
\;\;\;\;t\_1 \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left({\left(\sqrt[3]{{\left(\sqrt[3]{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.im < 3.0000000000000001e-84Initial program 36.1%
cancel-sign-sub-inv36.1%
fma-define36.1%
hypot-define36.1%
distribute-lft-neg-in36.1%
distribute-rgt-neg-out36.1%
fma-define36.1%
hypot-define83.8%
*-commutative83.8%
Simplified83.8%
if 3.0000000000000001e-84 < y.im Initial program 38.4%
cancel-sign-sub-inv38.4%
fma-define38.4%
hypot-define38.4%
distribute-lft-neg-in38.4%
distribute-rgt-neg-out38.4%
fma-define38.4%
hypot-define68.8%
*-commutative68.8%
Simplified68.8%
fma-undefine68.8%
hypot-define38.4%
*-commutative38.4%
add-cube-cbrt40.9%
pow343.5%
fma-define43.5%
hypot-define76.4%
Applied egg-rr76.4%
Taylor expanded in y.im around inf 44.8%
unpow244.8%
unpow244.8%
hypot-undefine79.0%
Simplified79.0%
rem-cube-cbrt84.9%
Applied egg-rr84.9%
Final simplification84.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (log (hypot x.im x.re))))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (fma t_1 y.re (* y.im (- (atan2 x.im x.re)))))))
(if (<= y.im -6e-27)
(* t_2 (sin t_0))
(if (<= y.im 1.55e-92)
(*
(sin (fma t_1 y.im (* y.re (atan2 x.im x.re))))
(pow (hypot x.re x.im) y.re))
(* t_2 (sin (pow (cbrt 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_im * log(hypot(x_46_im, x_46_re));
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(fma(t_1, y_46_re, (y_46_im * -atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -6e-27) {
tmp = t_2 * sin(t_0);
} else if (y_46_im <= 1.55e-92) {
tmp = sin(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = t_2 * sin(pow(cbrt(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_im * log(hypot(x_46_im, x_46_re))) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = exp(fma(t_1, y_46_re, Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_im <= -6e-27) tmp = Float64(t_2 * sin(t_0)); elseif (y_46_im <= 1.55e-92) tmp = Float64(sin(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64(t_2 * sin((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$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(t$95$1 * y$46$re + N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -6e-27], N[(t$95$2 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.55e-92], N[(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] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{\mathsf{fma}\left(t\_1, y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)}\\
\mathbf{if}\;y.im \leq -6 \cdot 10^{-27}:\\
\;\;\;\;t\_2 \cdot \sin t\_0\\
\mathbf{elif}\;y.im \leq 1.55 \cdot 10^{-92}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sin \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.im < -6.0000000000000002e-27Initial program 27.9%
cancel-sign-sub-inv27.9%
fma-define27.9%
hypot-define27.9%
distribute-lft-neg-in27.9%
distribute-rgt-neg-out27.9%
fma-define27.9%
hypot-define70.3%
*-commutative70.3%
Simplified70.3%
Taylor expanded in y.im around inf 26.3%
unpow219.8%
unpow219.8%
hypot-undefine59.2%
Simplified73.3%
if -6.0000000000000002e-27 < y.im < 1.55e-92Initial program 40.9%
exp-diff40.9%
exp-to-pow40.9%
hypot-define40.9%
*-commutative40.9%
exp-prod40.9%
fma-define40.9%
hypot-define91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in y.im around 0 91.8%
if 1.55e-92 < y.im Initial program 38.4%
cancel-sign-sub-inv38.4%
fma-define38.4%
hypot-define38.4%
distribute-lft-neg-in38.4%
distribute-rgt-neg-out38.4%
fma-define38.4%
hypot-define68.8%
*-commutative68.8%
Simplified68.8%
fma-undefine68.8%
hypot-define38.4%
*-commutative38.4%
add-cube-cbrt40.9%
pow343.5%
fma-define43.5%
hypot-define76.4%
Applied egg-rr76.4%
Taylor expanded in y.im around inf 44.8%
unpow244.8%
unpow244.8%
hypot-undefine79.0%
Simplified79.0%
Final simplification83.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (fma t_0 y.re (* y.im (- (atan2 x.im x.re)))))))
(if (<= y.im 2.7e-85)
(* t_1 (sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(* t_1 (sin (pow (cbrt (* y.im (log (hypot 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 t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(fma(t_0, y_46_re, (y_46_im * -atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= 2.7e-85) {
tmp = t_1 * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = t_1 * sin(pow(cbrt((y_46_im * log(hypot(x_46_im, x_46_re)))), 3.0));
}
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 = exp(fma(t_0, y_46_re, Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_im <= 2.7e-85) tmp = Float64(t_1 * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(t_1 * sin((cbrt(Float64(y_46_im * log(hypot(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_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(t$95$0 * y$46$re + N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, 2.7e-85], N[(t$95$1 * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[Power[N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{\mathsf{fma}\left(t\_0, y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)}\\
\mathbf{if}\;y.im \leq 2.7 \cdot 10^{-85}:\\
\;\;\;\;t\_1 \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left({\left(\sqrt[3]{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.im < 2.7000000000000001e-85Initial program 36.1%
cancel-sign-sub-inv36.1%
fma-define36.1%
hypot-define36.1%
distribute-lft-neg-in36.1%
distribute-rgt-neg-out36.1%
fma-define36.1%
hypot-define83.8%
*-commutative83.8%
Simplified83.8%
if 2.7000000000000001e-85 < y.im Initial program 38.4%
cancel-sign-sub-inv38.4%
fma-define38.4%
hypot-define38.4%
distribute-lft-neg-in38.4%
distribute-rgt-neg-out38.4%
fma-define38.4%
hypot-define68.8%
*-commutative68.8%
Simplified68.8%
fma-undefine68.8%
hypot-define38.4%
*-commutative38.4%
add-cube-cbrt40.9%
pow343.5%
fma-define43.5%
hypot-define76.4%
Applied egg-rr76.4%
Taylor expanded in y.im around inf 44.8%
unpow244.8%
unpow244.8%
hypot-undefine79.0%
Simplified79.0%
Final simplification82.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (pow (hypot x.re x.im) y.re))
(t_2 (* y.im (log (hypot x.im x.re))))
(t_3
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))))
(if (<= y.im -1.4e+57)
(* t_2 t_3)
(if (<= y.im 7.8e-103)
(* (sin (fma (log (hypot x.re x.im)) y.im t_0)) t_1)
(if (<= y.im 4.4e+82)
(* (sin t_2) (/ t_1 (pow (exp y.im) (atan2 x.im x.re))))
(* t_3 (sin t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_2 = y_46_im * log(hypot(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))))) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.4e+57) {
tmp = t_2 * t_3;
} else if (y_46_im <= 7.8e-103) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * t_1;
} else if (y_46_im <= 4.4e+82) {
tmp = sin(t_2) * (t_1 / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = t_3 * sin(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = hypot(x_46_re, x_46_im) ^ y_46_re t_2 = Float64(y_46_im * log(hypot(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))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -1.4e+57) tmp = Float64(t_2 * t_3); elseif (y_46_im <= 7.8e-103) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * t_1); elseif (y_46_im <= 4.4e+82) tmp = Float64(sin(t_2) * Float64(t_1 / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); else tmp = Float64(t_3 * sin(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $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] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.4e+57], N[(t$95$2 * t$95$3), $MachinePrecision], If[LessEqual[y$46$im, 7.8e-103], 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] * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 4.4e+82], N[(N[Sin[t$95$2], $MachinePrecision] * N[(t$95$1 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_2 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_3 := 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}}\\
\mathbf{if}\;y.im \leq -1.4 \cdot 10^{+57}:\\
\;\;\;\;t\_2 \cdot t\_3\\
\mathbf{elif}\;y.im \leq 7.8 \cdot 10^{-103}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot t\_1\\
\mathbf{elif}\;y.im \leq 4.4 \cdot 10^{+82}:\\
\;\;\;\;\sin t\_2 \cdot \frac{t\_1}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \sin t\_0\\
\end{array}
\end{array}
if y.im < -1.4e57Initial program 23.4%
Taylor expanded in y.re around 0 21.3%
unpow221.3%
unpow221.3%
hypot-undefine57.9%
Simplified57.9%
Taylor expanded in y.im around 0 38.5%
unpow238.5%
unpow238.5%
hypot-undefine62.2%
Simplified62.2%
if -1.4e57 < y.im < 7.8000000000000004e-103Initial program 40.4%
exp-diff38.9%
exp-to-pow38.9%
hypot-define38.9%
*-commutative38.9%
exp-prod37.9%
fma-define37.9%
hypot-define85.7%
*-commutative85.7%
Simplified85.7%
Taylor expanded in y.im around 0 86.5%
if 7.8000000000000004e-103 < y.im < 4.4000000000000002e82Initial program 34.4%
exp-diff31.0%
exp-to-pow31.0%
hypot-define31.0%
*-commutative31.0%
exp-prod31.0%
fma-define31.0%
hypot-define68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in y.im around inf 41.3%
unpow241.3%
unpow241.3%
hypot-undefine82.5%
Simplified82.5%
if 4.4000000000000002e82 < y.im Initial program 41.2%
Taylor expanded in y.im around 0 71.0%
Final simplification78.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (or (<= y.im -2.15e-27) (not (<= y.im 8e-103)))
(*
(exp (fma t_0 y.re (* y.im (- (atan2 x.im x.re)))))
(sin (* y.im (log (hypot x.im x.re)))))
(*
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(pow (hypot x.re x.im) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((y_46_im <= -2.15e-27) || !(y_46_im <= 8e-103)) {
tmp = exp(fma(t_0, y_46_re, (y_46_im * -atan2(x_46_im, x_46_re)))) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if ((y_46_im <= -2.15e-27) || !(y_46_im <= 8e-103)) tmp = Float64(exp(fma(t_0, y_46_re, Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * (hypot(x_46_re, x_46_im) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -2.15e-27], N[Not[LessEqual[y$46$im, 8e-103]], $MachinePrecision]], N[(N[Exp[N[(t$95$0 * y$46$re + N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $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], N[(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] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -2.15 \cdot 10^{-27} \lor \neg \left(y.im \leq 8 \cdot 10^{-103}\right):\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -2.15000000000000001e-27 or 7.99999999999999966e-103 < y.im Initial program 33.8%
cancel-sign-sub-inv33.8%
fma-define33.8%
hypot-define33.8%
distribute-lft-neg-in33.8%
distribute-rgt-neg-out33.8%
fma-define33.8%
hypot-define69.9%
*-commutative69.9%
Simplified69.9%
Taylor expanded in y.im around inf 35.9%
unpow228.1%
unpow228.1%
hypot-undefine61.9%
Simplified74.7%
if -2.15000000000000001e-27 < y.im < 7.99999999999999966e-103Initial program 40.7%
exp-diff40.7%
exp-to-pow40.7%
hypot-define40.7%
*-commutative40.7%
exp-prod40.7%
fma-define40.7%
hypot-define91.6%
*-commutative91.6%
Simplified91.6%
Taylor expanded in y.im around 0 91.6%
Final simplification82.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (log (hypot x.im x.re))))
(t_1
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))))
(if (<= y.im -1.05e+59)
(* t_0 t_1)
(if (<= y.im 1.26e-26)
(*
(sin (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(pow (hypot x.re x.im) y.re))
(* t_1 (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_im * log(hypot(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))))) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.05e+59) {
tmp = t_0 * t_1;
} else if (y_46_im <= 1.26e-26) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = t_1 * fabs(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * log(hypot(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(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -1.05e+59) tmp = Float64(t_0 * t_1); elseif (y_46_im <= 1.26e-26) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64(t_1 * 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$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.05e+59], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 1.26e-26], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Abs[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := 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}}\\
\mathbf{if}\;y.im \leq -1.05 \cdot 10^{+59}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.im \leq 1.26 \cdot 10^{-26}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left|t\_0\right|\\
\end{array}
\end{array}
if y.im < -1.04999999999999992e59Initial program 23.4%
Taylor expanded in y.re around 0 21.3%
unpow221.3%
unpow221.3%
hypot-undefine57.9%
Simplified57.9%
Taylor expanded in y.im around 0 38.5%
unpow238.5%
unpow238.5%
hypot-undefine62.2%
Simplified62.2%
if -1.04999999999999992e59 < y.im < 1.26000000000000002e-26Initial program 40.5%
exp-diff39.1%
exp-to-pow39.1%
hypot-define39.1%
*-commutative39.1%
exp-prod38.2%
fma-define38.2%
hypot-define86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in y.im around 0 86.9%
if 1.26000000000000002e-26 < y.im Initial program 38.2%
Taylor expanded in y.re around 0 42.6%
unpow242.6%
unpow242.6%
hypot-undefine62.2%
Simplified62.2%
Taylor expanded in y.im around 0 45.7%
unpow245.7%
unpow245.7%
hypot-undefine60.7%
Simplified60.7%
add-sqr-sqrt46.0%
sqrt-unprod45.9%
pow245.9%
Applied egg-rr45.9%
unpow245.9%
rem-sqrt-square65.2%
Simplified65.2%
Final simplification76.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(* y.im (log (hypot x.im x.re)))
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))))
(if (<= y.im -1.4e+57)
t_0
(if (<= y.im 1.26e-26)
(*
(sin (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(pow (hypot x.re x.im) y.re))
(if (<= y.im 8.8e+116)
t_0
(*
y.re
(* (atan2 x.im x.re) (pow (exp (- y.im)) (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_im * log(hypot(x_46_im, x_46_re))) * 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))));
double tmp;
if (y_46_im <= -1.4e+57) {
tmp = t_0;
} else if (y_46_im <= 1.26e-26) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_im <= 8.8e+116) {
tmp = t_0;
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(-y_46_im), atan2(x_46_im, x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_im * log(hypot(x_46_im, x_46_re))) * 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))))) tmp = 0.0 if (y_46_im <= -1.4e+57) tmp = t_0; elseif (y_46_im <= 1.26e-26) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif (y_46_im <= 8.8e+116) tmp = t_0; else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(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]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.4e+57], t$95$0, If[LessEqual[y$46$im, 1.26e-26], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8.8e+116], t$95$0, N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot 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}}\\
\mathbf{if}\;y.im \leq -1.4 \cdot 10^{+57}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.26 \cdot 10^{-26}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 8.8 \cdot 10^{+116}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\end{array}
\end{array}
if y.im < -1.4e57 or 1.26000000000000002e-26 < y.im < 8.799999999999999e116Initial program 28.6%
Taylor expanded in y.re around 0 30.0%
unpow230.0%
unpow230.0%
hypot-undefine60.5%
Simplified60.5%
Taylor expanded in y.im around 0 44.5%
unpow244.5%
unpow244.5%
hypot-undefine63.3%
Simplified63.3%
if -1.4e57 < y.im < 1.26000000000000002e-26Initial program 40.5%
exp-diff39.1%
exp-to-pow39.1%
hypot-define39.1%
*-commutative39.1%
exp-prod38.2%
fma-define38.2%
hypot-define86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in y.im around 0 86.9%
if 8.799999999999999e116 < y.im Initial program 37.8%
Taylor expanded in y.im around 0 69.3%
Taylor expanded in y.re around 0 69.4%
*-commutative69.4%
distribute-lft-neg-in69.4%
exp-prod71.5%
Simplified71.5%
Final simplification77.8%
(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.re)))
(t_2 (* y.im (atan2 x.im x.re)))
(t_3 (* y.im (log (hypot x.im x.re))))
(t_4 (exp (- (* y.re (log x.re)) t_2))))
(if (<= x.re -7.5e-283)
(* (exp (- (* y.re t_1) t_2)) (sin (+ (* y.im t_1) t_0)))
(if (<= x.re 6e-165)
(*
t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2)))
(if (<= x.re 1.3e-61) (* (sin t_0) t_4) (* t_3 t_4))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(-x_46_re);
double t_2 = y_46_im * atan2(x_46_im, x_46_re);
double t_3 = y_46_im * log(hypot(x_46_im, x_46_re));
double t_4 = exp(((y_46_re * log(x_46_re)) - t_2));
double tmp;
if (x_46_re <= -7.5e-283) {
tmp = exp(((y_46_re * t_1) - t_2)) * sin(((y_46_im * t_1) + t_0));
} else if (x_46_re <= 6e-165) {
tmp = t_3 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
} else if (x_46_re <= 1.3e-61) {
tmp = sin(t_0) * t_4;
} else {
tmp = t_3 * t_4;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.log(-x_46_re);
double t_2 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_3 = y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
double t_4 = Math.exp(((y_46_re * Math.log(x_46_re)) - t_2));
double tmp;
if (x_46_re <= -7.5e-283) {
tmp = Math.exp(((y_46_re * t_1) - t_2)) * Math.sin(((y_46_im * t_1) + t_0));
} else if (x_46_re <= 6e-165) {
tmp = t_3 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
} else if (x_46_re <= 1.3e-61) {
tmp = Math.sin(t_0) * t_4;
} else {
tmp = t_3 * t_4;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.log(-x_46_re) t_2 = y_46_im * math.atan2(x_46_im, x_46_re) t_3 = y_46_im * math.log(math.hypot(x_46_im, x_46_re)) t_4 = math.exp(((y_46_re * math.log(x_46_re)) - t_2)) tmp = 0 if x_46_re <= -7.5e-283: tmp = math.exp(((y_46_re * t_1) - t_2)) * math.sin(((y_46_im * t_1) + t_0)) elif x_46_re <= 6e-165: tmp = t_3 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)) elif x_46_re <= 1.3e-61: tmp = math.sin(t_0) * t_4 else: tmp = t_3 * t_4 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(Float64(-x_46_re)) t_2 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_3 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) t_4 = exp(Float64(Float64(y_46_re * log(x_46_re)) - t_2)) tmp = 0.0 if (x_46_re <= -7.5e-283) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - t_2)) * sin(Float64(Float64(y_46_im * t_1) + t_0))); elseif (x_46_re <= 6e-165) tmp = Float64(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_2))); elseif (x_46_re <= 1.3e-61) tmp = Float64(sin(t_0) * t_4); else tmp = Float64(t_3 * t_4); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = log(-x_46_re); t_2 = y_46_im * atan2(x_46_im, x_46_re); t_3 = y_46_im * log(hypot(x_46_im, x_46_re)); t_4 = exp(((y_46_re * log(x_46_re)) - t_2)); tmp = 0.0; if (x_46_re <= -7.5e-283) tmp = exp(((y_46_re * t_1) - t_2)) * sin(((y_46_im * t_1) + t_0)); elseif (x_46_re <= 6e-165) tmp = t_3 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)); elseif (x_46_re <= 1.3e-61) tmp = sin(t_0) * t_4; else tmp = t_3 * t_4; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[(-x$46$re)], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -7.5e-283], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(y$46$im * t$95$1), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 6e-165], N[(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$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.3e-61], N[(N[Sin[t$95$0], $MachinePrecision] * t$95$4), $MachinePrecision], N[(t$95$3 * t$95$4), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(-x.re\right)\\
t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_4 := e^{y.re \cdot \log x.re - t\_2}\\
\mathbf{if}\;x.re \leq -7.5 \cdot 10^{-283}:\\
\;\;\;\;e^{y.re \cdot t\_1 - t\_2} \cdot \sin \left(y.im \cdot t\_1 + t\_0\right)\\
\mathbf{elif}\;x.re \leq 6 \cdot 10^{-165}:\\
\;\;\;\;t\_3 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_2}\\
\mathbf{elif}\;x.re \leq 1.3 \cdot 10^{-61}:\\
\;\;\;\;\sin t\_0 \cdot t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot t\_4\\
\end{array}
\end{array}
if x.re < -7.5000000000000001e-283Initial program 38.8%
Taylor expanded in x.re around -inf 57.1%
mul-1-neg60.3%
Simplified57.1%
Taylor expanded in x.re around -inf 72.5%
mul-1-neg60.3%
Simplified72.5%
if -7.5000000000000001e-283 < x.re < 5.99999999999999958e-165Initial program 34.4%
Taylor expanded in y.re around 0 30.9%
unpow230.9%
unpow230.9%
hypot-undefine50.9%
Simplified50.9%
Taylor expanded in y.im around 0 46.5%
unpow246.5%
unpow246.5%
hypot-undefine58.5%
Simplified58.5%
if 5.99999999999999958e-165 < x.re < 1.30000000000000005e-61Initial program 66.5%
Taylor expanded in y.im around 0 58.7%
Taylor expanded in x.re around inf 75.0%
if 1.30000000000000005e-61 < x.re Initial program 28.4%
Taylor expanded in y.re around 0 25.6%
unpow225.6%
unpow225.6%
hypot-undefine62.3%
Simplified62.3%
Taylor expanded in y.im around 0 38.9%
unpow238.9%
unpow238.9%
hypot-undefine62.6%
Simplified62.6%
Taylor expanded in x.re around inf 74.0%
Final simplification71.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (- x.re))) (t_1 (* y.im (atan2 x.im x.re))))
(if (<= x.re -2e-310)
(*
(exp (- (* y.re t_0) t_1))
(sin (+ (* y.im t_0) (* y.re (atan2 x.im x.re)))))
(* (* y.im (log (hypot x.im x.re))) (exp (- (* y.re (log x.re)) t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(-x_46_re);
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -2e-310) {
tmp = exp(((y_46_re * t_0) - t_1)) * sin(((y_46_im * t_0) + (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = (y_46_im * log(hypot(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_re)) - t_1));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(-x_46_re);
double t_1 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -2e-310) {
tmp = Math.exp(((y_46_re * t_0) - t_1)) * Math.sin(((y_46_im * t_0) + (y_46_re * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = (y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))) * Math.exp(((y_46_re * Math.log(x_46_re)) - t_1));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(-x_46_re) t_1 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_re <= -2e-310: tmp = math.exp(((y_46_re * t_0) - t_1)) * math.sin(((y_46_im * t_0) + (y_46_re * math.atan2(x_46_im, x_46_re)))) else: tmp = (y_46_im * math.log(math.hypot(x_46_im, x_46_re))) * math.exp(((y_46_re * math.log(x_46_re)) - t_1)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(Float64(-x_46_re)) t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_re <= -2e-310) tmp = Float64(exp(Float64(Float64(y_46_re * t_0) - t_1)) * sin(Float64(Float64(y_46_im * t_0) + Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(Float64(y_46_im * log(hypot(x_46_im, x_46_re))) * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_1))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(-x_46_re); t_1 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_re <= -2e-310) tmp = exp(((y_46_re * t_0) - t_1)) * sin(((y_46_im * t_0) + (y_46_re * atan2(x_46_im, x_46_re)))); else tmp = (y_46_im * log(hypot(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_re)) - t_1)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[(-x$46$re)], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -2e-310], N[(N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(y$46$im * t$95$0), $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(-x.re\right)\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -2 \cdot 10^{-310}:\\
\;\;\;\;e^{y.re \cdot t\_0 - t\_1} \cdot \sin \left(y.im \cdot t\_0 + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log x.re - t\_1}\\
\end{array}
\end{array}
if x.re < -1.999999999999994e-310Initial program 39.3%
Taylor expanded in x.re around -inf 56.9%
mul-1-neg60.7%
Simplified56.9%
Taylor expanded in x.re around -inf 72.4%
mul-1-neg60.7%
Simplified72.4%
if -1.999999999999994e-310 < x.re Initial program 34.1%
Taylor expanded in y.re around 0 28.4%
unpow228.4%
unpow228.4%
hypot-undefine58.1%
Simplified58.1%
Taylor expanded in y.im around 0 40.9%
unpow240.9%
unpow240.9%
hypot-undefine59.1%
Simplified59.1%
Taylor expanded in x.re around inf 66.9%
Final simplification69.7%
(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) (pow (exp (- y.im)) (atan2 x.im x.re)))))
(t_2 (* y.im (log (hypot x.im x.re)))))
(if (<= y.im -1.7e+61)
t_1
(if (<= y.im 7.5e-103)
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(if (<= y.im 3.9e-60)
(* t_2 (exp (- (* y.re (log x.re)) t_0)))
(if (<= y.im 95.0) (* t_2 (exp (- (* y.re (log x.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_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(-y_46_im), atan2(x_46_im, x_46_re)));
double t_2 = y_46_im * log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -1.7e+61) {
tmp = t_1;
} else if (y_46_im <= 7.5e-103) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 3.9e-60) {
tmp = t_2 * exp(((y_46_re * log(x_46_re)) - t_0));
} else if (y_46_im <= 95.0) {
tmp = t_2 * exp(((y_46_re * log(x_46_im)) - t_0));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.exp(-y_46_im), Math.atan2(x_46_im, x_46_re)));
double t_2 = y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -1.7e+61) {
tmp = t_1;
} else if (y_46_im <= 7.5e-103) {
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 if (y_46_im <= 3.9e-60) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
} else if (y_46_im <= 95.0) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
} else {
tmp = t_1;
}
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) * math.pow(math.exp(-y_46_im), math.atan2(x_46_im, x_46_re))) t_2 = y_46_im * math.log(math.hypot(x_46_im, x_46_re)) tmp = 0 if y_46_im <= -1.7e+61: tmp = t_1 elif y_46_im <= 7.5e-103: 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) elif y_46_im <= 3.9e-60: tmp = t_2 * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) elif y_46_im <= 95.0: tmp = t_2 * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) else: tmp = 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_re * Float64(atan(x_46_im, x_46_re) * (exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)))) t_2 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -1.7e+61) tmp = t_1; elseif (y_46_im <= 7.5e-103) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 3.9e-60) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); elseif (y_46_im <= 95.0) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); else tmp = t_1; 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) * (exp(-y_46_im) ^ atan2(x_46_im, x_46_re))); t_2 = y_46_im * log(hypot(x_46_im, x_46_re)); tmp = 0.0; if (y_46_im <= -1.7e+61) tmp = t_1; elseif (y_46_im <= 7.5e-103) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_im <= 3.9e-60) tmp = t_2 * exp(((y_46_re * log(x_46_re)) - t_0)); elseif (y_46_im <= 95.0) tmp = t_2 * exp(((y_46_re * log(x_46_im)) - t_0)); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.7e+61], t$95$1, If[LessEqual[y$46$im, 7.5e-103], 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], If[LessEqual[y$46$im, 3.9e-60], 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[y$46$im, 95.0], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
t_2 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -1.7 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{-103}:\\
\;\;\;\;\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{elif}\;y.im \leq 3.9 \cdot 10^{-60}:\\
\;\;\;\;t\_2 \cdot e^{y.re \cdot \log x.re - t\_0}\\
\mathbf{elif}\;y.im \leq 95:\\
\;\;\;\;t\_2 \cdot e^{y.re \cdot \log x.im - t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.70000000000000013e61 or 95 < y.im Initial program 31.8%
Taylor expanded in y.im around 0 55.9%
Taylor expanded in y.re around 0 58.7%
*-commutative58.7%
distribute-lft-neg-in58.7%
exp-prod60.4%
Simplified60.4%
if -1.70000000000000013e61 < y.im < 7.5e-103Initial program 40.1%
Taylor expanded in y.im around 0 50.7%
Taylor expanded in y.im around 0 50.7%
unpow250.7%
unpow250.7%
hypot-undefine61.6%
Simplified61.6%
if 7.5e-103 < y.im < 3.9000000000000002e-60Initial program 49.7%
Taylor expanded in y.re around 0 66.4%
unpow266.4%
unpow266.4%
hypot-undefine67.3%
Simplified67.3%
Taylor expanded in y.im around 0 67.3%
unpow267.3%
unpow267.3%
hypot-undefine67.3%
Simplified67.3%
Taylor expanded in x.re around inf 83.1%
if 3.9000000000000002e-60 < y.im < 95Initial program 40.0%
Taylor expanded in y.re around 0 50.0%
unpow250.0%
unpow250.0%
hypot-undefine61.3%
Simplified61.3%
Taylor expanded in y.im around 0 50.0%
unpow250.0%
unpow250.0%
hypot-undefine61.3%
Simplified61.3%
Taylor expanded in x.re around 0 60.0%
Final simplification61.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(*
y.re
(* (atan2 x.im x.re) (pow (exp (- y.im)) (atan2 x.im x.re))))))
(if (<= y.im -5.4e+61)
t_1
(if (<= y.im 5.2e-76)
(* (sin t_0) (pow (hypot x.im x.re) y.re))
(if (<= y.im 2.65e-8)
(*
(* y.im (log (hypot x.im x.re)))
(exp (- (* y.re (log x.im)) (* y.im (atan2 x.im x.re)))))
(if (<= y.im 19.0) (sqrt (pow t_0 2.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 = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(-y_46_im), atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -5.4e+61) {
tmp = t_1;
} else if (y_46_im <= 5.2e-76) {
tmp = sin(t_0) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 2.65e-8) {
tmp = (y_46_im * log(hypot(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_im)) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_im <= 19.0) {
tmp = sqrt(pow(t_0, 2.0));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.exp(-y_46_im), Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -5.4e+61) {
tmp = t_1;
} else if (y_46_im <= 5.2e-76) {
tmp = Math.sin(t_0) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 2.65e-8) {
tmp = (y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))) * Math.exp(((y_46_re * Math.log(x_46_im)) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else if (y_46_im <= 19.0) {
tmp = Math.sqrt(Math.pow(t_0, 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.exp(-y_46_im), math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= -5.4e+61: tmp = t_1 elif y_46_im <= 5.2e-76: tmp = math.sin(t_0) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_im <= 2.65e-8: tmp = (y_46_im * math.log(math.hypot(x_46_im, x_46_re))) * math.exp(((y_46_re * math.log(x_46_im)) - (y_46_im * math.atan2(x_46_im, x_46_re)))) elif y_46_im <= 19.0: tmp = math.sqrt(math.pow(t_0, 2.0)) else: tmp = 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 = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -5.4e+61) tmp = t_1; elseif (y_46_im <= 5.2e-76) tmp = Float64(sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 2.65e-8) tmp = Float64(Float64(y_46_im * log(hypot(x_46_im, x_46_re))) * exp(Float64(Float64(y_46_re * log(x_46_im)) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_im <= 19.0) tmp = sqrt((t_0 ^ 2.0)); else tmp = t_1; 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 = y_46_re * (atan2(x_46_im, x_46_re) * (exp(-y_46_im) ^ atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= -5.4e+61) tmp = t_1; elseif (y_46_im <= 5.2e-76) tmp = sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_im <= 2.65e-8) tmp = (y_46_im * log(hypot(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_im)) - (y_46_im * atan2(x_46_im, x_46_re)))); elseif (y_46_im <= 19.0) tmp = sqrt((t_0 ^ 2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -5.4e+61], t$95$1, If[LessEqual[y$46$im, 5.2e-76], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.65e-8], N[(N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 19.0], N[Sqrt[N[Power[t$95$0, 2.0], $MachinePrecision]], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{if}\;y.im \leq -5.4 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 5.2 \cdot 10^{-76}:\\
\;\;\;\;\sin t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 2.65 \cdot 10^{-8}:\\
\;\;\;\;\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.im \leq 19:\\
\;\;\;\;\sqrt{{t\_0}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -5.4000000000000004e61 or 19 < y.im Initial program 31.8%
Taylor expanded in y.im around 0 55.9%
Taylor expanded in y.re around 0 58.7%
*-commutative58.7%
distribute-lft-neg-in58.7%
exp-prod60.4%
Simplified60.4%
if -5.4000000000000004e61 < y.im < 5.1999999999999999e-76Initial program 40.0%
Taylor expanded in y.im around 0 49.6%
Taylor expanded in y.im around 0 49.6%
unpow249.6%
unpow249.6%
hypot-undefine60.3%
Simplified60.3%
if 5.1999999999999999e-76 < y.im < 2.6499999999999999e-8Initial program 49.8%
Taylor expanded in y.re around 0 49.8%
unpow249.8%
unpow249.8%
hypot-undefine61.1%
Simplified61.1%
Taylor expanded in y.im around 0 50.1%
unpow250.1%
unpow250.1%
hypot-undefine61.1%
Simplified61.1%
Taylor expanded in x.re around 0 79.7%
if 2.6499999999999999e-8 < y.im < 19Initial program 33.3%
Taylor expanded in y.im around 0 34.4%
Taylor expanded in y.re around 0 2.3%
*-commutative2.3%
distribute-lft-neg-in2.3%
Simplified2.3%
Taylor expanded in y.im around 0 2.3%
*-commutative2.3%
add-sqr-sqrt1.0%
sqrt-unprod35.4%
pow235.4%
Applied egg-rr35.4%
Final simplification60.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))))
(if (<= x.re -2e-310)
(* (sin (* y.re (atan2 x.im x.re))) (exp (- (* y.re (log (- x.re))) t_0)))
(* (* y.im (log (hypot x.im x.re))) (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 tmp;
if (x_46_re <= -2e-310) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * log(-x_46_re)) - t_0));
} else {
tmp = (y_46_im * log(hypot(x_46_im, x_46_re))) * 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 tmp;
if (x_46_re <= -2e-310) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else {
tmp = (y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))) * 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) tmp = 0 if x_46_re <= -2e-310: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) else: tmp = (y_46_im * math.log(math.hypot(x_46_im, x_46_re))) * 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)) tmp = 0.0 if (x_46_re <= -2e-310) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); else tmp = Float64(Float64(y_46_im * log(hypot(x_46_im, x_46_re))) * 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); tmp = 0.0; if (x_46_re <= -2e-310) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * log(-x_46_re)) - t_0)); else tmp = (y_46_im * log(hypot(x_46_im, x_46_re))) * 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]}, If[LessEqual[x$46$re, -2e-310], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 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}\\
\mathbf{if}\;x.re \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log \left(-x.re\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log x.re - t\_0}\\
\end{array}
\end{array}
if x.re < -1.999999999999994e-310Initial program 39.3%
Taylor expanded in y.im around 0 50.9%
Taylor expanded in x.re around -inf 60.7%
mul-1-neg60.7%
Simplified60.7%
if -1.999999999999994e-310 < x.re Initial program 34.1%
Taylor expanded in y.re around 0 28.4%
unpow228.4%
unpow228.4%
hypot-undefine58.1%
Simplified58.1%
Taylor expanded in y.im around 0 40.9%
unpow240.9%
unpow240.9%
hypot-undefine59.1%
Simplified59.1%
Taylor expanded in x.re around inf 66.9%
Final simplification63.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -6.2e+60) (not (<= y.im 800.0))) (* y.re (* (atan2 x.im x.re) (pow (exp (- y.im)) (atan2 x.im x.re)))) (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -6.2e+60) || !(y_46_im <= 800.0)) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(-y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -6.2e+60) || !(y_46_im <= 800.0)) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.exp(-y_46_im), Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -6.2e+60) or not (y_46_im <= 800.0): tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.exp(-y_46_im), math.atan2(x_46_im, x_46_re))) else: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -6.2e+60) || !(y_46_im <= 800.0)) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)))); else tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -6.2e+60) || ~((y_46_im <= 800.0))) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (exp(-y_46_im) ^ atan2(x_46_im, x_46_re))); else tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -6.2e+60], N[Not[LessEqual[y$46$im, 800.0]], $MachinePrecision]], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -6.2 \cdot 10^{+60} \lor \neg \left(y.im \leq 800\right):\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -6.2000000000000001e60 or 800 < y.im Initial program 31.8%
Taylor expanded in y.im around 0 55.9%
Taylor expanded in y.re around 0 58.7%
*-commutative58.7%
distribute-lft-neg-in58.7%
exp-prod60.4%
Simplified60.4%
if -6.2000000000000001e60 < y.im < 800Initial program 40.5%
Taylor expanded in y.im around 0 48.1%
Taylor expanded in y.im around 0 48.1%
unpow248.1%
unpow248.1%
hypot-undefine57.9%
Simplified57.9%
Final simplification58.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -6.5e+60) (not (<= y.im 1950.0))) (* y.re (* (atan2 x.im x.re) (exp (* y.im (- (atan2 x.im x.re)))))) (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -6.5e+60) || !(y_46_im <= 1950.0)) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re))));
} else {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -6.5e+60) || !(y_46_im <= 1950.0)) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))));
} else {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -6.5e+60) or not (y_46_im <= 1950.0): tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re)))) else: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -6.5e+60) || !(y_46_im <= 1950.0)) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))))); else tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -6.5e+60) || ~((y_46_im <= 1950.0))) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re)))); else tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -6.5e+60], N[Not[LessEqual[y$46$im, 1950.0]], $MachinePrecision]], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -6.5 \cdot 10^{+60} \lor \neg \left(y.im \leq 1950\right):\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -6.49999999999999931e60 or 1950 < y.im Initial program 31.8%
Taylor expanded in y.im around 0 55.9%
Taylor expanded in y.re around 0 58.7%
*-commutative58.7%
distribute-lft-neg-in58.7%
Simplified58.7%
if -6.49999999999999931e60 < y.im < 1950Initial program 40.5%
Taylor expanded in y.im around 0 48.1%
Taylor expanded in y.im around 0 48.1%
unpow248.1%
unpow248.1%
hypot-undefine57.9%
Simplified57.9%
Final simplification58.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re 7.6e+166)
(* y.re (* (atan2 x.im x.re) (exp (* y.im (- (atan2 x.im x.re))))))
(if (<= y.re 5.2e+239)
(log (pow (exp y.re) (atan2 x.im x.re)))
(sqrt (pow (* y.re (atan2 x.im x.re)) 2.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 <= 7.6e+166) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 5.2e+239) {
tmp = log(pow(exp(y_46_re), atan2(x_46_im, x_46_re)));
} else {
tmp = sqrt(pow((y_46_re * atan2(x_46_im, x_46_re)), 2.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) :: tmp
if (y_46re <= 7.6d+166) then
tmp = y_46re * (atan2(x_46im, x_46re) * exp((y_46im * -atan2(x_46im, x_46re))))
else if (y_46re <= 5.2d+239) then
tmp = log((exp(y_46re) ** atan2(x_46im, x_46re)))
else
tmp = sqrt(((y_46re * atan2(x_46im, x_46re)) ** 2.0d0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 7.6e+166) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 5.2e+239) {
tmp = Math.log(Math.pow(Math.exp(y_46_re), Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.sqrt(Math.pow((y_46_re * Math.atan2(x_46_im, x_46_re)), 2.0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= 7.6e+166: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re)))) elif y_46_re <= 5.2e+239: tmp = math.log(math.pow(math.exp(y_46_re), math.atan2(x_46_im, x_46_re))) else: tmp = math.sqrt(math.pow((y_46_re * math.atan2(x_46_im, x_46_re)), 2.0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 7.6e+166) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))))); elseif (y_46_re <= 5.2e+239) tmp = log((exp(y_46_re) ^ atan(x_46_im, x_46_re))); else tmp = sqrt((Float64(y_46_re * atan(x_46_im, x_46_re)) ^ 2.0)); 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 <= 7.6e+166) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re)))); elseif (y_46_re <= 5.2e+239) tmp = log((exp(y_46_re) ^ atan2(x_46_im, x_46_re))); else tmp = sqrt(((y_46_re * atan2(x_46_im, x_46_re)) ^ 2.0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 7.6e+166], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.2e+239], N[Log[N[Power[N[Exp[y$46$re], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Sqrt[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 7.6 \cdot 10^{+166}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.re \leq 5.2 \cdot 10^{+239}:\\
\;\;\;\;\log \left({\left(e^{y.re}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}}\\
\end{array}
\end{array}
if y.re < 7.60000000000000014e166Initial program 38.1%
Taylor expanded in y.im around 0 51.9%
Taylor expanded in y.re around 0 43.0%
*-commutative43.0%
distribute-lft-neg-in43.0%
Simplified43.0%
if 7.60000000000000014e166 < y.re < 5.2000000000000004e239Initial program 26.3%
Taylor expanded in y.im around 0 42.3%
Taylor expanded in y.re around 0 12.9%
*-commutative12.9%
distribute-lft-neg-in12.9%
Simplified12.9%
Taylor expanded in y.im around 0 2.8%
add-log-exp32.5%
exp-prod47.9%
Applied egg-rr47.9%
if 5.2000000000000004e239 < y.re Initial program 31.3%
Taylor expanded in y.im around 0 56.3%
Taylor expanded in y.re around 0 1.6%
*-commutative1.6%
distribute-lft-neg-in1.6%
Simplified1.6%
Taylor expanded in y.im around 0 1.9%
*-commutative1.9%
add-sqr-sqrt0.9%
sqrt-unprod44.5%
pow244.5%
Applied egg-rr44.5%
Final simplification43.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 3.3e+112) (* y.re (* (atan2 x.im x.re) (exp (* y.im (- (atan2 x.im x.re)))))) (pow (pow (* y.re (atan2 x.im x.re)) 3.0) 0.3333333333333333)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 3.3e+112) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re))));
} else {
tmp = pow(pow((y_46_re * atan2(x_46_im, x_46_re)), 3.0), 0.3333333333333333);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= 3.3d+112) then
tmp = y_46re * (atan2(x_46im, x_46re) * exp((y_46im * -atan2(x_46im, x_46re))))
else
tmp = ((y_46re * atan2(x_46im, x_46re)) ** 3.0d0) ** 0.3333333333333333d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 3.3e+112) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))));
} else {
tmp = Math.pow(Math.pow((y_46_re * Math.atan2(x_46_im, x_46_re)), 3.0), 0.3333333333333333);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= 3.3e+112: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re)))) else: tmp = math.pow(math.pow((y_46_re * math.atan2(x_46_im, x_46_re)), 3.0), 0.3333333333333333) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 3.3e+112) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))))); else tmp = (Float64(y_46_re * atan(x_46_im, x_46_re)) ^ 3.0) ^ 0.3333333333333333; 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 <= 3.3e+112) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re)))); else tmp = ((y_46_re * atan2(x_46_im, x_46_re)) ^ 3.0) ^ 0.3333333333333333; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 3.3e+112], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 3.3 \cdot 10^{+112}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.re < 3.2999999999999999e112Initial program 37.9%
Taylor expanded in y.im around 0 51.5%
Taylor expanded in y.re around 0 43.5%
*-commutative43.5%
distribute-lft-neg-in43.5%
Simplified43.5%
if 3.2999999999999999e112 < y.re Initial program 31.9%
Taylor expanded in y.im around 0 51.2%
Taylor expanded in y.re around 0 14.5%
*-commutative14.5%
distribute-lft-neg-in14.5%
Simplified14.5%
Taylor expanded in y.im around 0 2.2%
*-commutative2.2%
add-cbrt-cube20.1%
pow1/332.8%
pow332.8%
Applied egg-rr32.8%
Final simplification41.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.im 8e-103)
(log1p (expm1 t_0))
(pow (pow t_0 3.0) 0.3333333333333333))))
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 <= 8e-103) {
tmp = log1p(expm1(t_0));
} else {
tmp = pow(pow(t_0, 3.0), 0.3333333333333333);
}
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 <= 8e-103) {
tmp = Math.log1p(Math.expm1(t_0));
} else {
tmp = Math.pow(Math.pow(t_0, 3.0), 0.3333333333333333);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_im <= 8e-103: tmp = math.log1p(math.expm1(t_0)) else: tmp = math.pow(math.pow(t_0, 3.0), 0.3333333333333333) 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 <= 8e-103) tmp = log1p(expm1(t_0)); else tmp = (t_0 ^ 3.0) ^ 0.3333333333333333; 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, 8e-103], N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq 8 \cdot 10^{-103}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left({t\_0}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.im < 7.99999999999999966e-103Initial program 35.9%
Taylor expanded in y.im around 0 50.1%
Taylor expanded in y.re around 0 33.5%
*-commutative33.5%
distribute-lft-neg-in33.5%
Simplified33.5%
Taylor expanded in y.im around 0 20.4%
*-commutative20.4%
log1p-expm1-u29.4%
Applied egg-rr29.4%
if 7.99999999999999966e-103 < y.im Initial program 38.7%
Taylor expanded in y.im around 0 54.5%
Taylor expanded in y.re around 0 48.5%
*-commutative48.5%
distribute-lft-neg-in48.5%
Simplified48.5%
Taylor expanded in y.im around 0 4.2%
*-commutative4.2%
add-cbrt-cube19.3%
pow1/326.6%
pow326.6%
Applied egg-rr26.6%
Final simplification28.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 1.8e+21) (log1p (expm1 t_0)) (cbrt (pow t_0 3.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= 1.8e+21) {
tmp = log1p(expm1(t_0));
} else {
tmp = cbrt(pow(t_0, 3.0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= 1.8e+21) {
tmp = Math.log1p(Math.expm1(t_0));
} else {
tmp = Math.cbrt(Math.pow(t_0, 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= 1.8e+21) tmp = log1p(expm1(t_0)); else tmp = cbrt((t_0 ^ 3.0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, 1.8e+21], N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq 1.8 \cdot 10^{+21}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{t\_0}^{3}}\\
\end{array}
\end{array}
if y.im < 1.8e21Initial program 36.5%
Taylor expanded in y.im around 0 48.4%
Taylor expanded in y.re around 0 32.0%
*-commutative32.0%
distribute-lft-neg-in32.0%
Simplified32.0%
Taylor expanded in y.im around 0 18.7%
*-commutative18.7%
log1p-expm1-u27.3%
Applied egg-rr27.3%
if 1.8e21 < y.im Initial program 37.7%
Taylor expanded in y.im around 0 61.1%
Taylor expanded in y.re around 0 58.0%
*-commutative58.0%
distribute-lft-neg-in58.0%
Simplified58.0%
Taylor expanded in y.im around 0 4.5%
*-commutative4.5%
add-cbrt-cube24.4%
pow324.4%
Applied egg-rr24.4%
Final simplification26.6%
(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 36.8%
Taylor expanded in y.im around 0 51.4%
Taylor expanded in y.re around 0 38.2%
*-commutative38.2%
distribute-lft-neg-in38.2%
Simplified38.2%
Taylor expanded in y.im around 0 15.3%
*-commutative15.3%
log1p-expm1-u24.1%
Applied egg-rr24.1%
Final simplification24.1%
(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 36.8%
Taylor expanded in y.im around 0 51.4%
Taylor expanded in y.re around 0 38.2%
*-commutative38.2%
distribute-lft-neg-in38.2%
Simplified38.2%
Taylor expanded in y.im around 0 15.3%
Final simplification15.3%
herbie shell --seed 2024067
(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)))))