
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re))))))
(if (<= y.re -3.8e-7)
(* (sin t_0) t_1)
(if (<= y.re 300000.0)
(/
1.0
(/
(pow (exp y.im) (atan2 x.im x.re))
(*
(sin (fma y.im (log (hypot x.im x.re)) t_0))
(pow (hypot x.im x.re) y.re))))
(* (sin (* (log (hypot x.re x.im)) y.im)) t_1)))))
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_re;
double t_1 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -3.8e-7) {
tmp = sin(t_0) * t_1;
} else if (y_46_re <= 300000.0) {
tmp = 1.0 / (pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / (sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else {
tmp = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * t_1;
}
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_re) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -3.8e-7) tmp = Float64(sin(t_0) * t_1); elseif (y_46_re <= 300000.0) tmp = Float64(1.0 / Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) / Float64(sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)))); else tmp = Float64(sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * t_1); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.8e-7], N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 300000.0], N[(1.0 / N[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] / N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -3.8 \cdot 10^{-7}:\\
\;\;\;\;\sin t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 300000:\\
\;\;\;\;\frac{1}{\frac{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot t\_1\\
\end{array}
\end{array}
if y.re < -3.80000000000000015e-7Initial program 42.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6483.0
Applied rewrites83.0%
if -3.80000000000000015e-7 < y.re < 3e5Initial program 41.0%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites77.1%
if 3e5 < y.re Initial program 43.1%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6467.8
Applied rewrites67.8%
Final simplification76.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re))))))
(if (<= y.re -6e-15)
(* (sin t_0) t_1)
(if (<= y.re 1550000000.0)
(*
(sin (/ 1.0 (pow (fma y.im (log (hypot x.im x.re)) t_0) -1.0)))
(exp (* (- y.im) (atan2 x.im x.re))))
(* (sin (* (log (hypot x.re x.im)) y.im)) t_1)))))
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_re;
double t_1 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -6e-15) {
tmp = sin(t_0) * t_1;
} else if (y_46_re <= 1550000000.0) {
tmp = sin((1.0 / pow(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0), -1.0))) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * t_1;
}
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_re) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -6e-15) tmp = Float64(sin(t_0) * t_1); elseif (y_46_re <= 1550000000.0) tmp = Float64(sin(Float64(1.0 / (fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0) ^ -1.0))) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * t_1); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -6e-15], N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1550000000.0], N[(N[Sin[N[(1.0 / N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -6 \cdot 10^{-15}:\\
\;\;\;\;\sin t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1550000000:\\
\;\;\;\;\sin \left(\frac{1}{{\left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right)}^{-1}}\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot t\_1\\
\end{array}
\end{array}
if y.re < -6e-15Initial program 42.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6481.1
Applied rewrites81.1%
if -6e-15 < y.re < 1.55e9Initial program 40.8%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites46.7%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6476.0
Applied rewrites76.0%
if 1.55e9 < y.re Initial program 42.9%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6468.4
Applied rewrites68.4%
Final simplification75.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (log (/ -1.0 x.re))))
(if (<= x.re -1.8e+61)
(* (exp (- (fma t_2 y.re t_0))) (sin (fma (- y.im) t_2 t_1)))
(if (<= x.re -2e-310)
(*
(sin (+ (* (log (- x.re)) y.im) t_1))
(exp (- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_0)))
(*
(sin (fma y.im (log x.re) t_1))
(exp (fma y.re (log x.re) (* (- y.im) (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -1.8e+61) {
tmp = exp(-fma(t_2, y_46_re, t_0)) * sin(fma(-y_46_im, t_2, t_1));
} else if (x_46_re <= -2e-310) {
tmp = sin(((log(-x_46_re) * y_46_im) + t_1)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
} else {
tmp = sin(fma(y_46_im, log(x_46_re), t_1)) * exp(fma(y_46_re, log(x_46_re), (-y_46_im * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = log(Float64(-1.0 / x_46_re)) tmp = 0.0 if (x_46_re <= -1.8e+61) tmp = Float64(exp(Float64(-fma(t_2, y_46_re, t_0))) * sin(fma(Float64(-y_46_im), t_2, t_1))); elseif (x_46_re <= -2e-310) tmp = Float64(sin(Float64(Float64(log(Float64(-x_46_re)) * y_46_im) + t_1)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_0))); else tmp = Float64(sin(fma(y_46_im, log(x_46_re), t_1)) * exp(fma(y_46_re, log(x_46_re), Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -1.8e+61], N[(N[Exp[(-N[(t$95$2 * y$46$re + t$95$0), $MachinePrecision])], $MachinePrecision] * N[Sin[N[((-y$46$im) * t$95$2 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, -2e-310], N[(N[Sin[N[(N[(N[Log[(-x$46$re)], $MachinePrecision] * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(y$46$re * N[Log[x$46$re], $MachinePrecision] + N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \log \left(\frac{-1}{x.re}\right)\\
\mathbf{if}\;x.re \leq -1.8 \cdot 10^{+61}:\\
\;\;\;\;e^{-\mathsf{fma}\left(t\_2, y.re, t\_0\right)} \cdot \sin \left(\mathsf{fma}\left(-y.im, t\_2, t\_1\right)\right)\\
\mathbf{elif}\;x.re \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sin \left(\log \left(-x.re\right) \cdot y.im + t\_1\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.im, \log x.re, t\_1\right)\right) \cdot e^{\mathsf{fma}\left(y.re, \log x.re, \left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if x.re < -1.80000000000000005e61Initial program 22.2%
Taylor expanded in x.re around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites75.8%
if -1.80000000000000005e61 < x.re < -1.999999999999994e-310Initial program 54.6%
Taylor expanded in x.re around -inf
mul-1-negN/A
lower-neg.f6470.4
Applied rewrites70.4%
if -1.999999999999994e-310 < x.re Initial program 40.1%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites54.3%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6464.7
Applied rewrites64.7%
Final simplification68.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (log (/ -1.0 x.re))))
(if (<= x.re -6e+39)
(* (exp (- (fma t_2 y.re t_0))) (sin (fma (- y.im) t_2 t_1)))
(if (<= x.re 8e-301)
(*
(sin t_1)
(exp (- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_0)))
(*
(sin (fma y.im (log x.re) t_1))
(exp (fma y.re (log x.re) (* (- y.im) (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -6e+39) {
tmp = exp(-fma(t_2, y_46_re, t_0)) * sin(fma(-y_46_im, t_2, t_1));
} else if (x_46_re <= 8e-301) {
tmp = sin(t_1) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
} else {
tmp = sin(fma(y_46_im, log(x_46_re), t_1)) * exp(fma(y_46_re, log(x_46_re), (-y_46_im * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = log(Float64(-1.0 / x_46_re)) tmp = 0.0 if (x_46_re <= -6e+39) tmp = Float64(exp(Float64(-fma(t_2, y_46_re, t_0))) * sin(fma(Float64(-y_46_im), t_2, t_1))); elseif (x_46_re <= 8e-301) tmp = Float64(sin(t_1) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_0))); else tmp = Float64(sin(fma(y_46_im, log(x_46_re), t_1)) * exp(fma(y_46_re, log(x_46_re), Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -6e+39], N[(N[Exp[(-N[(t$95$2 * y$46$re + t$95$0), $MachinePrecision])], $MachinePrecision] * N[Sin[N[((-y$46$im) * t$95$2 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 8e-301], N[(N[Sin[t$95$1], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(y$46$re * N[Log[x$46$re], $MachinePrecision] + N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \log \left(\frac{-1}{x.re}\right)\\
\mathbf{if}\;x.re \leq -6 \cdot 10^{+39}:\\
\;\;\;\;e^{-\mathsf{fma}\left(t\_2, y.re, t\_0\right)} \cdot \sin \left(\mathsf{fma}\left(-y.im, t\_2, t\_1\right)\right)\\
\mathbf{elif}\;x.re \leq 8 \cdot 10^{-301}:\\
\;\;\;\;\sin t\_1 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.im, \log x.re, t\_1\right)\right) \cdot e^{\mathsf{fma}\left(y.re, \log x.re, \left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if x.re < -5.9999999999999999e39Initial program 25.5%
Taylor expanded in x.re around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites76.8%
if -5.9999999999999999e39 < x.re < 8.00000000000000053e-301Initial program 53.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.5
Applied rewrites69.5%
if 8.00000000000000053e-301 < x.re Initial program 40.1%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites54.3%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6464.7
Applied rewrites64.7%
Final simplification68.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (log (/ -1.0 x.im))))
(if (<= x.im -2.2e-7)
(* (exp (- (fma t_2 y.re t_0))) (sin (fma (- y.im) t_2 t_1)))
(if (<= x.im 4.3e-144)
(*
(sin (* (log (hypot x.re x.im)) y.im))
(exp (- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_0)))
(*
(sin (fma y.im (log x.im) t_1))
(exp (fma y.re (log x.im) (* (- y.im) (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -2.2e-7) {
tmp = exp(-fma(t_2, y_46_re, t_0)) * sin(fma(-y_46_im, t_2, t_1));
} else if (x_46_im <= 4.3e-144) {
tmp = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
} else {
tmp = sin(fma(y_46_im, log(x_46_im), t_1)) * exp(fma(y_46_re, log(x_46_im), (-y_46_im * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = log(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -2.2e-7) tmp = Float64(exp(Float64(-fma(t_2, y_46_re, t_0))) * sin(fma(Float64(-y_46_im), t_2, t_1))); elseif (x_46_im <= 4.3e-144) tmp = Float64(sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_0))); else tmp = Float64(sin(fma(y_46_im, log(x_46_im), t_1)) * exp(fma(y_46_re, log(x_46_im), Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -2.2e-7], N[(N[Exp[(-N[(t$95$2 * y$46$re + t$95$0), $MachinePrecision])], $MachinePrecision] * N[Sin[N[((-y$46$im) * t$95$2 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4.3e-144], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(y$46$re * N[Log[x$46$im], $MachinePrecision] + N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -2.2 \cdot 10^{-7}:\\
\;\;\;\;e^{-\mathsf{fma}\left(t\_2, y.re, t\_0\right)} \cdot \sin \left(\mathsf{fma}\left(-y.im, t\_2, t\_1\right)\right)\\
\mathbf{elif}\;x.im \leq 4.3 \cdot 10^{-144}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_1\right)\right) \cdot e^{\mathsf{fma}\left(y.re, \log x.im, \left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if x.im < -2.2000000000000001e-7Initial program 19.3%
Taylor expanded in x.im around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites77.5%
if -2.2000000000000001e-7 < x.im < 4.2999999999999999e-144Initial program 46.2%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6456.7
Applied rewrites56.7%
if 4.2999999999999999e-144 < x.im Initial program 50.4%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites63.4%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6473.1
Applied rewrites73.1%
Final simplification67.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))))
(if (<= y.re -3.4e-17)
(*
(sin (* (atan2 x.im x.re) y.re))
(exp (- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_0)))
(if (<= y.re 3.2e+17)
(*
(sin (* (log (hypot x.im x.re)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
(/
1.0
(/
(+ t_0 1.0)
(*
(sin (* (log (hypot x.re x.im)) y.im))
(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_im * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -3.4e-17) {
tmp = sin((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
} else if (y_46_re <= 3.2e+17) {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 1.0 / ((t_0 + 1.0) / (sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * 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_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -3.4e-17) {
tmp = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
} else if (y_46_re <= 3.2e+17) {
tmp = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = 1.0 / ((t_0 + 1.0) / (Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im)) * 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_im * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_re <= -3.4e-17: tmp = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0)) elif y_46_re <= 3.2e+17: tmp = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = 1.0 / ((t_0 + 1.0) / (math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) * 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_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -3.4e-17) tmp = Float64(sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_0))); elseif (y_46_re <= 3.2e+17) tmp = Float64(sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(1.0 / Float64(Float64(t_0 + 1.0) / Float64(sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * (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_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= -3.4e-17) tmp = sin((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0)); elseif (y_46_re <= 3.2e+17) tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = 1.0 / ((t_0 + 1.0) / (sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * (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$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.4e-17], N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.2e+17], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(t$95$0 + 1.0), $MachinePrecision] / N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -3.4 \cdot 10^{-17}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_0}\\
\mathbf{elif}\;y.re \leq 3.2 \cdot 10^{+17}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{t\_0 + 1}{\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}}\\
\end{array}
\end{array}
if y.re < -3.3999999999999998e-17Initial program 42.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6481.1
Applied rewrites81.1%
if -3.3999999999999998e-17 < y.re < 3.2e17Initial program 41.0%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites46.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6457.6
Applied rewrites57.6%
if 3.2e17 < y.re Initial program 42.6%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites52.5%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-*.f64N/A
lower-atan2.f6467.3
Applied rewrites67.3%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6469.0
Applied rewrites69.0%
Final simplification66.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (log (/ -1.0 x.re)))
(t_2 (* (atan2 x.im x.re) y.re)))
(if (<= x.re -2.35e+92)
(* (* t_1 (- y.im)) (exp (- (fma t_1 y.re t_0))))
(if (<= x.re 8e-301)
(*
(sin t_2)
(exp (- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_0)))
(*
(sin (fma y.im (log x.re) t_2))
(exp (fma y.re (log x.re) (* (- y.im) (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = log((-1.0 / x_46_re));
double t_2 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_re <= -2.35e+92) {
tmp = (t_1 * -y_46_im) * exp(-fma(t_1, y_46_re, t_0));
} else if (x_46_re <= 8e-301) {
tmp = sin(t_2) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
} else {
tmp = sin(fma(y_46_im, log(x_46_re), t_2)) * exp(fma(y_46_re, log(x_46_re), (-y_46_im * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = log(Float64(-1.0 / x_46_re)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (x_46_re <= -2.35e+92) tmp = Float64(Float64(t_1 * Float64(-y_46_im)) * exp(Float64(-fma(t_1, y_46_re, t_0)))); elseif (x_46_re <= 8e-301) tmp = Float64(sin(t_2) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_0))); else tmp = Float64(sin(fma(y_46_im, log(x_46_re), t_2)) * exp(fma(y_46_re, log(x_46_re), Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[x$46$re, -2.35e+92], N[(N[(t$95$1 * (-y$46$im)), $MachinePrecision] * N[Exp[(-N[(t$95$1 * y$46$re + t$95$0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 8e-301], N[(N[Sin[t$95$2], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(y$46$re * N[Log[x$46$re], $MachinePrecision] + N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\frac{-1}{x.re}\right)\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;x.re \leq -2.35 \cdot 10^{+92}:\\
\;\;\;\;\left(t\_1 \cdot \left(-y.im\right)\right) \cdot e^{-\mathsf{fma}\left(t\_1, y.re, t\_0\right)}\\
\mathbf{elif}\;x.re \leq 8 \cdot 10^{-301}:\\
\;\;\;\;\sin t\_2 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.im, \log x.re, t\_2\right)\right) \cdot e^{\mathsf{fma}\left(y.re, \log x.re, \left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if x.re < -2.35e92Initial program 19.0%
Taylor expanded in x.re around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites76.0%
Taylor expanded in y.im around 0
Applied rewrites80.7%
Taylor expanded in y.re around 0
Applied rewrites64.7%
if -2.35e92 < x.re < 8.00000000000000053e-301Initial program 55.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.3
Applied rewrites69.3%
if 8.00000000000000053e-301 < x.re Initial program 40.1%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites54.3%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6464.7
Applied rewrites64.7%
Final simplification66.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(sin (* (atan2 x.im x.re) y.re))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))))
(if (<= y.re -3.4e-17)
t_0
(if (<= y.re 5.2e+44)
(*
(sin (* (log (hypot x.im x.re)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -3.4e-17) {
tmp = t_0;
} else if (y_46_re <= 5.2e+44) {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 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.sin((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -3.4e-17) {
tmp = t_0;
} else if (y_46_re <= 5.2e+44) {
tmp = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -3.4e-17: tmp = t_0 elif y_46_re <= 5.2e+44: tmp = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_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(sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_re <= -3.4e-17) tmp = t_0; elseif (y_46_re <= 5.2e+44) tmp = Float64(sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_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 = sin((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -3.4e-17) tmp = t_0; elseif (y_46_re <= 5.2e+44) tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_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[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.4e-17], t$95$0, If[LessEqual[y$46$re, 5.2e+44], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -3.4 \cdot 10^{-17}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5.2 \cdot 10^{+44}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -3.3999999999999998e-17 or 5.1999999999999998e44 < y.re Initial program 43.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6474.1
Applied rewrites74.1%
if -3.3999999999999998e-17 < y.re < 5.1999999999999998e44Initial program 40.6%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites46.2%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6456.7
Applied rewrites56.7%
Final simplification65.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -3.4e-17)
(*
t_0
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(if (<= y.re 6e+44)
(*
(sin (* (log (hypot x.im x.re)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
(/ 1.0 (/ 1.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 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -3.4e-17) {
tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 6e+44) {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 1.0 / (1.0 / (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 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -3.4e-17) {
tmp = t_0 * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 6e+44) {
tmp = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = 1.0 / (1.0 / (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 = math.atan2(x_46_im, x_46_re) * y_46_re tmp = 0 if y_46_re <= -3.4e-17: tmp = t_0 * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) elif y_46_re <= 6e+44: tmp = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = 1.0 / (1.0 / (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(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_re <= -3.4e-17) tmp = Float64(t_0 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 6e+44) tmp = Float64(sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(1.0 / Float64(1.0 / 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 = atan2(x_46_im, x_46_re) * y_46_re; tmp = 0.0; if (y_46_re <= -3.4e-17) tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); elseif (y_46_re <= 6e+44) tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = 1.0 / (1.0 / (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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -3.4e-17], N[(t$95$0 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6e+44], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / 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]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -3.4 \cdot 10^{-17}:\\
\;\;\;\;t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 6 \cdot 10^{+44}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{\sin t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}}\\
\end{array}
\end{array}
if y.re < -3.3999999999999998e-17Initial program 42.6%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites67.8%
Taylor expanded in y.im around 0
Applied rewrites79.6%
if -3.3999999999999998e-17 < y.re < 5.99999999999999974e44Initial program 40.6%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites46.2%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6456.7
Applied rewrites56.7%
if 5.99999999999999974e44 < y.re Initial program 43.6%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites54.5%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6463.7
Applied rewrites63.7%
Final simplification64.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))) (t_1 (log (/ -1.0 x.re))))
(if (<= x.re -2.1e+90)
(* (* t_1 (- y.im)) (exp (- (fma t_1 y.re t_0))))
(*
(* (atan2 x.im x.re) y.re)
(exp (- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) 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_im * atan2(x_46_im, x_46_re);
double t_1 = log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -2.1e+90) {
tmp = (t_1 * -y_46_im) * exp(-fma(t_1, y_46_re, t_0));
} else {
tmp = (atan2(x_46_im, x_46_re) * y_46_re) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = log(Float64(-1.0 / x_46_re)) tmp = 0.0 if (x_46_re <= -2.1e+90) tmp = Float64(Float64(t_1 * Float64(-y_46_im)) * exp(Float64(-fma(t_1, y_46_re, t_0)))); else tmp = Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -2.1e+90], N[(N[(t$95$1 * (-y$46$im)), $MachinePrecision] * N[Exp[(-N[(t$95$1 * y$46$re + t$95$0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\frac{-1}{x.re}\right)\\
\mathbf{if}\;x.re \leq -2.1 \cdot 10^{+90}:\\
\;\;\;\;\left(t\_1 \cdot \left(-y.im\right)\right) \cdot e^{-\mathsf{fma}\left(t\_1, y.re, t\_0\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_0}\\
\end{array}
\end{array}
if x.re < -2.09999999999999981e90Initial program 19.0%
Taylor expanded in x.re around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites76.0%
Taylor expanded in y.im around 0
Applied rewrites80.7%
Taylor expanded in y.re around 0
Applied rewrites64.7%
if -2.09999999999999981e90 < x.re Initial program 46.3%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites57.6%
Taylor expanded in y.im around 0
Applied rewrites52.9%
Final simplification54.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (sin (* (atan2 x.im x.re) y.re)) (pow (hypot x.re x.im) y.re))))
(if (<= y.re -1.6e-170)
t_0
(if (<= y.re 1.9e-216)
(*
(* (log (/ -1.0 x.re)) (- y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)) * pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.6e-170) {
tmp = t_0;
} else if (y_46_re <= 1.9e-216) {
tmp = (log((-1.0 / x_46_re)) * -y_46_im) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 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.sin((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.6e-170) {
tmp = t_0;
} else if (y_46_re <= 1.9e-216) {
tmp = (Math.log((-1.0 / x_46_re)) * -y_46_im) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -1.6e-170: tmp = t_0 elif y_46_re <= 1.9e-216: tmp = (math.log((-1.0 / x_46_re)) * -y_46_im) * math.exp((-y_46_im * math.atan2(x_46_im, x_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(sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_re, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.6e-170) tmp = t_0; elseif (y_46_re <= 1.9e-216) tmp = Float64(Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_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 = sin((atan2(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_re, x_46_im) ^ y_46_re); tmp = 0.0; if (y_46_re <= -1.6e-170) tmp = t_0; elseif (y_46_re <= 1.9e-216) tmp = (log((-1.0 / x_46_re)) * -y_46_im) * exp((-y_46_im * atan2(x_46_im, x_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[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.6e-170], t$95$0, If[LessEqual[y$46$re, 1.9e-216], N[(N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$im)), $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.6 \cdot 10^{-170}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{-216}:\\
\;\;\;\;\left(\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.im\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.6e-170 or 1.9e-216 < y.re Initial program 42.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6453.4
Applied rewrites53.4%
if -1.6e-170 < y.re < 1.9e-216Initial program 38.2%
Taylor expanded in x.re around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites36.6%
Taylor expanded in y.re around 0
Applied rewrites36.5%
Taylor expanded in y.im around 0
Applied rewrites40.7%
Final simplification51.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (* (atan2 x.im x.re) y.re) (pow (hypot x.re x.im) y.re))))
(if (<= y.re -1.6e-170)
t_0
(if (<= y.re 1.9e-216)
(*
(* (log (/ -1.0 x.re)) (- y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (atan2(x_46_im, x_46_re) * y_46_re) * pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.6e-170) {
tmp = t_0;
} else if (y_46_re <= 1.9e-216) {
tmp = (log((-1.0 / x_46_re)) * -y_46_im) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 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_re) * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.6e-170) {
tmp = t_0;
} else if (y_46_re <= 1.9e-216) {
tmp = (Math.log((-1.0 / x_46_re)) * -y_46_im) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = 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_re) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -1.6e-170: tmp = t_0 elif y_46_re <= 1.9e-216: tmp = (math.log((-1.0 / x_46_re)) * -y_46_im) * math.exp((-y_46_im * math.atan2(x_46_im, x_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(Float64(atan(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_re, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.6e-170) tmp = t_0; elseif (y_46_re <= 1.9e-216) tmp = Float64(Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_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 = (atan2(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_re, x_46_im) ^ y_46_re); tmp = 0.0; if (y_46_re <= -1.6e-170) tmp = t_0; elseif (y_46_re <= 1.9e-216) tmp = (log((-1.0 / x_46_re)) * -y_46_im) * exp((-y_46_im * atan2(x_46_im, x_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[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.6e-170], t$95$0, If[LessEqual[y$46$re, 1.9e-216], N[(N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$im)), $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.6 \cdot 10^{-170}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{-216}:\\
\;\;\;\;\left(\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.im\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.6e-170 or 1.9e-216 < y.re Initial program 42.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6453.4
Applied rewrites53.4%
Taylor expanded in y.re around 0
Applied rewrites50.8%
if -1.6e-170 < y.re < 1.9e-216Initial program 38.2%
Taylor expanded in x.re around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites36.6%
Taylor expanded in y.re around 0
Applied rewrites36.5%
Taylor expanded in y.im around 0
Applied rewrites40.7%
Final simplification48.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (sin (* (atan2 x.im x.re) y.re))) (t_1 (* (pow x.im y.re) t_0))) (if (<= y.re -0.00055) t_1 (if (<= y.re 7e+21) (* 1.0 t_0) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = pow(x_46_im, y_46_re) * t_0;
double tmp;
if (y_46_re <= -0.00055) {
tmp = t_1;
} else if (y_46_re <= 7e+21) {
tmp = 1.0 * t_0;
} else {
tmp = t_1;
}
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 = sin((atan2(x_46im, x_46re) * y_46re))
t_1 = (x_46im ** y_46re) * t_0
if (y_46re <= (-0.00055d0)) then
tmp = t_1
else if (y_46re <= 7d+21) then
tmp = 1.0d0 * t_0
else
tmp = t_1
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((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = Math.pow(x_46_im, y_46_re) * t_0;
double tmp;
if (y_46_re <= -0.00055) {
tmp = t_1;
} else if (y_46_re <= 7e+21) {
tmp = 1.0 * t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) t_1 = math.pow(x_46_im, y_46_re) * t_0 tmp = 0 if y_46_re <= -0.00055: tmp = t_1 elif y_46_re <= 7e+21: tmp = 1.0 * t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_1 = Float64((x_46_im ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -0.00055) tmp = t_1; elseif (y_46_re <= 7e+21) tmp = Float64(1.0 * t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); t_1 = (x_46_im ^ y_46_re) * t_0; tmp = 0.0; if (y_46_re <= -0.00055) tmp = t_1; elseif (y_46_re <= 7e+21) tmp = 1.0 * t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -0.00055], t$95$1, If[LessEqual[y$46$re, 7e+21], N[(1.0 * t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := {x.im}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -0.00055:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 7 \cdot 10^{+21}:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -5.50000000000000033e-4 or 7e21 < y.re Initial program 42.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6470.4
Applied rewrites70.4%
Taylor expanded in x.re around 0
Applied rewrites57.4%
if -5.50000000000000033e-4 < y.re < 7e21Initial program 41.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6421.4
Applied rewrites21.4%
Taylor expanded in y.re around 0
Applied rewrites19.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= x.re -6e+113)
(* (pow (- x.re) y.re) (sin t_0))
(* t_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 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_re <= -6e+113) {
tmp = pow(-x_46_re, y_46_re) * sin(t_0);
} else {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), 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 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_re <= -6e+113) {
tmp = Math.pow(-x_46_re, y_46_re) * Math.sin(t_0);
} else {
tmp = t_0 * Math.pow(Math.hypot(x_46_re, 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.atan2(x_46_im, x_46_re) * y_46_re tmp = 0 if x_46_re <= -6e+113: tmp = math.pow(-x_46_re, y_46_re) * math.sin(t_0) else: tmp = t_0 * math.pow(math.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 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (x_46_re <= -6e+113) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * sin(t_0)); else tmp = Float64(t_0 * (hypot(x_46_re, 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 = atan2(x_46_im, x_46_re) * y_46_re; tmp = 0.0; if (x_46_re <= -6e+113) tmp = (-x_46_re ^ y_46_re) * sin(t_0); else tmp = t_0 * (hypot(x_46_re, 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[x$46$re, -6e+113], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;x.re \leq -6 \cdot 10^{+113}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if x.re < -6e113Initial program 6.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6451.4
Applied rewrites51.4%
Taylor expanded in x.re around -inf
Applied rewrites51.4%
if -6e113 < x.re Initial program 46.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6443.5
Applied rewrites43.5%
Taylor expanded in y.re around 0
Applied rewrites44.2%
Final simplification45.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))) (if (<= x.re 1.05e-17) (* (pow x.im y.re) t_0) (* (pow x.re 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 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= 1.05e-17) {
tmp = pow(x_46_im, y_46_re) * t_0;
} else {
tmp = pow(x_46_re, y_46_re) * t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = sin((atan2(x_46im, x_46re) * y_46re))
if (x_46re <= 1.05d-17) then
tmp = (x_46im ** y_46re) * t_0
else
tmp = (x_46re ** y_46re) * t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= 1.05e-17) {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if x_46_re <= 1.05e-17: tmp = math.pow(x_46_im, y_46_re) * t_0 else: tmp = math.pow(x_46_re, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (x_46_re <= 1.05e-17) tmp = Float64((x_46_im ^ y_46_re) * t_0); else tmp = Float64((x_46_re ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (x_46_re <= 1.05e-17) tmp = (x_46_im ^ y_46_re) * t_0; else tmp = (x_46_re ^ y_46_re) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 1.05e-17], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.re \leq 1.05 \cdot 10^{-17}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < 1.04999999999999996e-17Initial program 45.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6446.8
Applied rewrites46.8%
Taylor expanded in x.re around 0
Applied rewrites39.3%
if 1.04999999999999996e-17 < x.re Initial program 29.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6437.8
Applied rewrites37.8%
Taylor expanded in x.im around 0
Applied rewrites36.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -5.2e-72) (* 1.0 (sin (* (atan2 x.im x.re) y.re))) (* (pow (pow (atan2 x.im x.re) 4.0) 0.25) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -5.2e-72) {
tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = pow(pow(atan2(x_46_im, x_46_re), 4.0), 0.25) * 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) :: tmp
if (x_46im <= (-5.2d-72)) then
tmp = 1.0d0 * sin((atan2(x_46im, x_46re) * y_46re))
else
tmp = ((atan2(x_46im, x_46re) ** 4.0d0) ** 0.25d0) * 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 tmp;
if (x_46_im <= -5.2e-72) {
tmp = 1.0 * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = Math.pow(Math.pow(Math.atan2(x_46_im, x_46_re), 4.0), 0.25) * y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -5.2e-72: tmp = 1.0 * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = math.pow(math.pow(math.atan2(x_46_im, x_46_re), 4.0), 0.25) * y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -5.2e-72) tmp = Float64(1.0 * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(((atan(x_46_im, x_46_re) ^ 4.0) ^ 0.25) * y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_im <= -5.2e-72) tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = ((atan2(x_46_im, x_46_re) ^ 4.0) ^ 0.25) * y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -5.2e-72], N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 4.0], $MachinePrecision], 0.25], $MachinePrecision] * y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -5.2 \cdot 10^{-72}:\\
\;\;\;\;1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;{\left({\tan^{-1}_* \frac{x.im}{x.re}}^{4}\right)}^{0.25} \cdot y.re\\
\end{array}
\end{array}
if x.im < -5.19999999999999992e-72Initial program 26.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6445.2
Applied rewrites45.2%
Taylor expanded in y.re around 0
Applied rewrites14.3%
if -5.19999999999999992e-72 < x.im Initial program 47.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6444.3
Applied rewrites44.3%
Taylor expanded in y.re around 0
Applied rewrites12.0%
Applied rewrites15.0%
Final simplification14.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (* (atan2 x.im x.re) y.re) (pow (hypot x.re x.im) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (atan2(x_46_im, x_46_re) * y_46_re) * pow(hypot(x_46_re, x_46_im), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (Math.atan2(x_46_im, x_46_re) * y_46_re) * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return (math.atan2(x_46_im, x_46_re) * y_46_re) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) * (hypot(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 = (atan2(x_46_im, x_46_re) * y_46_re) * (hypot(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}
\end{array}
Initial program 41.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6444.5
Applied rewrites44.5%
Taylor expanded in y.re around 0
Applied rewrites42.4%
Final simplification42.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -2.7e-133) (* 1.0 (sin (* (atan2 x.im x.re) y.re))) (* (sqrt (pow (atan2 x.im x.re) 2.0)) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -2.7e-133) {
tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = sqrt(pow(atan2(x_46_im, x_46_re), 2.0)) * 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) :: tmp
if (x_46im <= (-2.7d-133)) then
tmp = 1.0d0 * sin((atan2(x_46im, x_46re) * y_46re))
else
tmp = sqrt((atan2(x_46im, x_46re) ** 2.0d0)) * 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 tmp;
if (x_46_im <= -2.7e-133) {
tmp = 1.0 * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = Math.sqrt(Math.pow(Math.atan2(x_46_im, x_46_re), 2.0)) * y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -2.7e-133: tmp = 1.0 * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = math.sqrt(math.pow(math.atan2(x_46_im, x_46_re), 2.0)) * y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -2.7e-133) tmp = Float64(1.0 * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(sqrt((atan(x_46_im, x_46_re) ^ 2.0)) * y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_im <= -2.7e-133) tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = sqrt((atan2(x_46_im, x_46_re) ^ 2.0)) * y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -2.7e-133], N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2.7 \cdot 10^{-133}:\\
\;\;\;\;1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{\tan^{-1}_* \frac{x.im}{x.re}}^{2}} \cdot y.re\\
\end{array}
\end{array}
if x.im < -2.6999999999999999e-133Initial program 32.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6445.6
Applied rewrites45.6%
Taylor expanded in y.re around 0
Applied rewrites12.5%
if -2.6999999999999999e-133 < x.im Initial program 46.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6444.0
Applied rewrites44.0%
Taylor expanded in y.re around 0
Applied rewrites12.7%
Applied rewrites15.3%
Final simplification14.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (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) {
return 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
code = 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) {
return 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): return 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) return 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) tmp = atan2(x_46_im, x_46_re) * y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re
\end{array}
Initial program 41.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6444.5
Applied rewrites44.5%
Taylor expanded in y.re around 0
Applied rewrites12.6%
Final simplification12.6%
herbie shell --seed 2024277
(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)))))