
(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 (* 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 (cbrt (fma y.im t_1 t_0))))
(if (<= x.re 5e-285)
(* t_2 (sin (fma t_1 y.im t_0)))
(* t_2 (sin (pow (* (cbrt t_3) (cbrt (pow t_3 2.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 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 = cbrt(fma(y_46_im, t_1, t_0));
double tmp;
if (x_46_re <= 5e-285) {
tmp = t_2 * sin(fma(t_1, y_46_im, t_0));
} else {
tmp = t_2 * sin(pow((cbrt(t_3) * cbrt(pow(t_3, 2.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)) 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 = cbrt(fma(y_46_im, t_1, t_0)) tmp = 0.0 if (x_46_re <= 5e-285) tmp = Float64(t_2 * sin(fma(t_1, y_46_im, t_0))); else tmp = Float64(t_2 * sin((Float64(cbrt(t_3) * cbrt((t_3 ^ 2.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]}, 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[Power[N[(y$46$im * t$95$1 + t$95$0), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[x$46$re, 5e-285], N[(t$95$2 * N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[Power[N[(N[Power[t$95$3, 1/3], $MachinePrecision] * N[Power[N[Power[t$95$3, 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.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 := \sqrt[3]{\mathsf{fma}\left(y.im, t_1, t_0\right)}\\
\mathbf{if}\;x.re \leq 5 \cdot 10^{-285}:\\
\;\;\;\;t_2 \cdot \sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin \left({\left(\sqrt[3]{t_3} \cdot \sqrt[3]{{t_3}^{2}}\right)}^{3}\right)\\
\end{array}
\end{array}
if x.re < 5.00000000000000018e-285Initial program 38.4%
Simplified85.2%
if 5.00000000000000018e-285 < x.re Initial program 41.3%
Simplified81.3%
fma-udef81.3%
hypot-udef41.3%
*-commutative41.3%
add-cube-cbrt40.2%
pow341.9%
hypot-udef83.7%
*-commutative83.7%
fma-udef84.5%
*-commutative84.5%
Applied egg-rr84.5%
rem-cbrt-cube86.2%
pow1/342.4%
cube-mult43.3%
unpow-prod-down43.3%
pow1/380.2%
pow280.2%
Applied egg-rr80.2%
fma-def79.3%
*-commutative79.3%
fma-udef80.2%
*-commutative80.2%
unpow1/386.7%
fma-def85.9%
*-commutative85.9%
fma-udef86.7%
*-commutative86.7%
Simplified86.7%
Final simplification85.9%
(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)))))
(if (<= x.re -2.2e-105)
(* t_2 (sin t_1))
(* t_2 (sin (pow (cbrt t_1) 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 tmp;
if (x_46_re <= -2.2e-105) {
tmp = t_2 * sin(t_1);
} else {
tmp = t_2 * sin(pow(cbrt(t_1), 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))) tmp = 0.0 if (x_46_re <= -2.2e-105) tmp = Float64(t_2 * sin(t_1)); else tmp = Float64(t_2 * sin((cbrt(t_1) ^ 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]}, If[LessEqual[x$46$re, -2.2e-105], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[Power[N[Power[t$95$1, 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 := \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}\\
\mathbf{if}\;x.re \leq -2.2 \cdot 10^{-105}:\\
\;\;\;\;t_2 \cdot \sin t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin \left({\left(\sqrt[3]{t_1}\right)}^{3}\right)\\
\end{array}
\end{array}
if x.re < -2.20000000000000004e-105Initial program 34.1%
Simplified85.3%
if -2.20000000000000004e-105 < x.re Initial program 42.3%
Simplified82.6%
fma-udef82.6%
hypot-udef42.3%
*-commutative42.3%
add-cube-cbrt42.5%
pow343.7%
hypot-udef85.1%
*-commutative85.1%
fma-udef85.6%
*-commutative85.6%
Applied egg-rr85.6%
Final simplification85.5%
(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 39.7%
Simplified83.5%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2 (* y.re (atan2 x.im x.re))))
(if (or (<= y.im -1200.0) (not (<= y.im 4.1e+72)))
(* (exp (- (* t_0 y.re) t_1)) (sin t_2))
(/
(sin (fma t_0 y.im t_2))
(/ (+ t_1 1.0) (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 t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -1200.0) || !(y_46_im <= 4.1e+72)) {
tmp = exp(((t_0 * y_46_re) - t_1)) * sin(t_2);
} else {
tmp = sin(fma(t_0, y_46_im, t_2)) / ((t_1 + 1.0) / 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)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -1200.0) || !(y_46_im <= 4.1e+72)) tmp = Float64(exp(Float64(Float64(t_0 * y_46_re) - t_1)) * sin(t_2)); else tmp = Float64(sin(fma(t_0, y_46_im, t_2)) / Float64(Float64(t_1 + 1.0) / (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]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -1200.0], N[Not[LessEqual[y$46$im, 4.1e+72]], $MachinePrecision]], N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision] / N[(N[(t$95$1 + 1.0), $MachinePrecision] / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -1200 \lor \neg \left(y.im \leq 4.1 \cdot 10^{+72}\right):\\
\;\;\;\;e^{t_0 \cdot y.re - t_1} \cdot \sin t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(t_0, y.im, t_2\right)\right)}{\frac{t_1 + 1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\end{array}
\end{array}
if y.im < -1200 or 4.09999999999999963e72 < y.im Initial program 36.4%
Simplified76.1%
Taylor expanded in y.im around 0 75.3%
if -1200 < y.im < 4.09999999999999963e72Initial program 42.1%
*-commutative42.1%
exp-diff42.1%
associate-*r/42.1%
associate-/l*42.1%
fma-def42.1%
hypot-def65.3%
*-commutative65.3%
Simplified86.3%
Taylor expanded in y.im around 0 88.3%
Final simplification82.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (* y.re (atan2 x.im x.re))))
(if (or (<= y.im -10500000000.0) (not (<= y.im 4.1e+72)))
(* (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im))) (sin t_1))
(/ (sin (fma t_0 y.im t_1)) (/ 1.0 (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 t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -10500000000.0) || !(y_46_im <= 4.1e+72)) {
tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_1);
} else {
tmp = sin(fma(t_0, y_46_im, t_1)) / (1.0 / 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)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -10500000000.0) || !(y_46_im <= 4.1e+72)) tmp = Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_1)); else tmp = Float64(sin(fma(t_0, y_46_im, t_1)) / Float64(1.0 / (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]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -10500000000.0], N[Not[LessEqual[y$46$im, 4.1e+72]], $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[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] / N[(1.0 / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -10500000000 \lor \neg \left(y.im \leq 4.1 \cdot 10^{+72}\right):\\
\;\;\;\;e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(t_0, y.im, t_1\right)\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\end{array}
\end{array}
if y.im < -1.05e10 or 4.09999999999999963e72 < y.im Initial program 36.0%
Simplified75.8%
Taylor expanded in y.im around 0 75.6%
if -1.05e10 < y.im < 4.09999999999999963e72Initial program 42.3%
*-commutative42.3%
exp-diff42.3%
associate-*r/42.3%
associate-/l*42.3%
fma-def42.3%
hypot-def65.0%
*-commutative65.0%
Simplified85.5%
Taylor expanded in y.im around 0 86.9%
Final simplification82.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (exp (- (* (log (hypot x.re x.im)) y.re) t_0)))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (* t_1 (sin t_2))))
(if (<= x.re -1.65e-155)
(*
(exp (- (* y.re (log (- (/ (* -0.5 (* x.im x.im)) x.re) x.re))) t_0))
(sin (+ t_2 (* y.im (log (- x.re))))))
(if (<= x.re -4.8e-167)
(* t_1 (sin (* y.im (log (- (/ (* x.re (* x.re -0.5)) x.im) x.im)))))
(if (<= x.re -3.1e-214)
t_3
(if (<= x.re -1.42e-233)
(* t_1 (sin (* y.im (log x.im))))
(if (<= x.re 3.6e+69) t_3 (* 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = t_1 * sin(t_2);
double tmp;
if (x_46_re <= -1.65e-155) {
tmp = exp(((y_46_re * log((((-0.5 * (x_46_im * x_46_im)) / x_46_re) - x_46_re))) - t_0)) * sin((t_2 + (y_46_im * log(-x_46_re))));
} else if (x_46_re <= -4.8e-167) {
tmp = t_1 * sin((y_46_im * log((((x_46_re * (x_46_re * -0.5)) / x_46_im) - x_46_im))));
} else if (x_46_re <= -3.1e-214) {
tmp = t_3;
} else if (x_46_re <= -1.42e-233) {
tmp = t_1 * sin((y_46_im * log(x_46_im)));
} else if (x_46_re <= 3.6e+69) {
tmp = t_3;
} else {
tmp = t_1 * 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.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0));
double t_2 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_3 = t_1 * Math.sin(t_2);
double tmp;
if (x_46_re <= -1.65e-155) {
tmp = Math.exp(((y_46_re * Math.log((((-0.5 * (x_46_im * x_46_im)) / x_46_re) - x_46_re))) - t_0)) * Math.sin((t_2 + (y_46_im * Math.log(-x_46_re))));
} else if (x_46_re <= -4.8e-167) {
tmp = t_1 * Math.sin((y_46_im * Math.log((((x_46_re * (x_46_re * -0.5)) / x_46_im) - x_46_im))));
} else if (x_46_re <= -3.1e-214) {
tmp = t_3;
} else if (x_46_re <= -1.42e-233) {
tmp = t_1 * Math.sin((y_46_im * Math.log(x_46_im)));
} else if (x_46_re <= 3.6e+69) {
tmp = t_3;
} else {
tmp = t_1 * 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.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) t_2 = y_46_re * math.atan2(x_46_im, x_46_re) t_3 = t_1 * math.sin(t_2) tmp = 0 if x_46_re <= -1.65e-155: tmp = math.exp(((y_46_re * math.log((((-0.5 * (x_46_im * x_46_im)) / x_46_re) - x_46_re))) - t_0)) * math.sin((t_2 + (y_46_im * math.log(-x_46_re)))) elif x_46_re <= -4.8e-167: tmp = t_1 * math.sin((y_46_im * math.log((((x_46_re * (x_46_re * -0.5)) / x_46_im) - x_46_im)))) elif x_46_re <= -3.1e-214: tmp = t_3 elif x_46_re <= -1.42e-233: tmp = t_1 * math.sin((y_46_im * math.log(x_46_im))) elif x_46_re <= 3.6e+69: tmp = t_3 else: tmp = t_1 * 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 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = Float64(t_1 * sin(t_2)) tmp = 0.0 if (x_46_re <= -1.65e-155) tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(Float64(Float64(-0.5 * Float64(x_46_im * x_46_im)) / x_46_re) - x_46_re))) - t_0)) * sin(Float64(t_2 + Float64(y_46_im * log(Float64(-x_46_re)))))); elseif (x_46_re <= -4.8e-167) tmp = Float64(t_1 * sin(Float64(y_46_im * log(Float64(Float64(Float64(x_46_re * Float64(x_46_re * -0.5)) / x_46_im) - x_46_im))))); elseif (x_46_re <= -3.1e-214) tmp = t_3; elseif (x_46_re <= -1.42e-233) tmp = Float64(t_1 * sin(Float64(y_46_im * log(x_46_im)))); elseif (x_46_re <= 3.6e+69) tmp = t_3; else tmp = Float64(t_1 * 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 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)); t_2 = y_46_re * atan2(x_46_im, x_46_re); t_3 = t_1 * sin(t_2); tmp = 0.0; if (x_46_re <= -1.65e-155) tmp = exp(((y_46_re * log((((-0.5 * (x_46_im * x_46_im)) / x_46_re) - x_46_re))) - t_0)) * sin((t_2 + (y_46_im * log(-x_46_re)))); elseif (x_46_re <= -4.8e-167) tmp = t_1 * sin((y_46_im * log((((x_46_re * (x_46_re * -0.5)) / x_46_im) - x_46_im)))); elseif (x_46_re <= -3.1e-214) tmp = t_3; elseif (x_46_re <= -1.42e-233) tmp = t_1 * sin((y_46_im * log(x_46_im))); elseif (x_46_re <= 3.6e+69) tmp = t_3; else tmp = t_1 * 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $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] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -1.65e-155], N[(N[Exp[N[(N[(y$46$re * N[Log[N[(N[(N[(-0.5 * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / x$46$re), $MachinePrecision] - x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$2 + N[(y$46$im * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, -4.8e-167], N[(t$95$1 * N[Sin[N[(y$46$im * N[Log[N[(N[(N[(x$46$re * N[(x$46$re * -0.5), $MachinePrecision]), $MachinePrecision] / x$46$im), $MachinePrecision] - x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, -3.1e-214], t$95$3, If[LessEqual[x$46$re, -1.42e-233], N[(t$95$1 * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 3.6e+69], t$95$3, 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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0}\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := t_1 \cdot \sin t_2\\
\mathbf{if}\;x.re \leq -1.65 \cdot 10^{-155}:\\
\;\;\;\;e^{y.re \cdot \log \left(\frac{-0.5 \cdot \left(x.im \cdot x.im\right)}{x.re} - x.re\right) - t_0} \cdot \sin \left(t_2 + y.im \cdot \log \left(-x.re\right)\right)\\
\mathbf{elif}\;x.re \leq -4.8 \cdot 10^{-167}:\\
\;\;\;\;t_1 \cdot \sin \left(y.im \cdot \log \left(\frac{x.re \cdot \left(x.re \cdot -0.5\right)}{x.im} - x.im\right)\right)\\
\mathbf{elif}\;x.re \leq -3.1 \cdot 10^{-214}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x.re \leq -1.42 \cdot 10^{-233}:\\
\;\;\;\;t_1 \cdot \sin \left(y.im \cdot \log x.im\right)\\
\mathbf{elif}\;x.re \leq 3.6 \cdot 10^{+69}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -1.64999999999999993e-155Initial program 35.8%
Taylor expanded in x.re around -inf 34.7%
mul-1-neg34.7%
unsub-neg34.7%
associate-*r/34.7%
unpow234.7%
Simplified34.7%
Taylor expanded in x.re around -inf 73.1%
mul-1-neg73.1%
Simplified73.1%
if -1.64999999999999993e-155 < x.re < -4.79999999999999986e-167Initial program 40.0%
Simplified79.7%
Taylor expanded in y.im around inf 60.0%
+-commutative60.0%
unpow260.0%
unpow260.0%
Simplified60.0%
Taylor expanded in x.im around -inf 99.7%
+-commutative99.7%
mul-1-neg99.7%
unsub-neg99.7%
associate-*r/99.7%
unpow299.7%
associate-*r*99.7%
Simplified99.7%
if -4.79999999999999986e-167 < x.re < -3.10000000000000004e-214 or -1.42e-233 < x.re < 3.6000000000000003e69Initial program 48.7%
Simplified86.0%
Taylor expanded in y.im around 0 75.3%
if -3.10000000000000004e-214 < x.re < -1.42e-233Initial program 40.0%
Simplified80.0%
Taylor expanded in y.im around inf 40.0%
+-commutative40.0%
unpow240.0%
unpow240.0%
Simplified40.0%
Taylor expanded in x.re around 0 80.0%
if 3.6000000000000003e69 < x.re Initial program 26.2%
Simplified78.9%
Taylor expanded in y.im around inf 28.5%
+-commutative28.5%
unpow228.5%
unpow228.5%
Simplified28.5%
Taylor expanded in x.im around 0 81.2%
Final simplification76.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (log (/ -1.0 x.re)))
(t_2 (* y.im (* t_1 (- (exp (- (* y.re (- t_1)) t_0))))))
(t_3 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.re -4.5e+106)
t_2
(if (<= x.re -5.2e-146)
(*
t_3
(exp (- (* y.re (log (- (/ (* -0.5 (* x.im x.im)) x.re) x.re))) t_0)))
(if (<= x.re -2.7e-177)
t_2
(if (<= x.re 7e-286)
(* t_3 (pow (hypot x.im x.re) y.re))
(*
(exp (- (* (log (hypot x.re x.im)) y.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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log((-1.0 / x_46_re));
double t_2 = y_46_im * (t_1 * -exp(((y_46_re * -t_1) - t_0)));
double t_3 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -4.5e+106) {
tmp = t_2;
} else if (x_46_re <= -5.2e-146) {
tmp = t_3 * exp(((y_46_re * log((((-0.5 * (x_46_im * x_46_im)) / x_46_re) - x_46_re))) - t_0));
} else if (x_46_re <= -2.7e-177) {
tmp = t_2;
} else if (x_46_re <= 7e-286) {
tmp = t_3 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - 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.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.log((-1.0 / x_46_re));
double t_2 = y_46_im * (t_1 * -Math.exp(((y_46_re * -t_1) - t_0)));
double t_3 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -4.5e+106) {
tmp = t_2;
} else if (x_46_re <= -5.2e-146) {
tmp = t_3 * Math.exp(((y_46_re * Math.log((((-0.5 * (x_46_im * x_46_im)) / x_46_re) - x_46_re))) - t_0));
} else if (x_46_re <= -2.7e-177) {
tmp = t_2;
} else if (x_46_re <= 7e-286) {
tmp = t_3 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - 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.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.log((-1.0 / x_46_re)) t_2 = y_46_im * (t_1 * -math.exp(((y_46_re * -t_1) - t_0))) t_3 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= -4.5e+106: tmp = t_2 elif x_46_re <= -5.2e-146: tmp = t_3 * math.exp(((y_46_re * math.log((((-0.5 * (x_46_im * x_46_im)) / x_46_re) - x_46_re))) - t_0)) elif x_46_re <= -2.7e-177: tmp = t_2 elif x_46_re <= 7e-286: tmp = t_3 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - 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 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = log(Float64(-1.0 / x_46_re)) t_2 = Float64(y_46_im * Float64(t_1 * Float64(-exp(Float64(Float64(y_46_re * Float64(-t_1)) - t_0))))) t_3 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -4.5e+106) tmp = t_2; elseif (x_46_re <= -5.2e-146) tmp = Float64(t_3 * exp(Float64(Float64(y_46_re * log(Float64(Float64(Float64(-0.5 * Float64(x_46_im * x_46_im)) / x_46_re) - x_46_re))) - t_0))); elseif (x_46_re <= -2.7e-177) tmp = t_2; elseif (x_46_re <= 7e-286) tmp = Float64(t_3 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - 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 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = log((-1.0 / x_46_re)); t_2 = y_46_im * (t_1 * -exp(((y_46_re * -t_1) - t_0))); t_3 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= -4.5e+106) tmp = t_2; elseif (x_46_re <= -5.2e-146) tmp = t_3 * exp(((y_46_re * log((((-0.5 * (x_46_im * x_46_im)) / x_46_re) - x_46_re))) - t_0)); elseif (x_46_re <= -2.7e-177) tmp = t_2; elseif (x_46_re <= 7e-286) tmp = t_3 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[(t$95$1 * (-N[Exp[N[(N[(y$46$re * (-t$95$1)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -4.5e+106], t$95$2, If[LessEqual[x$46$re, -5.2e-146], N[(t$95$3 * N[Exp[N[(N[(y$46$re * N[Log[N[(N[(N[(-0.5 * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / x$46$re), $MachinePrecision] - x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, -2.7e-177], t$95$2, If[LessEqual[x$46$re, 7e-286], N[(t$95$3 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\frac{-1}{x.re}\right)\\
t_2 := y.im \cdot \left(t_1 \cdot \left(-e^{y.re \cdot \left(-t_1\right) - t_0}\right)\right)\\
t_3 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -4.5 \cdot 10^{+106}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x.re \leq -5.2 \cdot 10^{-146}:\\
\;\;\;\;t_3 \cdot e^{y.re \cdot \log \left(\frac{-0.5 \cdot \left(x.im \cdot x.im\right)}{x.re} - x.re\right) - t_0}\\
\mathbf{elif}\;x.re \leq -2.7 \cdot 10^{-177}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x.re \leq 7 \cdot 10^{-286}:\\
\;\;\;\;t_3 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -4.4999999999999997e106 or -5.19999999999999974e-146 < x.re < -2.7000000000000002e-177Initial program 8.3%
Simplified77.0%
Taylor expanded in y.im around inf 12.5%
+-commutative12.5%
unpow212.5%
unpow212.5%
Simplified12.5%
Taylor expanded in x.re around -inf 43.8%
fma-def43.8%
*-commutative43.8%
*-commutative43.8%
unpow243.8%
unpow243.8%
Simplified43.8%
Taylor expanded in y.im around 0 51.7%
fma-def51.7%
unpow251.7%
unpow251.7%
mul-1-neg51.7%
Simplified51.7%
Taylor expanded in x.re around -inf 74.0%
mul-1-neg74.0%
mul-1-neg74.0%
Simplified74.0%
if -4.4999999999999997e106 < x.re < -5.19999999999999974e-146Initial program 59.9%
Taylor expanded in x.re around -inf 58.2%
mul-1-neg58.2%
unsub-neg58.2%
associate-*r/58.2%
unpow258.2%
Simplified58.2%
Taylor expanded in y.im around 0 66.2%
if -2.7000000000000002e-177 < x.re < 6.99999999999999977e-286Initial program 44.9%
Simplified92.3%
Taylor expanded in y.im around 0 66.0%
Taylor expanded in y.im around 0 48.8%
*-commutative48.8%
unpow248.8%
unpow248.8%
hypot-def51.4%
Simplified51.4%
if 6.99999999999999977e-286 < x.re Initial program 41.3%
Simplified81.3%
Taylor expanded in y.im around inf 36.7%
+-commutative36.7%
unpow236.7%
unpow236.7%
Simplified36.7%
Taylor expanded in x.im around 0 74.8%
Final simplification69.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (exp (- (* (log (hypot x.re x.im)) y.re) t_0)))
(t_2 (log (/ -1.0 x.re))))
(if (<= x.re -7.5e+119)
(* y.im (* t_2 (- (exp (- (* y.re (- t_2)) t_0)))))
(if (<= x.re -1.35e-40)
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(if (<= x.re -1.8e-180)
(* t_1 (sin (* y.im (log (- x.im)))))
(if (<= x.re 1e-309)
(* t_1 (sin (* y.im (log x.im))))
(* 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0));
double t_2 = log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -7.5e+119) {
tmp = y_46_im * (t_2 * -exp(((y_46_re * -t_2) - t_0)));
} else if (x_46_re <= -1.35e-40) {
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 (x_46_re <= -1.8e-180) {
tmp = t_1 * sin((y_46_im * log(-x_46_im)));
} else if (x_46_re <= 1e-309) {
tmp = t_1 * sin((y_46_im * log(x_46_im)));
} else {
tmp = t_1 * 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.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0));
double t_2 = Math.log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -7.5e+119) {
tmp = y_46_im * (t_2 * -Math.exp(((y_46_re * -t_2) - t_0)));
} else if (x_46_re <= -1.35e-40) {
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 (x_46_re <= -1.8e-180) {
tmp = t_1 * Math.sin((y_46_im * Math.log(-x_46_im)));
} else if (x_46_re <= 1e-309) {
tmp = t_1 * Math.sin((y_46_im * Math.log(x_46_im)));
} else {
tmp = t_1 * 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.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) t_2 = math.log((-1.0 / x_46_re)) tmp = 0 if x_46_re <= -7.5e+119: tmp = y_46_im * (t_2 * -math.exp(((y_46_re * -t_2) - t_0))) elif x_46_re <= -1.35e-40: 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 x_46_re <= -1.8e-180: tmp = t_1 * math.sin((y_46_im * math.log(-x_46_im))) elif x_46_re <= 1e-309: tmp = t_1 * math.sin((y_46_im * math.log(x_46_im))) else: tmp = t_1 * 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 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) t_2 = log(Float64(-1.0 / x_46_re)) tmp = 0.0 if (x_46_re <= -7.5e+119) tmp = Float64(y_46_im * Float64(t_2 * Float64(-exp(Float64(Float64(y_46_re * Float64(-t_2)) - t_0))))); elseif (x_46_re <= -1.35e-40) 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 (x_46_re <= -1.8e-180) tmp = Float64(t_1 * sin(Float64(y_46_im * log(Float64(-x_46_im))))); elseif (x_46_re <= 1e-309) tmp = Float64(t_1 * sin(Float64(y_46_im * log(x_46_im)))); else tmp = Float64(t_1 * 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 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)); t_2 = log((-1.0 / x_46_re)); tmp = 0.0; if (x_46_re <= -7.5e+119) tmp = y_46_im * (t_2 * -exp(((y_46_re * -t_2) - t_0))); elseif (x_46_re <= -1.35e-40) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (x_46_re <= -1.8e-180) tmp = t_1 * sin((y_46_im * log(-x_46_im))); elseif (x_46_re <= 1e-309) tmp = t_1 * sin((y_46_im * log(x_46_im))); else tmp = t_1 * 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $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] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -7.5e+119], N[(y$46$im * N[(t$95$2 * (-N[Exp[N[(N[(y$46$re * (-t$95$2)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, -1.35e-40], 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[x$46$re, -1.8e-180], N[(t$95$1 * N[Sin[N[(y$46$im * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1e-309], N[(t$95$1 * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0}\\
t_2 := \log \left(\frac{-1}{x.re}\right)\\
\mathbf{if}\;x.re \leq -7.5 \cdot 10^{+119}:\\
\;\;\;\;y.im \cdot \left(t_2 \cdot \left(-e^{y.re \cdot \left(-t_2\right) - t_0}\right)\right)\\
\mathbf{elif}\;x.re \leq -1.35 \cdot 10^{-40}:\\
\;\;\;\;\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}\;x.re \leq -1.8 \cdot 10^{-180}:\\
\;\;\;\;t_1 \cdot \sin \left(y.im \cdot \log \left(-x.im\right)\right)\\
\mathbf{elif}\;x.re \leq 10^{-309}:\\
\;\;\;\;t_1 \cdot \sin \left(y.im \cdot \log x.im\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -7.500000000000001e119Initial program 0.0%
Simplified78.9%
Taylor expanded in y.im around inf 2.6%
+-commutative2.6%
unpow22.6%
unpow22.6%
Simplified2.6%
Taylor expanded in x.re around -inf 49.4%
fma-def49.4%
*-commutative49.4%
*-commutative49.4%
unpow249.4%
unpow249.4%
Simplified49.4%
Taylor expanded in y.im around 0 60.0%
fma-def60.0%
unpow260.0%
unpow260.0%
mul-1-neg60.0%
Simplified60.0%
Taylor expanded in x.re around -inf 76.7%
mul-1-neg76.7%
mul-1-neg76.7%
Simplified76.7%
if -7.500000000000001e119 < x.re < -1.35e-40Initial program 56.2%
Simplified87.5%
Taylor expanded in y.im around 0 78.4%
Taylor expanded in y.im around 0 66.4%
*-commutative66.4%
unpow266.4%
unpow266.4%
hypot-def72.5%
Simplified72.5%
if -1.35e-40 < x.re < -1.8e-180Initial program 58.8%
Simplified82.2%
Taylor expanded in y.im around inf 53.5%
+-commutative53.5%
unpow253.5%
unpow253.5%
Simplified53.5%
Taylor expanded in x.im around -inf 62.1%
mul-1-neg62.1%
Simplified62.1%
if -1.8e-180 < x.re < 1.000000000000002e-309Initial program 43.2%
Simplified89.8%
Taylor expanded in y.im around inf 33.5%
+-commutative33.5%
unpow233.5%
unpow233.5%
Simplified33.5%
Taylor expanded in x.re around 0 54.2%
if 1.000000000000002e-309 < x.re Initial program 41.5%
Simplified82.7%
Taylor expanded in y.im around inf 35.6%
+-commutative35.6%
unpow235.6%
unpow235.6%
Simplified35.6%
Taylor expanded in x.im around 0 72.7%
Final simplification69.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (log (/ -1.0 x.re)))
(t_2 (exp (- (* (log (hypot x.re x.im)) y.re) t_0))))
(if (<= x.re -3.4e+115)
(* y.im (* t_1 (- (exp (- (* y.re (- t_1)) t_0)))))
(if (<= x.re 1.2e+70)
(* t_2 (sin (* y.re (atan2 x.im x.re))))
(* t_2 (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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log((-1.0 / x_46_re));
double t_2 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0));
double tmp;
if (x_46_re <= -3.4e+115) {
tmp = y_46_im * (t_1 * -exp(((y_46_re * -t_1) - t_0)));
} else if (x_46_re <= 1.2e+70) {
tmp = t_2 * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = t_2 * 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.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.log((-1.0 / x_46_re));
double t_2 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0));
double tmp;
if (x_46_re <= -3.4e+115) {
tmp = y_46_im * (t_1 * -Math.exp(((y_46_re * -t_1) - t_0)));
} else if (x_46_re <= 1.2e+70) {
tmp = t_2 * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_2 * 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.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.log((-1.0 / x_46_re)) t_2 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) tmp = 0 if x_46_re <= -3.4e+115: tmp = y_46_im * (t_1 * -math.exp(((y_46_re * -t_1) - t_0))) elif x_46_re <= 1.2e+70: tmp = t_2 * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = t_2 * 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 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = log(Float64(-1.0 / x_46_re)) t_2 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) tmp = 0.0 if (x_46_re <= -3.4e+115) tmp = Float64(y_46_im * Float64(t_1 * Float64(-exp(Float64(Float64(y_46_re * Float64(-t_1)) - t_0))))); elseif (x_46_re <= 1.2e+70) tmp = Float64(t_2 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(t_2 * 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 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = log((-1.0 / x_46_re)); t_2 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)); tmp = 0.0; if (x_46_re <= -3.4e+115) tmp = y_46_im * (t_1 * -exp(((y_46_re * -t_1) - t_0))); elseif (x_46_re <= 1.2e+70) tmp = t_2 * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = t_2 * 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -3.4e+115], N[(y$46$im * N[(t$95$1 * (-N[Exp[N[(N[(y$46$re * (-t$95$1)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.2e+70], N[(t$95$2 * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\frac{-1}{x.re}\right)\\
t_2 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0}\\
\mathbf{if}\;x.re \leq -3.4 \cdot 10^{+115}:\\
\;\;\;\;y.im \cdot \left(t_1 \cdot \left(-e^{y.re \cdot \left(-t_1\right) - t_0}\right)\right)\\
\mathbf{elif}\;x.re \leq 1.2 \cdot 10^{+70}:\\
\;\;\;\;t_2 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -3.4000000000000001e115Initial program 0.0%
Simplified78.9%
Taylor expanded in y.im around inf 2.6%
+-commutative2.6%
unpow22.6%
unpow22.6%
Simplified2.6%
Taylor expanded in x.re around -inf 49.4%
fma-def49.4%
*-commutative49.4%
*-commutative49.4%
unpow249.4%
unpow249.4%
Simplified49.4%
Taylor expanded in y.im around 0 60.0%
fma-def60.0%
unpow260.0%
unpow260.0%
mul-1-neg60.0%
Simplified60.0%
Taylor expanded in x.re around -inf 76.7%
mul-1-neg76.7%
mul-1-neg76.7%
Simplified76.7%
if -3.4000000000000001e115 < x.re < 1.19999999999999993e70Initial program 51.8%
Simplified85.6%
Taylor expanded in y.im around 0 71.9%
if 1.19999999999999993e70 < x.re Initial program 26.2%
Simplified78.9%
Taylor expanded in y.im around inf 28.5%
+-commutative28.5%
unpow228.5%
unpow228.5%
Simplified28.5%
Taylor expanded in x.im around 0 81.2%
Final simplification74.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (exp (- (* (log (hypot x.re x.im)) y.re) t_0))))
(if (<= x.im -4e-310)
(* t_1 (* y.im (log (- x.im))))
(if (<= x.im 1.9e-6)
(* t_1 (sin (* y.im (log x.im))))
(*
(sin (* y.re (atan2 x.im x.re)))
(exp (- (* y.re (log x.im)) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0));
double tmp;
if (x_46_im <= -4e-310) {
tmp = t_1 * (y_46_im * log(-x_46_im));
} else if (x_46_im <= 1.9e-6) {
tmp = t_1 * sin((y_46_im * log(x_46_im)));
} else {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0));
double tmp;
if (x_46_im <= -4e-310) {
tmp = t_1 * (y_46_im * Math.log(-x_46_im));
} else if (x_46_im <= 1.9e-6) {
tmp = t_1 * Math.sin((y_46_im * Math.log(x_46_im)));
} else {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) tmp = 0 if x_46_im <= -4e-310: tmp = t_1 * (y_46_im * math.log(-x_46_im)) elif x_46_im <= 1.9e-6: tmp = t_1 * math.sin((y_46_im * math.log(x_46_im))) else: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) tmp = 0.0 if (x_46_im <= -4e-310) tmp = Float64(t_1 * Float64(y_46_im * log(Float64(-x_46_im)))); elseif (x_46_im <= 1.9e-6) tmp = Float64(t_1 * sin(Float64(y_46_im * log(x_46_im)))); else tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)); tmp = 0.0; if (x_46_im <= -4e-310) tmp = t_1 * (y_46_im * log(-x_46_im)); elseif (x_46_im <= 1.9e-6) tmp = t_1 * sin((y_46_im * log(x_46_im))); else tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -4e-310], N[(t$95$1 * N[(y$46$im * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.9e-6], N[(t$95$1 * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0}\\
\mathbf{if}\;x.im \leq -4 \cdot 10^{-310}:\\
\;\;\;\;t_1 \cdot \left(y.im \cdot \log \left(-x.im\right)\right)\\
\mathbf{elif}\;x.im \leq 1.9 \cdot 10^{-6}:\\
\;\;\;\;t_1 \cdot \sin \left(y.im \cdot \log x.im\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -3.999999999999988e-310Initial program 40.4%
Simplified83.2%
Taylor expanded in y.im around inf 35.7%
+-commutative35.7%
unpow235.7%
unpow235.7%
Simplified35.7%
Taylor expanded in x.im around -inf 63.1%
mul-1-neg63.1%
Simplified63.1%
Taylor expanded in y.im around 0 65.2%
if -3.999999999999988e-310 < x.im < 1.9e-6Initial program 40.9%
Simplified81.5%
Taylor expanded in y.im around inf 37.7%
+-commutative37.7%
unpow237.7%
unpow237.7%
Simplified37.7%
Taylor expanded in x.re around 0 60.7%
if 1.9e-6 < x.im Initial program 36.9%
Simplified86.0%
Taylor expanded in y.im around 0 68.1%
Taylor expanded in x.re around 0 68.1%
Final simplification64.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -4e-310)
(* (exp (- (* (log (hypot x.re x.im)) y.re) t_0)) (* y.im (log (- x.im))))
(* (sin (* y.re (atan2 x.im x.re))) (exp (- (* y.re (log x.im)) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -4e-310) {
tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * (y_46_im * log(-x_46_im));
} else {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -4e-310) {
tmp = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * (y_46_im * Math.log(-x_46_im));
} else {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_im <= -4e-310: tmp = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * (y_46_im * math.log(-x_46_im)) else: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_im <= -4e-310) tmp = Float64(exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * Float64(y_46_im * log(Float64(-x_46_im)))); else tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_im <= -4e-310) tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * (y_46_im * log(-x_46_im)); else tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -4e-310], N[(N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[(y$46$im * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -4 \cdot 10^{-310}:\\
\;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0} \cdot \left(y.im \cdot \log \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -3.999999999999988e-310Initial program 40.4%
Simplified83.2%
Taylor expanded in y.im around inf 35.7%
+-commutative35.7%
unpow235.7%
unpow235.7%
Simplified35.7%
Taylor expanded in x.im around -inf 63.1%
mul-1-neg63.1%
Simplified63.1%
Taylor expanded in y.im around 0 65.2%
if -3.999999999999988e-310 < x.im Initial program 38.9%
Simplified83.8%
Taylor expanded in y.im around 0 68.4%
Taylor expanded in x.re around 0 61.0%
Final simplification63.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ -1.0 x.re)))
(t_1 (exp (* y.im (- (atan2 x.im x.re)))))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (* (sin t_2) (pow (hypot x.im x.re) y.re))))
(if (<= y.re -7.2e-19)
t_3
(if (<= y.re -9.5e-185)
(* (sqrt (pow t_2 2.0)) t_1)
(if (<= y.re -1.5e-253)
(*
y.im
(* t_0 (- (exp (- (* y.re (- t_0)) (* (atan2 x.im x.re) y.im))))))
(if (<= y.re 8000000000.0) (* t_2 t_1) t_3))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log((-1.0 / x_46_re));
double t_1 = exp((y_46_im * -atan2(x_46_im, x_46_re)));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = sin(t_2) * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -7.2e-19) {
tmp = t_3;
} else if (y_46_re <= -9.5e-185) {
tmp = sqrt(pow(t_2, 2.0)) * t_1;
} else if (y_46_re <= -1.5e-253) {
tmp = y_46_im * (t_0 * -exp(((y_46_re * -t_0) - (atan2(x_46_im, x_46_re) * y_46_im))));
} else if (y_46_re <= 8000000000.0) {
tmp = t_2 * t_1;
} else {
tmp = t_3;
}
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((-1.0 / x_46_re));
double t_1 = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
double t_2 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_3 = Math.sin(t_2) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -7.2e-19) {
tmp = t_3;
} else if (y_46_re <= -9.5e-185) {
tmp = Math.sqrt(Math.pow(t_2, 2.0)) * t_1;
} else if (y_46_re <= -1.5e-253) {
tmp = y_46_im * (t_0 * -Math.exp(((y_46_re * -t_0) - (Math.atan2(x_46_im, x_46_re) * y_46_im))));
} else if (y_46_re <= 8000000000.0) {
tmp = t_2 * t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log((-1.0 / x_46_re)) t_1 = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) t_2 = y_46_re * math.atan2(x_46_im, x_46_re) t_3 = math.sin(t_2) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -7.2e-19: tmp = t_3 elif y_46_re <= -9.5e-185: tmp = math.sqrt(math.pow(t_2, 2.0)) * t_1 elif y_46_re <= -1.5e-253: tmp = y_46_im * (t_0 * -math.exp(((y_46_re * -t_0) - (math.atan2(x_46_im, x_46_re) * y_46_im)))) elif y_46_re <= 8000000000.0: tmp = t_2 * t_1 else: tmp = t_3 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(Float64(-1.0 / x_46_re)) t_1 = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = Float64(sin(t_2) * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -7.2e-19) tmp = t_3; elseif (y_46_re <= -9.5e-185) tmp = Float64(sqrt((t_2 ^ 2.0)) * t_1); elseif (y_46_re <= -1.5e-253) tmp = Float64(y_46_im * Float64(t_0 * Float64(-exp(Float64(Float64(y_46_re * Float64(-t_0)) - Float64(atan(x_46_im, x_46_re) * y_46_im)))))); elseif (y_46_re <= 8000000000.0) tmp = Float64(t_2 * t_1); else tmp = t_3; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log((-1.0 / x_46_re)); t_1 = exp((y_46_im * -atan2(x_46_im, x_46_re))); t_2 = y_46_re * atan2(x_46_im, x_46_re); t_3 = sin(t_2) * (hypot(x_46_im, x_46_re) ^ y_46_re); tmp = 0.0; if (y_46_re <= -7.2e-19) tmp = t_3; elseif (y_46_re <= -9.5e-185) tmp = sqrt((t_2 ^ 2.0)) * t_1; elseif (y_46_re <= -1.5e-253) tmp = y_46_im * (t_0 * -exp(((y_46_re * -t_0) - (atan2(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_re <= 8000000000.0) tmp = t_2 * t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[t$95$2], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.2e-19], t$95$3, If[LessEqual[y$46$re, -9.5e-185], N[(N[Sqrt[N[Power[t$95$2, 2.0], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, -1.5e-253], N[(y$46$im * N[(t$95$0 * (-N[Exp[N[(N[(y$46$re * (-t$95$0)), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8000000000.0], N[(t$95$2 * t$95$1), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.re}\right)\\
t_1 := e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \sin t_2 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -7.2 \cdot 10^{-19}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.re \leq -9.5 \cdot 10^{-185}:\\
\;\;\;\;\sqrt{{t_2}^{2}} \cdot t_1\\
\mathbf{elif}\;y.re \leq -1.5 \cdot 10^{-253}:\\
\;\;\;\;y.im \cdot \left(t_0 \cdot \left(-e^{y.re \cdot \left(-t_0\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)\right)\\
\mathbf{elif}\;y.re \leq 8000000000:\\
\;\;\;\;t_2 \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y.re < -7.2000000000000002e-19 or 8e9 < y.re Initial program 37.1%
Simplified80.7%
Taylor expanded in y.im around 0 78.6%
Taylor expanded in y.im around 0 72.3%
*-commutative72.3%
unpow272.3%
unpow272.3%
hypot-def72.3%
Simplified72.3%
if -7.2000000000000002e-19 < y.re < -9.50000000000000042e-185Initial program 51.8%
Simplified92.5%
Taylor expanded in y.im around 0 49.4%
Taylor expanded in y.re around 0 49.4%
*-commutative49.4%
distribute-rgt-neg-in49.4%
Simplified49.4%
*-commutative49.4%
add-sqr-sqrt41.3%
sqrt-unprod57.0%
pow257.0%
Applied egg-rr57.0%
if -9.50000000000000042e-185 < y.re < -1.5000000000000001e-253Initial program 42.5%
Simplified81.2%
Taylor expanded in y.im around inf 37.2%
+-commutative37.2%
unpow237.2%
unpow237.2%
Simplified37.2%
Taylor expanded in x.re around -inf 11.0%
fma-def11.0%
*-commutative11.0%
*-commutative11.0%
unpow211.0%
unpow211.0%
Simplified11.0%
Taylor expanded in y.im around 0 11.3%
fma-def11.3%
unpow211.3%
unpow211.3%
mul-1-neg11.3%
Simplified11.3%
Taylor expanded in x.re around -inf 35.7%
mul-1-neg35.7%
mul-1-neg35.7%
Simplified35.7%
if -1.5000000000000001e-253 < y.re < 8e9Initial program 39.4%
Simplified86.1%
Taylor expanded in y.im around 0 62.3%
Taylor expanded in y.re around 0 60.9%
*-commutative60.9%
distribute-rgt-neg-in60.9%
Simplified60.9%
Final simplification64.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 -12.0) (not (<= y.re 8400000000.0)))
(* (sin t_0) (pow (hypot x.im x.re) y.re))
(* t_0 (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_re <= -12.0) || !(y_46_re <= 8400000000.0)) {
tmp = sin(t_0) * pow(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)));
}
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 <= -12.0) || !(y_46_re <= 8400000000.0)) {
tmp = Math.sin(t_0) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * 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_re <= -12.0) or not (y_46_re <= 8400000000.0): tmp = math.sin(t_0) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * 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_re <= -12.0) || !(y_46_re <= 8400000000.0)) tmp = Float64(sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * exp(Float64(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_re <= -12.0) || ~((y_46_re <= 8400000000.0))) 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[Or[LessEqual[y$46$re, -12.0], N[Not[LessEqual[y$46$re, 8400000000.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], N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / 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}\\
\mathbf{if}\;y.re \leq -12 \lor \neg \left(y.re \leq 8400000000\right):\\
\;\;\;\;\sin t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -12 or 8.4e9 < y.re Initial program 36.8%
Simplified80.9%
Taylor expanded in y.im around 0 80.1%
Taylor expanded in y.im around 0 73.6%
*-commutative73.6%
unpow273.6%
unpow273.6%
hypot-def73.6%
Simplified73.6%
if -12 < y.re < 8.4e9Initial program 43.0%
Simplified86.4%
Taylor expanded in y.im around 0 51.7%
Taylor expanded in y.re around 0 51.6%
*-commutative51.6%
distribute-rgt-neg-in51.6%
Simplified51.6%
Final simplification63.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (sin t_0)))
(if (<= y.re -1.02e+28)
(* t_1 (pow x.re y.re))
(if (<= y.re 1.06e+16)
(* t_0 (exp (* y.im (- (atan2 x.im x.re)))))
(* t_1 (pow 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double tmp;
if (y_46_re <= -1.02e+28) {
tmp = t_1 * pow(x_46_re, y_46_re);
} else if (y_46_re <= 1.06e+16) {
tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = t_1 * pow(x_46_im, 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 <= (-1.02d+28)) then
tmp = t_1 * (x_46re ** y_46re)
else if (y_46re <= 1.06d+16) then
tmp = t_0 * exp((y_46im * -atan2(x_46im, x_46re)))
else
tmp = t_1 * (x_46im ** 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 <= -1.02e+28) {
tmp = t_1 * Math.pow(x_46_re, y_46_re);
} else if (y_46_re <= 1.06e+16) {
tmp = t_0 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_1 * Math.pow(x_46_im, 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 <= -1.02e+28: tmp = t_1 * math.pow(x_46_re, y_46_re) elif y_46_re <= 1.06e+16: tmp = t_0 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) else: tmp = t_1 * math.pow(x_46_im, 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 <= -1.02e+28) tmp = Float64(t_1 * (x_46_re ^ y_46_re)); elseif (y_46_re <= 1.06e+16) tmp = Float64(t_0 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(t_1 * (x_46_im ^ 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 <= -1.02e+28) tmp = t_1 * (x_46_re ^ y_46_re); elseif (y_46_re <= 1.06e+16) tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re))); else tmp = t_1 * (x_46_im ^ 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, -1.02e+28], N[(t$95$1 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.06e+16], N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[x$46$im, 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 -1.02 \cdot 10^{+28}:\\
\;\;\;\;t_1 \cdot {x.re}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.06 \cdot 10^{+16}:\\
\;\;\;\;t_0 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.02e28Initial program 38.1%
Simplified85.7%
Taylor expanded in y.im around 0 87.3%
Taylor expanded in y.im around 0 82.6%
*-commutative82.6%
unpow282.6%
unpow282.6%
hypot-def82.6%
Simplified82.6%
Taylor expanded in x.im around 0 68.6%
if -1.02e28 < y.re < 1.06e16Initial program 42.1%
Simplified86.2%
Taylor expanded in y.im around 0 53.6%
Taylor expanded in y.re around 0 51.2%
*-commutative51.2%
distribute-rgt-neg-in51.2%
Simplified51.2%
if 1.06e16 < y.re Initial program 36.8%
Simplified76.5%
Taylor expanded in y.im around 0 72.1%
Taylor expanded in y.im around 0 64.8%
*-commutative64.8%
unpow264.8%
unpow264.8%
hypot-def64.8%
Simplified64.8%
Taylor expanded in x.re around 0 59.2%
Final simplification57.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (or (<= x.re -1.0) (not (<= x.re 2.35e-30)))
(* t_0 (pow x.re y.re))
(* t_0 (pow 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 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((x_46_re <= -1.0) || !(x_46_re <= 2.35e-30)) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else {
tmp = t_0 * pow(x_46_im, 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) :: tmp
t_0 = sin((y_46re * atan2(x_46im, x_46re)))
if ((x_46re <= (-1.0d0)) .or. (.not. (x_46re <= 2.35d-30))) then
tmp = t_0 * (x_46re ** y_46re)
else
tmp = t_0 * (x_46im ** 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 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((x_46_re <= -1.0) || !(x_46_re <= 2.35e-30)) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (x_46_re <= -1.0) or not (x_46_re <= 2.35e-30): tmp = t_0 * math.pow(x_46_re, y_46_re) else: tmp = t_0 * math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((x_46_re <= -1.0) || !(x_46_re <= 2.35e-30)) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); else tmp = Float64(t_0 * (x_46_im ^ 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 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if ((x_46_re <= -1.0) || ~((x_46_re <= 2.35e-30))) tmp = t_0 * (x_46_re ^ y_46_re); else tmp = t_0 * (x_46_im ^ 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[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x$46$re, -1.0], N[Not[LessEqual[x$46$re, 2.35e-30]], $MachinePrecision]], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -1 \lor \neg \left(x.re \leq 2.35 \cdot 10^{-30}\right):\\
\;\;\;\;t_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.re < -1 or 2.34999999999999985e-30 < x.re Initial program 27.7%
Simplified80.7%
Taylor expanded in y.im around 0 61.7%
Taylor expanded in y.im around 0 43.5%
*-commutative43.5%
unpow243.5%
unpow243.5%
hypot-def47.2%
Simplified47.2%
Taylor expanded in x.im around 0 40.9%
if -1 < x.re < 2.34999999999999985e-30Initial program 51.1%
Simplified86.2%
Taylor expanded in y.im around 0 71.6%
Taylor expanded in y.im around 0 51.1%
*-commutative51.1%
unpow251.1%
unpow251.1%
hypot-def54.8%
Simplified54.8%
Taylor expanded in x.re around 0 45.6%
Final simplification43.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) (pow x.im y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = sin((y_46re * atan2(x_46im, x_46re))) * (x_46im ** y_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}
\end{array}
Initial program 39.7%
Simplified83.5%
Taylor expanded in y.im around 0 66.8%
Taylor expanded in y.im around 0 47.3%
*-commutative47.3%
unpow247.3%
unpow247.3%
hypot-def51.1%
Simplified51.1%
Taylor expanded in x.re around 0 35.3%
Final simplification35.3%
herbie shell --seed 2023238
(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)))))