
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (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)))))
(t_2 (log (hypot x.im x.re))))
(if (<= y.re -570.0)
(* (sin t_0) t_1)
(if (<= y.re 0.0034)
(/
(sin (fma y.im t_2 t_0))
(/ (pow (exp y.im) (atan2 x.im x.re)) (pow (hypot x.im x.re) y.re)))
(* (sin (* t_2 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 t_2 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -570.0) {
tmp = sin(t_0) * t_1;
} else if (y_46_re <= 0.0034) {
tmp = sin(fma(y_46_im, t_2, t_0)) / (pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / pow(hypot(x_46_im, x_46_re), y_46_re));
} else {
tmp = sin((t_2 * 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)))) t_2 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -570.0) tmp = Float64(sin(t_0) * t_1); elseif (y_46_re <= 0.0034) tmp = Float64(sin(fma(y_46_im, t_2, t_0)) / Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) / (hypot(x_46_im, x_46_re) ^ y_46_re))); else tmp = Float64(sin(Float64(t_2 * 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]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -570.0], N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 0.0034], N[(N[Sin[N[(y$46$im * t$95$2 + t$95$0), $MachinePrecision]], $MachinePrecision] / N[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] / N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$2 * 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}}\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -570:\\
\;\;\;\;\sin t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 0.0034:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(y.im, t\_2, t\_0\right)\right)}{\frac{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_2 \cdot y.im\right) \cdot t\_1\\
\end{array}
\end{array}
if y.re < -570Initial program 45.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6484.8
Applied rewrites84.8%
if -570 < y.re < 0.00339999999999999981Initial program 45.7%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites82.4%
if 0.00339999999999999981 < y.re Initial program 32.3%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.9
Applied rewrites75.9%
Final simplification81.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (sin t_0))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(t_3 (log (hypot x.im x.re))))
(if (<= y.re -4.5e-15)
(* t_1 t_2)
(if (<= y.re 0.0032)
(*
(fma (* (cos t_0) t_3) y.im t_1)
(exp (* (- y.im) (atan2 x.im x.re))))
(* (sin (* t_3 y.im)) t_2)))))
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 = sin(t_0);
double t_2 = 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 t_3 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -4.5e-15) {
tmp = t_1 * t_2;
} else if (y_46_re <= 0.0032) {
tmp = fma((cos(t_0) * t_3), y_46_im, t_1) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = sin((t_3 * y_46_im)) * t_2;
}
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 = sin(t_0) 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) - Float64(y_46_im * atan(x_46_im, x_46_re)))) t_3 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -4.5e-15) tmp = Float64(t_1 * t_2); elseif (y_46_re <= 0.0032) tmp = Float64(fma(Float64(cos(t_0) * t_3), y_46_im, t_1) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(sin(Float64(t_3 * y_46_im)) * t_2); 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[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -4.5e-15], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 0.0032], N[(N[(N[(N[Cos[t$95$0], $MachinePrecision] * t$95$3), $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$3 * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
t_2 := 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}}\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-15}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;y.re \leq 0.0032:\\
\;\;\;\;\mathsf{fma}\left(\cos t\_0 \cdot t\_3, y.im, t\_1\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_3 \cdot y.im\right) \cdot t\_2\\
\end{array}
\end{array}
if y.re < -4.4999999999999998e-15Initial program 47.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6482.6
Applied rewrites82.6%
if -4.4999999999999998e-15 < y.re < 0.00320000000000000015Initial program 45.0%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites55.0%
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.f6482.4
Applied rewrites82.4%
if 0.00320000000000000015 < y.re Initial program 32.3%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.9
Applied rewrites75.9%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1
(*
(sin t_0)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))))
(if (<= y.im -1300.0)
t_1
(if (<= y.im 290.0)
(/
(pow (hypot x.re x.im) y.re)
(/
(fma y.im (atan2 x.im x.re) 1.0)
(sin (fma (log (hypot x.re x.im)) y.im t_0))))
t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = sin(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))));
double tmp;
if (y_46_im <= -1300.0) {
tmp = t_1;
} else if (y_46_im <= 290.0) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (fma(y_46_im, atan2(x_46_im, x_46_re), 1.0) / sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64(sin(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))))) tmp = 0.0 if (y_46_im <= -1300.0) tmp = t_1; elseif (y_46_im <= 290.0) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(fma(y_46_im, atan(x_46_im, x_46_re), 1.0) / sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)))); else tmp = 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[(N[Sin[t$95$0], $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$im, -1300.0], t$95$1, If[LessEqual[y$46$im, 290.0], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + 1.0), $MachinePrecision] / N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin 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{if}\;y.im \leq -1300:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 290:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\frac{\mathsf{fma}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)}{\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1300 or 290 < y.im Initial program 35.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.7
Applied rewrites62.7%
if -1300 < y.im < 290Initial program 48.5%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites87.5%
Applied rewrites87.5%
Taylor expanded in y.im around 0
+-commutativeN/A
lower-fma.f64N/A
lower-atan2.f6487.1
Applied rewrites87.1%
Final simplification76.0%
(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.im -1300.0)
t_0
(if (<= y.im 460.0)
(*
(sin
(*
(fma y.im (/ (log (hypot x.re x.im)) y.re) (atan2 x.im x.re))
y.re))
(exp (* (log (hypot x.im 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)) * 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_im <= -1300.0) {
tmp = t_0;
} else if (y_46_im <= 460.0) {
tmp = sin((fma(y_46_im, (log(hypot(x_46_re, x_46_im)) / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re)) * exp((log(hypot(x_46_im, x_46_re)) * y_46_re));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(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_im <= -1300.0) tmp = t_0; elseif (y_46_im <= 460.0) tmp = Float64(sin(Float64(fma(y_46_im, Float64(log(hypot(x_46_re, x_46_im)) / y_46_re), atan(x_46_im, x_46_re)) * y_46_re)) * exp(Float64(log(hypot(x_46_im, x_46_re)) * y_46_re))); else tmp = t_0; end return 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$im, -1300.0], t$95$0, If[LessEqual[y$46$im, 460.0], N[(N[Sin[N[(N[(y$46$im * N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $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.im \leq -1300:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 460:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.im, \frac{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right) \cdot e^{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1300 or 460 < y.im Initial program 35.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.7
Applied rewrites62.7%
if -1300 < y.im < 460Initial program 48.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6448.1
Applied rewrites48.1%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-atan2.f6485.0
Applied rewrites85.0%
Final simplification74.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((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 -5.8e-111)
(* (sin (* (atan2 x.im x.re) y.re)) t_0)
(if (<= y.re 0.0014)
(*
(sin (* (log (hypot x.re x.im)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
(* (sin (* (log (hypot x.im x.re)) y.im)) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double 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))));
double tmp;
if (y_46_re <= -5.8e-111) {
tmp = sin((atan2(x_46_im, x_46_re) * y_46_re)) * t_0;
} else if (y_46_re <= 0.0014) {
tmp = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_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.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 <= -5.8e-111) {
tmp = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re)) * t_0;
} else if (y_46_re <= 0.0014) {
tmp = Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): 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)))) tmp = 0 if y_46_re <= -5.8e-111: tmp = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_0 elif y_46_re <= 0.0014: tmp = math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) 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)))) tmp = 0.0 if (y_46_re <= -5.8e-111) tmp = Float64(sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) * t_0); elseif (y_46_re <= 0.0014) tmp = Float64(sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(sin(Float64(log(hypot(x_46_im, x_46_re)) * y_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 = 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 <= -5.8e-111) tmp = sin((atan2(x_46_im, x_46_re) * y_46_re)) * t_0; elseif (y_46_re <= 0.0014) tmp = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = sin((log(hypot(x_46_im, x_46_re)) * y_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[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, -5.8e-111], N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 0.0014], 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[((-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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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 -5.8 \cdot 10^{-111}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 0.0014:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\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.im, x.re\right)\right) \cdot y.im\right) \cdot t\_0\\
\end{array}
\end{array}
if y.re < -5.80000000000000003e-111Initial program 47.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6479.1
Applied rewrites79.1%
if -5.80000000000000003e-111 < y.re < 0.00139999999999999999Initial program 44.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.5
Applied rewrites25.5%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6438.9
Applied rewrites38.9%
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.f6468.4
Applied rewrites68.4%
if 0.00139999999999999999 < y.re Initial program 32.3%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.9
Applied rewrites75.9%
Final simplification73.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (log (hypot x.re x.im)) y.im))))
(if (<= y.re -5.8e-111)
(*
(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 1.05)
(* t_0 (exp (* (- y.im) (atan2 x.im x.re))))
(* (pow (hypot x.im 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((log(hypot(x_46_re, x_46_im)) * y_46_im));
double tmp;
if (y_46_re <= -5.8e-111) {
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) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 1.05) {
tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
double tmp;
if (y_46_re <= -5.8e-111) {
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) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 1.05) {
tmp = t_0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.pow(Math.hypot(x_46_im, 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.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) tmp = 0 if y_46_re <= -5.8e-111: 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) - (y_46_im * math.atan2(x_46_im, x_46_re)))) elif y_46_re <= 1.05: tmp = t_0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = math.pow(math.hypot(x_46_im, 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(log(hypot(x_46_re, x_46_im)) * y_46_im)) tmp = 0.0 if (y_46_re <= -5.8e-111) 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) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 1.05) tmp = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64((hypot(x_46_im, 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((log(hypot(x_46_re, x_46_im)) * y_46_im)); tmp = 0.0; if (y_46_re <= -5.8e-111) 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) - (y_46_im * atan2(x_46_im, x_46_re)))); elseif (y_46_re <= 1.05) tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = (hypot(x_46_im, 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -5.8e-111], 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, 1.05], N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -5.8 \cdot 10^{-111}:\\
\;\;\;\;\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{elif}\;y.re \leq 1.05:\\
\;\;\;\;t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -5.80000000000000003e-111Initial program 47.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6479.1
Applied rewrites79.1%
if -5.80000000000000003e-111 < y.re < 1.05000000000000004Initial program 44.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.3
Applied rewrites25.3%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6438.6
Applied rewrites38.6%
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.f6468.7
Applied rewrites68.7%
if 1.05000000000000004 < y.re Initial program 32.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6429.6
Applied rewrites29.6%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6472.2
Applied rewrites72.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6472.2
Applied rewrites72.2%
Final simplification73.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (log (hypot x.re x.im)) y.im))))
(if (<= y.re -1.7e-129)
(/
(pow (hypot x.re x.im) y.re)
(/ (fma y.im (atan2 x.im x.re) 1.0) (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.re 1.05)
(* t_0 (exp (* (- y.im) (atan2 x.im x.re))))
(* (pow (hypot x.im 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((log(hypot(x_46_re, x_46_im)) * y_46_im));
double tmp;
if (y_46_re <= -1.7e-129) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (fma(y_46_im, atan2(x_46_im, x_46_re), 1.0) / sin((atan2(x_46_im, x_46_re) * y_46_re)));
} else if (y_46_re <= 1.05) {
tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(hypot(x_46_im, 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(log(hypot(x_46_re, x_46_im)) * y_46_im)) tmp = 0.0 if (y_46_re <= -1.7e-129) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(fma(y_46_im, atan(x_46_im, x_46_re), 1.0) / sin(Float64(atan(x_46_im, x_46_re) * y_46_re)))); elseif (y_46_re <= 1.05) tmp = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64((hypot(x_46_im, 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[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.7e-129], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + 1.0), $MachinePrecision] / N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.05], N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -1.7 \cdot 10^{-129}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\frac{\mathsf{fma}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)}{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}}\\
\mathbf{elif}\;y.re \leq 1.05:\\
\;\;\;\;t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.70000000000000007e-129Initial program 46.7%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites68.4%
Applied rewrites68.4%
Taylor expanded in y.im around 0
+-commutativeN/A
lower-fma.f64N/A
lower-atan2.f6471.3
Applied rewrites71.3%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6470.7
Applied rewrites70.7%
if -1.70000000000000007e-129 < y.re < 1.05000000000000004Initial program 44.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.5
Applied rewrites25.5%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6438.9
Applied rewrites38.9%
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.f6469.3
Applied rewrites69.3%
if 1.05000000000000004 < y.re Initial program 32.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6429.6
Applied rewrites29.6%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6472.2
Applied rewrites72.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6472.2
Applied rewrites72.2%
Final simplification70.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (log (hypot x.re x.im)) y.im))))
(if (<= y.re -2.8e-22)
(*
(/ 1.0 (pow (hypot x.re x.im) (- y.re)))
(sin (* (atan2 x.im x.re) y.re)))
(if (<= y.re 1.05)
(* t_0 (exp (* (- y.im) (atan2 x.im x.re))))
(* (pow (hypot x.im 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((log(hypot(x_46_re, x_46_im)) * y_46_im));
double tmp;
if (y_46_re <= -2.8e-22) {
tmp = (1.0 / pow(hypot(x_46_re, x_46_im), -y_46_re)) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 1.05) {
tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
double tmp;
if (y_46_re <= -2.8e-22) {
tmp = (1.0 / Math.pow(Math.hypot(x_46_re, x_46_im), -y_46_re)) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 1.05) {
tmp = t_0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.pow(Math.hypot(x_46_im, 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.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) tmp = 0 if y_46_re <= -2.8e-22: tmp = (1.0 / math.pow(math.hypot(x_46_re, x_46_im), -y_46_re)) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) elif y_46_re <= 1.05: tmp = t_0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = math.pow(math.hypot(x_46_im, 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(log(hypot(x_46_re, x_46_im)) * y_46_im)) tmp = 0.0 if (y_46_re <= -2.8e-22) tmp = Float64(Float64(1.0 / (hypot(x_46_re, x_46_im) ^ Float64(-y_46_re))) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 1.05) tmp = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64((hypot(x_46_im, 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((log(hypot(x_46_re, x_46_im)) * y_46_im)); tmp = 0.0; if (y_46_re <= -2.8e-22) tmp = (1.0 / (hypot(x_46_re, x_46_im) ^ -y_46_re)) * sin((atan2(x_46_im, x_46_re) * y_46_re)); elseif (y_46_re <= 1.05) tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = (hypot(x_46_im, 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.8e-22], N[(N[(1.0 / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], (-y$46$re)], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.05], N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{-22}:\\
\;\;\;\;\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\left(-y.re\right)}} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 1.05:\\
\;\;\;\;t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -2.79999999999999995e-22Initial program 47.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.9
Applied rewrites78.9%
Applied rewrites79.0%
if -2.79999999999999995e-22 < y.re < 1.05000000000000004Initial program 44.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6426.0
Applied rewrites26.0%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6434.7
Applied rewrites34.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.f6464.9
Applied rewrites64.9%
if 1.05000000000000004 < y.re Initial program 32.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6429.6
Applied rewrites29.6%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6472.2
Applied rewrites72.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6472.2
Applied rewrites72.2%
Final simplification70.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -1.05e-143) (/ (pow (hypot x.re x.im) y.re) (/ 1.0 (sin (* (atan2 x.im x.re) y.re)))) (* (pow (hypot x.im x.re) y.re) (sin (* (log (hypot x.re x.im)) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.05e-143) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 / sin((atan2(x_46_im, x_46_re) * y_46_re)));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.05e-143) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 / Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re)));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -1.05e-143: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 / math.sin((math.atan2(x_46_im, x_46_re) * y_46_re))) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -1.05e-143) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 / sin(Float64(atan(x_46_im, x_46_re) * y_46_re)))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -1.05e-143) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 / sin((atan2(x_46_im, x_46_re) * y_46_re))); else tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.05e-143], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 / N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.05 \cdot 10^{-143}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\frac{1}{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -1.0500000000000001e-143Initial program 47.1%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites68.7%
Applied rewrites68.7%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6467.7
Applied rewrites67.7%
if -1.0500000000000001e-143 < y.re Initial program 39.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6427.6
Applied rewrites27.6%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6452.2
Applied rewrites52.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6452.2
Applied rewrites52.2%
Final simplification57.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* x.im x.im) x.re))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (sin t_1)))
(if (<= y.im -1.16e+247)
(*
(fma (* (/ (atan2 x.im x.re) x.re) (* t_0 0.5)) y.re (atan2 x.im x.re))
y.re)
(if (<= y.im -3.1e-280)
(* t_1 (pow (hypot x.im x.re) y.re))
(if (<= y.im 3.2e+87)
(/ (pow (hypot x.re x.im) y.re) (/ 1.0 t_2))
(* (pow (* (fma (/ 0.5 x.re) t_0 1.0) x.re) y.re) t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * x_46_im) / x_46_re;
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = sin(t_1);
double tmp;
if (y_46_im <= -1.16e+247) {
tmp = fma(((atan2(x_46_im, x_46_re) / x_46_re) * (t_0 * 0.5)), y_46_re, atan2(x_46_im, x_46_re)) * y_46_re;
} else if (y_46_im <= -3.1e-280) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 3.2e+87) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 / t_2);
} else {
tmp = pow((fma((0.5 / x_46_re), t_0, 1.0) * x_46_re), y_46_re) * t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im * x_46_im) / x_46_re) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = sin(t_1) tmp = 0.0 if (y_46_im <= -1.16e+247) tmp = Float64(fma(Float64(Float64(atan(x_46_im, x_46_re) / x_46_re) * Float64(t_0 * 0.5)), y_46_re, atan(x_46_im, x_46_re)) * y_46_re); elseif (y_46_im <= -3.1e-280) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 3.2e+87) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 / t_2)); else tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), t_0, 1.0) * x_46_re) ^ y_46_re) * t_2); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[y$46$im, -1.16e+247], N[(N[(N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / x$46$re), $MachinePrecision] * N[(t$95$0 * 0.5), $MachinePrecision]), $MachinePrecision] * y$46$re + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision], If[LessEqual[y$46$im, -3.1e-280], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.2e+87], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 / t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \sin t\_1\\
\mathbf{if}\;y.im \leq -1.16 \cdot 10^{+247}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{x.re} \cdot \left(t\_0 \cdot 0.5\right), y.re, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\\
\mathbf{elif}\;y.im \leq -3.1 \cdot 10^{-280}:\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 3.2 \cdot 10^{+87}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\frac{1}{t\_2}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, t\_0, 1\right) \cdot x.re\right)}^{y.re} \cdot t\_2\\
\end{array}
\end{array}
if y.im < -1.16000000000000006e247Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6410.5
Applied rewrites10.5%
Taylor expanded in y.re around 0
Applied rewrites10.8%
Taylor expanded in x.re around -inf
Applied rewrites26.1%
Taylor expanded in x.im around inf
Applied rewrites51.1%
if -1.16000000000000006e247 < y.im < -3.10000000000000021e-280Initial program 34.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6442.7
Applied rewrites42.7%
Taylor expanded in y.re around 0
Applied rewrites48.2%
if -3.10000000000000021e-280 < y.im < 3.2e87Initial program 55.0%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites82.0%
Applied rewrites82.0%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6449.0
Applied rewrites49.0%
if 3.2e87 < y.im Initial program 35.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6428.1
Applied rewrites28.1%
Taylor expanded in x.re around inf
Applied rewrites40.0%
Final simplification47.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= x.re 1.8e-6)
(* t_0 (pow (hypot x.im x.re) y.re))
(/ 1.0 (/ 1.0 (* (sin (fma (log x.re) y.im t_0)) (pow x.re y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_re <= 1.8e-6) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 1.0 / (1.0 / (sin(fma(log(x_46_re), y_46_im, t_0)) * pow(x_46_re, y_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (x_46_re <= 1.8e-6) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(1.0 / Float64(1.0 / Float64(sin(fma(log(x_46_re), y_46_im, t_0)) * (x_46_re ^ 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[x$46$re, 1.8e-6], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(N[Sin[N[(N[Log[x$46$re], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, 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}\;x.re \leq 1.8 \cdot 10^{-6}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{\sin \left(\mathsf{fma}\left(\log x.re, y.im, t\_0\right)\right) \cdot {x.re}^{y.re}}}\\
\end{array}
\end{array}
if x.re < 1.79999999999999992e-6Initial program 46.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6443.1
Applied rewrites43.1%
Taylor expanded in y.re around 0
Applied rewrites44.0%
if 1.79999999999999992e-6 < x.re Initial program 31.6%
Taylor expanded in x.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
exp-diffN/A
lower-/.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-atan2.f6472.9
Applied rewrites72.9%
Applied rewrites72.9%
Taylor expanded in y.im around 0
Applied rewrites72.0%
Final simplification51.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* x.im x.im) x.re))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (pow (hypot x.im x.re) y.re))
(t_3 (sin t_1)))
(if (<= y.im -1.16e+247)
(*
(fma (* (/ (atan2 x.im x.re) x.re) (* t_0 0.5)) y.re (atan2 x.im x.re))
y.re)
(if (<= y.im -5e-257)
(* t_1 t_2)
(if (<= y.im 3.2e+87)
(* t_3 t_2)
(* (pow (* (fma (/ 0.5 x.re) t_0 1.0) x.re) y.re) t_3))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * x_46_im) / x_46_re;
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_3 = sin(t_1);
double tmp;
if (y_46_im <= -1.16e+247) {
tmp = fma(((atan2(x_46_im, x_46_re) / x_46_re) * (t_0 * 0.5)), y_46_re, atan2(x_46_im, x_46_re)) * y_46_re;
} else if (y_46_im <= -5e-257) {
tmp = t_1 * t_2;
} else if (y_46_im <= 3.2e+87) {
tmp = t_3 * t_2;
} else {
tmp = pow((fma((0.5 / x_46_re), t_0, 1.0) * x_46_re), y_46_re) * t_3;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im * x_46_im) / x_46_re) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = hypot(x_46_im, x_46_re) ^ y_46_re t_3 = sin(t_1) tmp = 0.0 if (y_46_im <= -1.16e+247) tmp = Float64(fma(Float64(Float64(atan(x_46_im, x_46_re) / x_46_re) * Float64(t_0 * 0.5)), y_46_re, atan(x_46_im, x_46_re)) * y_46_re); elseif (y_46_im <= -5e-257) tmp = Float64(t_1 * t_2); elseif (y_46_im <= 3.2e+87) tmp = Float64(t_3 * t_2); else tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), t_0, 1.0) * x_46_re) ^ y_46_re) * t_3); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[y$46$im, -1.16e+247], N[(N[(N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / x$46$re), $MachinePrecision] * N[(t$95$0 * 0.5), $MachinePrecision]), $MachinePrecision] * y$46$re + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision], If[LessEqual[y$46$im, -5e-257], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 3.2e+87], N[(t$95$3 * t$95$2), $MachinePrecision], N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$3), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_3 := \sin t\_1\\
\mathbf{if}\;y.im \leq -1.16 \cdot 10^{+247}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{x.re} \cdot \left(t\_0 \cdot 0.5\right), y.re, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\\
\mathbf{elif}\;y.im \leq -5 \cdot 10^{-257}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;y.im \leq 3.2 \cdot 10^{+87}:\\
\;\;\;\;t\_3 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, t\_0, 1\right) \cdot x.re\right)}^{y.re} \cdot t\_3\\
\end{array}
\end{array}
if y.im < -1.16000000000000006e247Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6410.5
Applied rewrites10.5%
Taylor expanded in y.re around 0
Applied rewrites10.8%
Taylor expanded in x.re around -inf
Applied rewrites26.1%
Taylor expanded in x.im around inf
Applied rewrites51.1%
if -1.16000000000000006e247 < y.im < -4.99999999999999989e-257Initial program 33.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6441.7
Applied rewrites41.7%
Taylor expanded in y.re around 0
Applied rewrites47.5%
if -4.99999999999999989e-257 < y.im < 3.2e87Initial program 54.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.6
Applied rewrites49.6%
if 3.2e87 < y.im Initial program 35.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6428.1
Applied rewrites28.1%
Taylor expanded in x.re around inf
Applied rewrites40.0%
Final simplification47.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* x.im x.im) x.re)) (t_1 (* (atan2 x.im x.re) y.re)))
(if (<= y.im -1.16e+247)
(*
(fma (* (/ (atan2 x.im x.re) x.re) (* t_0 0.5)) y.re (atan2 x.im x.re))
y.re)
(if (<= y.im 7.7e+86)
(* t_1 (pow (hypot x.im x.re) y.re))
(* (pow (* (fma (/ 0.5 x.re) t_0 1.0) x.re) y.re) (sin t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * x_46_im) / x_46_re;
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_im <= -1.16e+247) {
tmp = fma(((atan2(x_46_im, x_46_re) / x_46_re) * (t_0 * 0.5)), y_46_re, atan2(x_46_im, x_46_re)) * y_46_re;
} else if (y_46_im <= 7.7e+86) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow((fma((0.5 / x_46_re), t_0, 1.0) * x_46_re), y_46_re) * sin(t_1);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im * x_46_im) / x_46_re) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_im <= -1.16e+247) tmp = Float64(fma(Float64(Float64(atan(x_46_im, x_46_re) / x_46_re) * Float64(t_0 * 0.5)), y_46_re, atan(x_46_im, x_46_re)) * y_46_re); elseif (y_46_im <= 7.7e+86) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), t_0, 1.0) * x_46_re) ^ y_46_re) * sin(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[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$im, -1.16e+247], N[(N[(N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / x$46$re), $MachinePrecision] * N[(t$95$0 * 0.5), $MachinePrecision]), $MachinePrecision] * y$46$re + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 7.7e+86], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.im \leq -1.16 \cdot 10^{+247}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{x.re} \cdot \left(t\_0 \cdot 0.5\right), y.re, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\\
\mathbf{elif}\;y.im \leq 7.7 \cdot 10^{+86}:\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, t\_0, 1\right) \cdot x.re\right)}^{y.re} \cdot \sin t\_1\\
\end{array}
\end{array}
if y.im < -1.16000000000000006e247Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6410.5
Applied rewrites10.5%
Taylor expanded in y.re around 0
Applied rewrites10.8%
Taylor expanded in x.re around -inf
Applied rewrites26.1%
Taylor expanded in x.im around inf
Applied rewrites51.1%
if -1.16000000000000006e247 < y.im < 7.70000000000000053e86Initial program 44.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6445.9
Applied rewrites45.9%
Taylor expanded in y.re around 0
Applied rewrites46.2%
if 7.70000000000000053e86 < y.im Initial program 35.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6428.1
Applied rewrites28.1%
Taylor expanded in x.re around inf
Applied rewrites40.0%
Final simplification45.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= y.im -1.16e+247)
(*
(fma
(* (/ (atan2 x.im x.re) x.re) (* (/ (* x.im x.im) x.re) 0.5))
y.re
(atan2 x.im x.re))
y.re)
(if (<= y.im 2.5e+33)
(* t_0 (pow (hypot x.im x.re) y.re))
(*
(pow (* (fma (/ 0.5 x.im) (/ (* x.re x.re) x.im) 1.0) x.im) y.re)
(sin 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;
double tmp;
if (y_46_im <= -1.16e+247) {
tmp = fma(((atan2(x_46_im, x_46_re) / x_46_re) * (((x_46_im * x_46_im) / x_46_re) * 0.5)), y_46_re, atan2(x_46_im, x_46_re)) * y_46_re;
} else if (y_46_im <= 2.5e+33) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow((fma((0.5 / x_46_im), ((x_46_re * x_46_re) / x_46_im), 1.0) * x_46_im), y_46_re) * sin(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_re) tmp = 0.0 if (y_46_im <= -1.16e+247) tmp = Float64(fma(Float64(Float64(atan(x_46_im, x_46_re) / x_46_re) * Float64(Float64(Float64(x_46_im * x_46_im) / x_46_re) * 0.5)), y_46_re, atan(x_46_im, x_46_re)) * y_46_re); elseif (y_46_im <= 2.5e+33) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64((Float64(fma(Float64(0.5 / x_46_im), Float64(Float64(x_46_re * x_46_re) / x_46_im), 1.0) * x_46_im) ^ y_46_re) * sin(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$im, -1.16e+247], N[(N[(N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / x$46$re), $MachinePrecision] * N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * y$46$re + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 2.5e+33], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[(N[(0.5 / x$46$im), $MachinePrecision] * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.im \leq -1.16 \cdot 10^{+247}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{x.re} \cdot \left(\frac{x.im \cdot x.im}{x.re} \cdot 0.5\right), y.re, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\\
\mathbf{elif}\;y.im \leq 2.5 \cdot 10^{+33}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, 1\right) \cdot x.im\right)}^{y.re} \cdot \sin t\_0\\
\end{array}
\end{array}
if y.im < -1.16000000000000006e247Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6410.5
Applied rewrites10.5%
Taylor expanded in y.re around 0
Applied rewrites10.8%
Taylor expanded in x.re around -inf
Applied rewrites26.1%
Taylor expanded in x.im around inf
Applied rewrites51.1%
if -1.16000000000000006e247 < y.im < 2.49999999999999986e33Initial program 42.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6446.6
Applied rewrites46.6%
Taylor expanded in y.re around 0
Applied rewrites47.4%
if 2.49999999999999986e33 < y.im Initial program 43.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6429.6
Applied rewrites29.6%
Taylor expanded in x.im around inf
Applied rewrites35.8%
Final simplification45.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* x.im x.im) x.re)) (t_1 (* (atan2 x.im x.re) y.re)))
(if (<= y.im -1.16e+247)
(*
(fma (* (/ (atan2 x.im x.re) x.re) (* t_0 0.5)) y.re (atan2 x.im x.re))
y.re)
(if (<= y.im 7.7e+86)
(* t_1 (pow (hypot x.im x.re) y.re))
(* (pow (fma t_0 0.5 x.re) y.re) (sin t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * x_46_im) / x_46_re;
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_im <= -1.16e+247) {
tmp = fma(((atan2(x_46_im, x_46_re) / x_46_re) * (t_0 * 0.5)), y_46_re, atan2(x_46_im, x_46_re)) * y_46_re;
} else if (y_46_im <= 7.7e+86) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow(fma(t_0, 0.5, x_46_re), y_46_re) * sin(t_1);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im * x_46_im) / x_46_re) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_im <= -1.16e+247) tmp = Float64(fma(Float64(Float64(atan(x_46_im, x_46_re) / x_46_re) * Float64(t_0 * 0.5)), y_46_re, atan(x_46_im, x_46_re)) * y_46_re); elseif (y_46_im <= 7.7e+86) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64((fma(t_0, 0.5, x_46_re) ^ y_46_re) * sin(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[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$im, -1.16e+247], N[(N[(N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / x$46$re), $MachinePrecision] * N[(t$95$0 * 0.5), $MachinePrecision]), $MachinePrecision] * y$46$re + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 7.7e+86], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(t$95$0 * 0.5 + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.im \leq -1.16 \cdot 10^{+247}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{x.re} \cdot \left(t\_0 \cdot 0.5\right), y.re, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\\
\mathbf{elif}\;y.im \leq 7.7 \cdot 10^{+86}:\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(t\_0, 0.5, x.re\right)\right)}^{y.re} \cdot \sin t\_1\\
\end{array}
\end{array}
if y.im < -1.16000000000000006e247Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6410.5
Applied rewrites10.5%
Taylor expanded in y.re around 0
Applied rewrites10.8%
Taylor expanded in x.re around -inf
Applied rewrites26.1%
Taylor expanded in x.im around inf
Applied rewrites51.1%
if -1.16000000000000006e247 < y.im < 7.70000000000000053e86Initial program 44.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6445.9
Applied rewrites45.9%
Taylor expanded in y.re around 0
Applied rewrites46.2%
if 7.70000000000000053e86 < y.im Initial program 35.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6428.1
Applied rewrites28.1%
Taylor expanded in x.im around 0
Applied rewrites37.8%
Final simplification44.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.re -570.0)
(* (pow x.re y.re) t_0)
(if (<= y.re 1.3e-16) (* 1.0 t_0) (* (pow x.im y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -570.0) {
tmp = pow(x_46_re, y_46_re) * t_0;
} else if (y_46_re <= 1.3e-16) {
tmp = 1.0 * t_0;
} else {
tmp = pow(x_46_im, 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 (y_46re <= (-570.0d0)) then
tmp = (x_46re ** y_46re) * t_0
else if (y_46re <= 1.3d-16) then
tmp = 1.0d0 * t_0
else
tmp = (x_46im ** 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 (y_46_re <= -570.0) {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
} else if (y_46_re <= 1.3e-16) {
tmp = 1.0 * t_0;
} else {
tmp = Math.pow(x_46_im, 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 y_46_re <= -570.0: tmp = math.pow(x_46_re, y_46_re) * t_0 elif y_46_re <= 1.3e-16: tmp = 1.0 * t_0 else: tmp = math.pow(x_46_im, 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 (y_46_re <= -570.0) tmp = Float64((x_46_re ^ y_46_re) * t_0); elseif (y_46_re <= 1.3e-16) tmp = Float64(1.0 * t_0); else tmp = Float64((x_46_im ^ 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 (y_46_re <= -570.0) tmp = (x_46_re ^ y_46_re) * t_0; elseif (y_46_re <= 1.3e-16) tmp = 1.0 * t_0; else tmp = (x_46_im ^ 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[y$46$re, -570.0], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.3e-16], N[(1.0 * t$95$0), $MachinePrecision], N[(N[Power[x$46$im, 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}\;y.re \leq -570:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-16}:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -570Initial program 45.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6481.5
Applied rewrites81.5%
Taylor expanded in x.im around 0
Applied rewrites69.8%
if -570 < y.re < 1.2999999999999999e-16Initial program 45.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6423.3
Applied rewrites23.3%
Taylor expanded in y.re around 0
Applied rewrites20.3%
if 1.2999999999999999e-16 < y.re Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6440.0
Applied rewrites40.0%
Taylor expanded in x.re around 0
Applied rewrites34.2%
(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 -1.4e-8) t_1 (if (<= y.re 1.3e-16) (* 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 <= -1.4e-8) {
tmp = t_1;
} else if (y_46_re <= 1.3e-16) {
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 <= (-1.4d-8)) then
tmp = t_1
else if (y_46re <= 1.3d-16) 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 <= -1.4e-8) {
tmp = t_1;
} else if (y_46_re <= 1.3e-16) {
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 <= -1.4e-8: tmp = t_1 elif y_46_re <= 1.3e-16: 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 <= -1.4e-8) tmp = t_1; elseif (y_46_re <= 1.3e-16) 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 <= -1.4e-8) tmp = t_1; elseif (y_46_re <= 1.3e-16) 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, -1.4e-8], t$95$1, If[LessEqual[y$46$re, 1.3e-16], 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 -1.4 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-16}:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.4e-8 or 1.2999999999999999e-16 < y.re Initial program 39.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.6
Applied rewrites59.6%
Taylor expanded in x.re around 0
Applied rewrites39.4%
if -1.4e-8 < y.re < 1.2999999999999999e-16Initial program 45.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6421.3
Applied rewrites21.3%
Taylor expanded in y.re around 0
Applied rewrites20.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.16e+247)
(*
(fma
(* (/ (atan2 x.im x.re) x.re) (* (/ (* x.im x.im) x.re) 0.5))
y.re
(atan2 x.im x.re))
y.re)
(* (* (atan2 x.im x.re) y.re) (pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -1.16e+247) {
tmp = fma(((atan2(x_46_im, x_46_re) / x_46_re) * (((x_46_im * x_46_im) / x_46_re) * 0.5)), y_46_re, atan2(x_46_im, x_46_re)) * y_46_re;
} else {
tmp = (atan2(x_46_im, x_46_re) * y_46_re) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -1.16e+247) tmp = Float64(fma(Float64(Float64(atan(x_46_im, x_46_re) / x_46_re) * Float64(Float64(Float64(x_46_im * x_46_im) / x_46_re) * 0.5)), y_46_re, atan(x_46_im, x_46_re)) * y_46_re); else tmp = Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -1.16e+247], N[(N[(N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / x$46$re), $MachinePrecision] * N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * y$46$re + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision], N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.16 \cdot 10^{+247}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{x.re} \cdot \left(\frac{x.im \cdot x.im}{x.re} \cdot 0.5\right), y.re, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\\
\mathbf{else}:\\
\;\;\;\;\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -1.16000000000000006e247Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6410.5
Applied rewrites10.5%
Taylor expanded in y.re around 0
Applied rewrites10.8%
Taylor expanded in x.re around -inf
Applied rewrites26.1%
Taylor expanded in x.im around inf
Applied rewrites51.1%
if -1.16000000000000006e247 < y.im Initial program 42.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6442.5
Applied rewrites42.5%
Taylor expanded in y.re around 0
Applied rewrites42.8%
Final simplification43.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(fma
(* (/ (atan2 x.im x.re) x.re) (* (/ (* x.im x.im) x.re) 0.5))
y.re
(atan2 x.im x.re))
y.re)))
(if (<= y.im -7e-91)
t_0
(if (<= y.im 6.2e+55) (* 1.0 (sin (* (atan2 x.im 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 = fma(((atan2(x_46_im, x_46_re) / x_46_re) * (((x_46_im * x_46_im) / x_46_re) * 0.5)), y_46_re, atan2(x_46_im, x_46_re)) * y_46_re;
double tmp;
if (y_46_im <= -7e-91) {
tmp = t_0;
} else if (y_46_im <= 6.2e+55) {
tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(fma(Float64(Float64(atan(x_46_im, x_46_re) / x_46_re) * Float64(Float64(Float64(x_46_im * x_46_im) / x_46_re) * 0.5)), y_46_re, atan(x_46_im, x_46_re)) * y_46_re) tmp = 0.0 if (y_46_im <= -7e-91) tmp = t_0; elseif (y_46_im <= 6.2e+55) tmp = Float64(1.0 * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / x$46$re), $MachinePrecision] * N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * y$46$re + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$im, -7e-91], t$95$0, If[LessEqual[y$46$im, 6.2e+55], N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{x.re} \cdot \left(\frac{x.im \cdot x.im}{x.re} \cdot 0.5\right), y.re, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\\
\mathbf{if}\;y.im \leq -7 \cdot 10^{-91}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 6.2 \cdot 10^{+55}:\\
\;\;\;\;1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -6.9999999999999997e-91 or 6.19999999999999987e55 < y.im Initial program 34.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6426.2
Applied rewrites26.2%
Taylor expanded in y.re around 0
Applied rewrites11.7%
Taylor expanded in x.re around -inf
Applied rewrites12.5%
Taylor expanded in x.im around inf
Applied rewrites18.7%
if -6.9999999999999997e-91 < y.im < 6.19999999999999987e55Initial program 49.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6454.1
Applied rewrites54.1%
Taylor expanded in y.re around 0
Applied rewrites21.3%
Final simplification20.1%
(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 42.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6441.0
Applied rewrites41.0%
Taylor expanded in y.re around 0
Applied rewrites13.9%
herbie shell --seed 2024276
(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)))))