
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(t_2 (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im))))
(t_3 (cbrt t_1))
(t_4 (cbrt t_3)))
(if (<= x.im 4.8e-220)
(* t_2 (sin t_1))
(if (<= x.im 4.7e+123)
(* t_2 (sin (* (pow t_3 2.0) (* t_4 (* t_4 t_4)))))
(* t_2 (sin (pow t_3 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 = fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = cbrt(t_1);
double t_4 = cbrt(t_3);
double tmp;
if (x_46_im <= 4.8e-220) {
tmp = t_2 * sin(t_1);
} else if (x_46_im <= 4.7e+123) {
tmp = t_2 * sin((pow(t_3, 2.0) * (t_4 * (t_4 * t_4))));
} else {
tmp = t_2 * sin(pow(t_3, 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 = fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = cbrt(t_1) t_4 = cbrt(t_3) tmp = 0.0 if (x_46_im <= 4.8e-220) tmp = Float64(t_2 * sin(t_1)); elseif (x_46_im <= 4.7e+123) tmp = Float64(t_2 * sin(Float64((t_3 ^ 2.0) * Float64(t_4 * Float64(t_4 * t_4))))); else tmp = Float64(t_2 * sin((t_3 ^ 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[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[Power[t$95$1, 1/3], $MachinePrecision]}, Block[{t$95$4 = N[Power[t$95$3, 1/3], $MachinePrecision]}, If[LessEqual[x$46$im, 4.8e-220], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4.7e+123], N[(t$95$2 * N[Sin[N[(N[Power[t$95$3, 2.0], $MachinePrecision] * N[(t$95$4 * N[(t$95$4 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[Power[t$95$3, 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 := \mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \sqrt[3]{t_1}\\
t_4 := \sqrt[3]{t_3}\\
\mathbf{if}\;x.im \leq 4.8 \cdot 10^{-220}:\\
\;\;\;\;t_2 \cdot \sin t_1\\
\mathbf{elif}\;x.im \leq 4.7 \cdot 10^{+123}:\\
\;\;\;\;t_2 \cdot \sin \left({t_3}^{2} \cdot \left(t_4 \cdot \left(t_4 \cdot t_4\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin \left({t_3}^{3}\right)\\
\end{array}
\end{array}
if x.im < 4.8000000000000003e-220Initial program 35.4%
Simplified86.7%
if 4.8000000000000003e-220 < x.im < 4.69999999999999979e123Initial program 59.5%
Simplified79.1%
add-cube-cbrt75.7%
Applied egg-rr75.7%
add-cube-cbrt87.6%
Applied egg-rr87.6%
if 4.69999999999999979e123 < x.im Initial program 5.2%
Simplified76.3%
fma-udef76.3%
hypot-udef5.2%
*-commutative5.2%
add-cube-cbrt7.8%
pow310.4%
hypot-udef86.3%
*-commutative86.3%
fma-udef86.3%
*-commutative86.3%
Applied egg-rr86.3%
Final simplification86.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= y.re -5e+44)
(*
t_1
(sin
(fabs (fma y.re (atan2 x.im x.re) (* y.im (log (hypot x.im x.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 = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -5e+44) {
tmp = t_1 * sin(fabs(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * log(hypot(x_46_im, x_46_re))))));
} else {
tmp = 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 = exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -5e+44) tmp = Float64(t_1 * sin(abs(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * log(hypot(x_46_im, x_46_re))))))); else tmp = Float64(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[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]}, If[LessEqual[y$46$re, -5e+44], N[(t$95$1 * N[Sin[N[Abs[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{+44}:\\
\;\;\;\;t_1 \cdot \sin \left(\left|\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right|\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \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.re < -4.9999999999999996e44Initial program 37.1%
Simplified80.6%
fma-udef80.6%
hypot-udef37.1%
*-commutative37.1%
add-sqr-sqrt21.0%
sqrt-unprod14.5%
pow214.5%
fma-def14.5%
hypot-udef38.7%
Applied egg-rr38.7%
unpow238.7%
rem-sqrt-square88.7%
hypot-def38.7%
unpow238.7%
unpow238.7%
+-commutative38.7%
*-commutative38.7%
fma-def38.7%
*-commutative38.7%
+-commutative38.7%
fma-def38.7%
unpow238.7%
unpow238.7%
hypot-def88.7%
Simplified88.7%
if -4.9999999999999996e44 < y.re Initial program 37.4%
Simplified84.0%
Final simplification85.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(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[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 37.4%
Simplified83.2%
Final simplification83.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im))))
(t_3 (* t_2 (sin (* y.im (log (hypot x.im x.re)))))))
(if (<= y.im -1.75e+46)
(* t_2 t_0)
(if (<= y.im -1e-32)
t_3
(if (<= y.im 3.1e-134)
(* (sin (fma t_1 y.im t_0)) (pow (hypot x.re x.im) y.re))
(if (<= y.im 30000000.0)
t_3
(if (<= y.im 1100000000000.0)
(* t_2 (sin (* y.im (log x.re))))
(* t_2 (fabs (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 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = t_2 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.75e+46) {
tmp = t_2 * t_0;
} else if (y_46_im <= -1e-32) {
tmp = t_3;
} else if (y_46_im <= 3.1e-134) {
tmp = sin(fma(t_1, y_46_im, t_0)) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_im <= 30000000.0) {
tmp = t_3;
} else if (y_46_im <= 1100000000000.0) {
tmp = t_2 * sin((y_46_im * log(x_46_re)));
} else {
tmp = t_2 * fabs(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 = log(hypot(x_46_re, x_46_im)) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = Float64(t_2 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_im <= -1.75e+46) tmp = Float64(t_2 * t_0); elseif (y_46_im <= -1e-32) tmp = t_3; elseif (y_46_im <= 3.1e-134) tmp = Float64(sin(fma(t_1, y_46_im, t_0)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif (y_46_im <= 30000000.0) tmp = t_3; elseif (y_46_im <= 1100000000000.0) tmp = Float64(t_2 * sin(Float64(y_46_im * log(x_46_re)))); else tmp = Float64(t_2 * abs(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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.75e+46], N[(t$95$2 * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, -1e-32], t$95$3, If[LessEqual[y$46$im, 3.1e-134], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$0), $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, 30000000.0], t$95$3, If[LessEqual[y$46$im, 1100000000000.0], N[(t$95$2 * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Abs[N[Sin[t$95$0], $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(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{t_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := t_2 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.im \leq -1.75 \cdot 10^{+46}:\\
\;\;\;\;t_2 \cdot t_0\\
\mathbf{elif}\;y.im \leq -1 \cdot 10^{-32}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.im \leq 3.1 \cdot 10^{-134}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 30000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.im \leq 1100000000000:\\
\;\;\;\;t_2 \cdot \sin \left(y.im \cdot \log x.re\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left|\sin t_0\right|\\
\end{array}
\end{array}
if y.im < -1.74999999999999992e46Initial program 27.8%
Simplified70.7%
Taylor expanded in y.im around 0 70.4%
Taylor expanded in y.re around 0 76.0%
*-commutative76.0%
Simplified76.0%
if -1.74999999999999992e46 < y.im < -1.00000000000000006e-32 or 3.10000000000000006e-134 < y.im < 3e7Initial program 35.8%
Simplified85.1%
fma-udef85.1%
hypot-udef35.8%
*-commutative35.8%
add-cbrt-cube31.2%
pow1/318.3%
pow318.3%
fma-def18.3%
hypot-udef41.0%
Applied egg-rr41.0%
Taylor expanded in y.im around inf 39.6%
unpow239.6%
unpow239.6%
hypot-def93.0%
Simplified93.0%
if -1.00000000000000006e-32 < y.im < 3.10000000000000006e-134Initial program 45.2%
exp-diff45.2%
+-rgt-identity45.2%
+-rgt-identity45.2%
exp-to-pow45.2%
hypot-def45.2%
*-commutative45.2%
exp-prod45.2%
fma-def45.2%
hypot-def92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in y.im around 0 92.5%
if 3e7 < y.im < 1.1e12Initial program 8.4%
Simplified41.7%
fma-udef41.7%
hypot-udef8.4%
*-commutative8.4%
add-cbrt-cube7.6%
pow1/333.9%
pow333.9%
fma-def33.9%
hypot-udef33.9%
Applied egg-rr33.9%
Taylor expanded in x.im around 0 33.9%
unpow1/37.6%
*-commutative7.6%
unpow27.6%
cube-unmult7.6%
fma-def7.6%
*-commutative7.6%
Simplified7.6%
Taylor expanded in y.im around inf 75.0%
if 1.1e12 < y.im Initial program 35.8%
Simplified79.3%
Taylor expanded in y.im around 0 69.9%
add-sqr-sqrt39.6%
sqrt-unprod71.7%
pow271.7%
*-commutative71.7%
Applied egg-rr71.7%
*-commutative71.7%
unpow271.7%
rem-sqrt-square77.4%
*-commutative77.4%
Simplified77.4%
Final simplification85.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 (hypot x.re x.im)))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= y.im -1.45e+46)
(* t_2 t_0)
(if (<= y.im 510.0)
(* (sin (fma t_1 y.im t_0)) (pow (hypot x.re x.im) y.re))
(* t_2 (fabs (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 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_im <= -1.45e+46) {
tmp = t_2 * t_0;
} else if (y_46_im <= 510.0) {
tmp = sin(fma(t_1, y_46_im, t_0)) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = t_2 * fabs(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 = log(hypot(x_46_re, x_46_im)) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_im <= -1.45e+46) tmp = Float64(t_2 * t_0); elseif (y_46_im <= 510.0) tmp = Float64(sin(fma(t_1, y_46_im, t_0)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64(t_2 * abs(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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.45e+46], N[(t$95$2 * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 510.0], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$0), $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[Abs[N[Sin[t$95$0], $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(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{t_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.45 \cdot 10^{+46}:\\
\;\;\;\;t_2 \cdot t_0\\
\mathbf{elif}\;y.im \leq 510:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left|\sin t_0\right|\\
\end{array}
\end{array}
if y.im < -1.4500000000000001e46Initial program 27.8%
Simplified70.7%
Taylor expanded in y.im around 0 70.4%
Taylor expanded in y.re around 0 76.0%
*-commutative76.0%
Simplified76.0%
if -1.4500000000000001e46 < y.im < 510Initial program 41.9%
exp-diff41.9%
+-rgt-identity41.9%
+-rgt-identity41.9%
exp-to-pow41.9%
hypot-def41.9%
*-commutative41.9%
exp-prod41.6%
fma-def41.6%
hypot-def89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in y.im around 0 87.7%
if 510 < y.im Initial program 34.9%
Simplified76.3%
Taylor expanded in y.im around 0 65.7%
add-sqr-sqrt36.3%
sqrt-unprod69.1%
pow269.1%
*-commutative69.1%
Applied egg-rr69.1%
*-commutative69.1%
unpow269.1%
rem-sqrt-square74.2%
*-commutative74.2%
Simplified74.2%
Final simplification82.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= y.im -1e+46)
(* t_2 t_0)
(if (<= y.im 1100000000000.0)
(* (sin (fma t_1 y.im t_0)) (pow (hypot x.re x.im) y.re))
(* t_2 (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 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_im <= -1e+46) {
tmp = t_2 * t_0;
} else if (y_46_im <= 1100000000000.0) {
tmp = sin(fma(t_1, y_46_im, t_0)) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = t_2 * 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 = log(hypot(x_46_re, x_46_im)) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_im <= -1e+46) tmp = Float64(t_2 * t_0); elseif (y_46_im <= 1100000000000.0) tmp = Float64(sin(fma(t_1, y_46_im, t_0)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64(t_2 * 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1e+46], N[(t$95$2 * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 1100000000000.0], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$0), $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[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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{t_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.im \leq -1 \cdot 10^{+46}:\\
\;\;\;\;t_2 \cdot t_0\\
\mathbf{elif}\;y.im \leq 1100000000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin t_0\\
\end{array}
\end{array}
if y.im < -9.9999999999999999e45Initial program 27.8%
Simplified70.7%
Taylor expanded in y.im around 0 70.4%
Taylor expanded in y.re around 0 76.0%
*-commutative76.0%
Simplified76.0%
if -9.9999999999999999e45 < y.im < 1.1e12Initial program 41.4%
exp-diff41.4%
+-rgt-identity41.4%
+-rgt-identity41.4%
exp-to-pow41.4%
hypot-def41.4%
*-commutative41.4%
exp-prod41.0%
fma-def41.0%
hypot-def88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in y.im around 0 85.6%
if 1.1e12 < y.im Initial program 35.8%
Simplified79.3%
Taylor expanded in y.im around 0 69.9%
Final simplification80.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(exp (- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im))))
(t_2 (* t_1 (sin t_0))))
(if (<= x.re 1e-149)
t_2
(if (<= x.re 1.55e-118)
(*
(fma -0.16666666666666666 (pow t_0 3.0) t_0)
(pow (hypot x.im x.re) y.re))
(if (<= x.re 2.15e+161) t_2 (* t_1 (sin (* y.im (log x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = t_1 * sin(t_0);
double tmp;
if (x_46_re <= 1e-149) {
tmp = t_2;
} else if (x_46_re <= 1.55e-118) {
tmp = fma(-0.16666666666666666, pow(t_0, 3.0), t_0) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (x_46_re <= 2.15e+161) {
tmp = t_2;
} else {
tmp = t_1 * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_2 = Float64(t_1 * sin(t_0)) tmp = 0.0 if (x_46_re <= 1e-149) tmp = t_2; elseif (x_46_re <= 1.55e-118) tmp = Float64(fma(-0.16666666666666666, (t_0 ^ 3.0), t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (x_46_re <= 2.15e+161) tmp = t_2; else tmp = Float64(t_1 * sin(Float64(y_46_im * log(x_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, 1e-149], t$95$2, If[LessEqual[x$46$re, 1.55e-118], N[(N[(-0.16666666666666666 * N[Power[t$95$0, 3.0], $MachinePrecision] + t$95$0), $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.15e+161], t$95$2, N[(t$95$1 * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_2 := t_1 \cdot \sin t_0\\
\mathbf{if}\;x.re \leq 10^{-149}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x.re \leq 1.55 \cdot 10^{-118}:\\
\;\;\;\;\mathsf{fma}\left(-0.16666666666666666, {t_0}^{3}, t_0\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 2.15 \cdot 10^{+161}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < 9.99999999999999979e-150 or 1.5500000000000001e-118 < x.re < 2.15e161Initial program 43.4%
Simplified84.5%
Taylor expanded in y.im around 0 69.4%
if 9.99999999999999979e-150 < x.re < 1.5500000000000001e-118Initial program 22.0%
Simplified44.3%
Taylor expanded in y.im around 0 23.0%
Taylor expanded in y.im around 0 23.1%
*-commutative23.1%
*-commutative23.1%
unpow223.1%
unpow223.1%
hypot-def23.1%
Simplified23.1%
Taylor expanded in y.re around 0 67.5%
fma-def67.5%
cube-prod67.5%
Simplified67.5%
if 2.15e161 < x.re Initial program 0.0%
Simplified85.3%
fma-udef85.3%
hypot-udef0.0%
*-commutative0.0%
add-cbrt-cube0.0%
pow1/30.0%
pow30.0%
fma-def0.0%
hypot-udef23.1%
Applied egg-rr23.1%
Taylor expanded in x.im around 0 23.1%
unpow1/333.8%
*-commutative33.8%
unpow233.8%
cube-unmult33.9%
fma-def33.9%
*-commutative33.9%
Simplified33.9%
Taylor expanded in y.im around inf 82.2%
Final simplification70.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im)))))
(if (or (<= x.re 3.5e-143)
(and (not (<= x.re 2.2e+105)) (<= x.re 2.15e+161)))
(* t_0 (* y.re (atan2 x.im x.re)))
(* t_0 (sin (* y.im (log x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((x_46_re <= 3.5e-143) || (!(x_46_re <= 2.2e+105) && (x_46_re <= 2.15e+161))) {
tmp = t_0 * (y_46_re * atan2(x_46_im, x_46_re));
} else {
tmp = t_0 * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((x_46_re <= 3.5e-143) || (!(x_46_re <= 2.2e+105) && (x_46_re <= 2.15e+161))) {
tmp = t_0 * (y_46_re * Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_0 * Math.sin((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if (x_46_re <= 3.5e-143) or (not (x_46_re <= 2.2e+105) and (x_46_re <= 2.15e+161)): tmp = t_0 * (y_46_re * math.atan2(x_46_im, x_46_re)) else: tmp = t_0 * math.sin((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if ((x_46_re <= 3.5e-143) || (!(x_46_re <= 2.2e+105) && (x_46_re <= 2.15e+161))) tmp = Float64(t_0 * Float64(y_46_re * atan(x_46_im, x_46_re))); else tmp = Float64(t_0 * sin(Float64(y_46_im * log(x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); tmp = 0.0; if ((x_46_re <= 3.5e-143) || (~((x_46_re <= 2.2e+105)) && (x_46_re <= 2.15e+161))) tmp = t_0 * (y_46_re * atan2(x_46_im, x_46_re)); else tmp = t_0 * sin((y_46_im * log(x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x$46$re, 3.5e-143], And[N[Not[LessEqual[x$46$re, 2.2e+105]], $MachinePrecision], LessEqual[x$46$re, 2.15e+161]]], N[(t$95$0 * N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq 3.5 \cdot 10^{-143} \lor \neg \left(x.re \leq 2.2 \cdot 10^{+105}\right) \land x.re \leq 2.15 \cdot 10^{+161}:\\
\;\;\;\;t_0 \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < 3.50000000000000005e-143 or 2.20000000000000007e105 < x.re < 2.15e161Initial program 37.2%
Simplified82.8%
Taylor expanded in y.im around 0 68.6%
Taylor expanded in y.re around 0 65.4%
*-commutative65.4%
Simplified65.4%
if 3.50000000000000005e-143 < x.re < 2.20000000000000007e105 or 2.15e161 < x.re Initial program 37.7%
Simplified83.8%
fma-udef83.8%
hypot-udef37.7%
*-commutative37.7%
add-cbrt-cube17.7%
pow1/37.2%
pow37.2%
fma-def7.2%
hypot-udef17.5%
Applied egg-rr17.5%
Taylor expanded in x.im around 0 20.0%
unpow1/335.3%
*-commutative35.3%
unpow235.3%
cube-unmult34.0%
fma-def34.0%
*-commutative34.0%
Simplified34.0%
Taylor expanded in y.im around inf 73.6%
Final simplification67.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re 1.56e+161)
(* t_0 (sin (* y.re (atan2 x.im x.re))))
(* t_0 (sin (* y.im (log x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= 1.56e+161) {
tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= 1.56e+161) {
tmp = t_0 * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * Math.sin((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if x_46_re <= 1.56e+161: tmp = t_0 * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 * math.sin((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= 1.56e+161) tmp = Float64(t_0 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * sin(Float64(y_46_im * log(x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); tmp = 0.0; if (x_46_re <= 1.56e+161) tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = t_0 * sin((y_46_im * log(x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 1.56e+161], N[(t$95$0 * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq 1.56 \cdot 10^{+161}:\\
\;\;\;\;t_0 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < 1.56000000000000003e161Initial program 42.5%
Simplified82.9%
Taylor expanded in y.im around 0 67.5%
if 1.56000000000000003e161 < x.re Initial program 0.0%
Simplified85.3%
fma-udef85.3%
hypot-udef0.0%
*-commutative0.0%
add-cbrt-cube0.0%
pow1/30.0%
pow30.0%
fma-def0.0%
hypot-udef23.1%
Applied egg-rr23.1%
Taylor expanded in x.im around 0 23.1%
unpow1/333.8%
*-commutative33.8%
unpow233.8%
cube-unmult33.9%
fma-def33.9%
*-commutative33.9%
Simplified33.9%
Taylor expanded in y.im around inf 82.2%
Final simplification69.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re 1.9e+133)
(*
(exp (- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im)))
t_0)
(* (sin t_0) (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 t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= 1.9e+133) {
tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else {
tmp = sin(t_0) * 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 t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= 1.9e+133) {
tmp = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else {
tmp = Math.sin(t_0) * 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): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_re <= 1.9e+133: tmp = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0 else: tmp = math.sin(t_0) * 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) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= 1.9e+133) tmp = Float64(exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0); else tmp = Float64(sin(t_0) * (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) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= 1.9e+133) tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0; else tmp = sin(t_0) * (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_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, 1.9e+133], N[(N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], 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]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq 1.9 \cdot 10^{+133}:\\
\;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\sin t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < 1.9000000000000001e133Initial program 37.2%
Simplified83.9%
Taylor expanded in y.im around 0 62.8%
Taylor expanded in y.re around 0 63.4%
*-commutative63.4%
Simplified63.4%
if 1.9000000000000001e133 < y.re Initial program 38.5%
Simplified76.9%
Taylor expanded in y.im around 0 69.2%
Taylor expanded in y.im around 0 69.2%
*-commutative69.2%
*-commutative69.2%
unpow269.2%
unpow269.2%
hypot-def69.2%
Simplified69.2%
Final simplification64.0%
(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.14e+46)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.im 5.5e+74)
(* (sin t_0) (pow (hypot x.im x.re) y.re))
(* t_0 (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_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -1.14e+46) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_im <= 5.5e+74) {
tmp = sin(t_0) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -1.14e+46) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_im <= 5.5e+74) {
tmp = Math.sin(t_0) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_im <= -1.14e+46: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif y_46_im <= 5.5e+74: tmp = math.sin(t_0) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -1.14e+46) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_im <= 5.5e+74) tmp = Float64(sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_im <= -1.14e+46) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); elseif (y_46_im <= 5.5e+74) tmp = sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0 * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.14e+46], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5.5e+74], 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], N[(t$95$0 * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -1.14 \cdot 10^{+46}:\\
\;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.im \leq 5.5 \cdot 10^{+74}:\\
\;\;\;\;\sin t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.im < -1.14000000000000005e46Initial program 27.8%
Simplified70.7%
Taylor expanded in y.im around 0 70.4%
Taylor expanded in y.re around 0 70.7%
*-commutative70.7%
*-commutative70.7%
distribute-lft-neg-in70.7%
Simplified70.7%
if -1.14000000000000005e46 < y.im < 5.5000000000000003e74Initial program 40.4%
Simplified88.2%
Taylor expanded in y.im around 0 59.0%
Taylor expanded in y.im around 0 47.9%
*-commutative47.9%
*-commutative47.9%
unpow247.9%
unpow247.9%
hypot-def58.4%
Simplified58.4%
if 5.5000000000000003e74 < y.im Initial program 38.3%
Simplified80.9%
Taylor expanded in y.im around 0 70.2%
Taylor expanded in y.re around 0 62.1%
*-commutative62.1%
*-commutative62.1%
distribute-rgt-neg-in62.1%
exp-prod64.0%
Simplified64.0%
Final simplification62.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.im -1.15e+46) (not (<= y.im 5.8e+59)))
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(* (sin t_0) (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 t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -1.15e+46) || !(y_46_im <= 5.8e+59)) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = sin(t_0) * 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 t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -1.15e+46) || !(y_46_im <= 5.8e+59)) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.sin(t_0) * 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): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_im <= -1.15e+46) or not (y_46_im <= 5.8e+59): tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.sin(t_0) * 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) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -1.15e+46) || !(y_46_im <= 5.8e+59)) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(sin(t_0) * (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) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_im <= -1.15e+46) || ~((y_46_im <= 5.8e+59))) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = sin(t_0) * (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_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -1.15e+46], N[Not[LessEqual[y$46$im, 5.8e+59]], $MachinePrecision]], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -1.15 \cdot 10^{+46} \lor \neg \left(y.im \leq 5.8 \cdot 10^{+59}\right):\\
\;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -1.15e46 or 5.79999999999999981e59 < y.im Initial program 32.0%
Simplified75.0%
Taylor expanded in y.im around 0 69.0%
Taylor expanded in y.re around 0 65.4%
*-commutative65.4%
*-commutative65.4%
distribute-lft-neg-in65.4%
Simplified65.4%
if -1.15e46 < y.im < 5.79999999999999981e59Initial program 40.9%
Simplified88.7%
Taylor expanded in y.im around 0 59.7%
Taylor expanded in y.im around 0 48.6%
*-commutative48.6%
*-commutative48.6%
unpow248.6%
unpow248.6%
hypot-def59.1%
Simplified59.1%
Final simplification61.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (sin t_0)))
(if (<= y.re -2e+19)
(* t_1 (pow x.im y.re))
(if (<= y.re 1.25e+15)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(* t_1 (pow 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double tmp;
if (y_46_re <= -2e+19) {
tmp = t_1 * pow(x_46_im, y_46_re);
} else if (y_46_re <= 1.25e+15) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_1 * pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
t_1 = sin(t_0)
if (y_46re <= (-2d+19)) then
tmp = t_1 * (x_46im ** y_46re)
else if (y_46re <= 1.25d+15) then
tmp = t_0 * exp((atan2(x_46im, x_46re) * -y_46im))
else
tmp = t_1 * (x_46re ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin(t_0);
double tmp;
if (y_46_re <= -2e+19) {
tmp = t_1 * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 1.25e+15) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_1 * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.sin(t_0) tmp = 0 if y_46_re <= -2e+19: tmp = t_1 * math.pow(x_46_im, y_46_re) elif y_46_re <= 1.25e+15: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = t_1 * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) tmp = 0.0 if (y_46_re <= -2e+19) tmp = Float64(t_1 * (x_46_im ^ y_46_re)); elseif (y_46_re <= 1.25e+15) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_1 * (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) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = sin(t_0); tmp = 0.0; if (y_46_re <= -2e+19) tmp = t_1 * (x_46_im ^ y_46_re); elseif (y_46_re <= 1.25e+15) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = t_1 * (x_46_re ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -2e+19], N[(t$95$1 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.25e+15], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t_0\\
\mathbf{if}\;y.re \leq -2 \cdot 10^{+19}:\\
\;\;\;\;t_1 \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.25 \cdot 10^{+15}:\\
\;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -2e19Initial program 34.8%
Simplified82.6%
Taylor expanded in y.im around 0 84.1%
Taylor expanded in y.im around 0 78.4%
*-commutative78.4%
*-commutative78.4%
unpow278.4%
unpow278.4%
hypot-def78.4%
Simplified78.4%
Taylor expanded in x.re around 0 61.3%
if -2e19 < y.re < 1.25e15Initial program 38.8%
Simplified85.8%
Taylor expanded in y.im around 0 52.7%
Taylor expanded in y.re around 0 52.0%
*-commutative52.0%
*-commutative52.0%
distribute-lft-neg-in52.0%
Simplified52.0%
if 1.25e15 < y.re Initial program 37.3%
Simplified78.0%
Taylor expanded in y.im around 0 62.7%
Taylor expanded in y.im around 0 57.8%
*-commutative57.8%
*-commutative57.8%
unpow257.8%
unpow257.8%
hypot-def57.8%
Simplified57.8%
Taylor expanded in x.im around 0 49.5%
Final simplification53.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -4.0) (not (<= y.re 225000.0)))
(* (sin t_0) (pow x.im y.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_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -4.0) || !(y_46_re <= 225000.0)) {
tmp = sin(t_0) * pow(x_46_im, y_46_re);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
if ((y_46re <= (-4.0d0)) .or. (.not. (y_46re <= 225000.0d0))) then
tmp = sin(t_0) * (x_46im ** y_46re)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -4.0) || !(y_46_re <= 225000.0)) {
tmp = Math.sin(t_0) * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_re <= -4.0) or not (y_46_re <= 225000.0): tmp = math.sin(t_0) * math.pow(x_46_im, y_46_re) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -4.0) || !(y_46_re <= 225000.0)) tmp = Float64(sin(t_0) * (x_46_im ^ y_46_re)); else tmp = 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_re * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_re <= -4.0) || ~((y_46_re <= 225000.0))) tmp = sin(t_0) * (x_46_im ^ y_46_re); else tmp = 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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -4.0], N[Not[LessEqual[y$46$re, 225000.0]], $MachinePrecision]], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -4 \lor \neg \left(y.re \leq 225000\right):\\
\;\;\;\;\sin t_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.re < -4 or 225000 < y.re Initial program 35.9%
Simplified80.9%
Taylor expanded in y.im around 0 74.0%
Taylor expanded in y.im around 0 68.9%
*-commutative68.9%
*-commutative68.9%
unpow268.9%
unpow268.9%
hypot-def68.9%
Simplified68.9%
Taylor expanded in x.re around 0 53.2%
if -4 < y.re < 225000Initial program 38.9%
Simplified85.5%
Taylor expanded in y.im around 0 52.3%
Taylor expanded in y.im around 0 20.9%
*-commutative20.9%
*-commutative20.9%
unpow220.9%
unpow220.9%
hypot-def26.2%
Simplified26.2%
Taylor expanded in y.re around 0 25.5%
Final simplification39.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (sin t_0)))
(if (<= y.re -0.038)
(* t_1 (pow x.im y.re))
(if (<= y.re 230000.0) t_0 (* t_1 (pow 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double tmp;
if (y_46_re <= -0.038) {
tmp = t_1 * pow(x_46_im, y_46_re);
} else if (y_46_re <= 230000.0) {
tmp = t_0;
} else {
tmp = t_1 * pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
t_1 = sin(t_0)
if (y_46re <= (-0.038d0)) then
tmp = t_1 * (x_46im ** y_46re)
else if (y_46re <= 230000.0d0) then
tmp = t_0
else
tmp = t_1 * (x_46re ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin(t_0);
double tmp;
if (y_46_re <= -0.038) {
tmp = t_1 * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 230000.0) {
tmp = t_0;
} else {
tmp = t_1 * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.sin(t_0) tmp = 0 if y_46_re <= -0.038: tmp = t_1 * math.pow(x_46_im, y_46_re) elif y_46_re <= 230000.0: tmp = t_0 else: tmp = t_1 * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) tmp = 0.0 if (y_46_re <= -0.038) tmp = Float64(t_1 * (x_46_im ^ y_46_re)); elseif (y_46_re <= 230000.0) tmp = t_0; else tmp = Float64(t_1 * (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) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = sin(t_0); tmp = 0.0; if (y_46_re <= -0.038) tmp = t_1 * (x_46_im ^ y_46_re); elseif (y_46_re <= 230000.0) tmp = t_0; else tmp = t_1 * (x_46_re ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -0.038], N[(t$95$1 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 230000.0], t$95$0, N[(t$95$1 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t_0\\
\mathbf{if}\;y.re \leq -0.038:\\
\;\;\;\;t_1 \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 230000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -0.0379999999999999991Initial program 34.7%
Simplified83.3%
Taylor expanded in y.im around 0 83.3%
Taylor expanded in y.im around 0 78.0%
*-commutative78.0%
*-commutative78.0%
unpow278.0%
unpow278.0%
hypot-def78.0%
Simplified78.0%
Taylor expanded in x.re around 0 60.1%
if -0.0379999999999999991 < y.re < 2.3e5Initial program 38.9%
Simplified85.5%
Taylor expanded in y.im around 0 52.3%
Taylor expanded in y.im around 0 20.9%
*-commutative20.9%
*-commutative20.9%
unpow220.9%
unpow220.9%
hypot-def26.2%
Simplified26.2%
Taylor expanded in y.re around 0 25.5%
if 2.3e5 < y.re Initial program 37.3%
Simplified78.0%
Taylor expanded in y.im around 0 62.7%
Taylor expanded in y.im around 0 57.8%
*-commutative57.8%
*-commutative57.8%
unpow257.8%
unpow257.8%
hypot-def57.8%
Simplified57.8%
Taylor expanded in x.im around 0 49.5%
Final simplification40.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (atan2 x.im x.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * atan2(x_46_im, x_46_re);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = y_46re * atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * Math.atan2(x_46_im, x_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * math.atan2(x_46_im, x_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 37.4%
Simplified83.2%
Taylor expanded in y.im around 0 63.4%
Taylor expanded in y.im around 0 45.4%
*-commutative45.4%
*-commutative45.4%
unpow245.4%
unpow245.4%
hypot-def48.1%
Simplified48.1%
Taylor expanded in y.re around 0 14.3%
Final simplification14.3%
herbie shell --seed 2023201
(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)))))