
(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 18 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 (pow (hypot x.re x.im) y.re))
(t_3 (log (hypot x.re x.im))))
(if (<= y.re -3.4e-7)
(* (fma (* t_3 (cos t_0)) y.im (sin t_0)) t_1)
(if (<= y.re 2.9e+79)
(/
-1.0
(/
(/
(/ (pow (exp y.im) (atan2 x.im x.re)) t_2)
(sin (fma t_3 y.im t_0)))
-1.0))
(if (<= y.re 4e+216) (* (sin (* t_3 y.im)) t_1) (* t_0 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 = 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 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_3 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -3.4e-7) {
tmp = fma((t_3 * cos(t_0)), y_46_im, sin(t_0)) * t_1;
} else if (y_46_re <= 2.9e+79) {
tmp = -1.0 / (((pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / t_2) / sin(fma(t_3, y_46_im, t_0))) / -1.0);
} else if (y_46_re <= 4e+216) {
tmp = sin((t_3 * y_46_im)) * t_1;
} else {
tmp = t_0 * 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 = 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 = hypot(x_46_re, x_46_im) ^ y_46_re t_3 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -3.4e-7) tmp = Float64(fma(Float64(t_3 * cos(t_0)), y_46_im, sin(t_0)) * t_1); elseif (y_46_re <= 2.9e+79) tmp = Float64(-1.0 / Float64(Float64(Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) / t_2) / sin(fma(t_3, y_46_im, t_0))) / -1.0)); elseif (y_46_re <= 4e+216) tmp = Float64(sin(Float64(t_3 * y_46_im)) * t_1); else tmp = Float64(t_0 * 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[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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.4e-7], N[(N[(N[(t$95$3 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * y$46$im + N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 2.9e+79], N[(-1.0 / N[(N[(N[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision] / N[Sin[N[(t$95$3 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4e+216], N[(N[Sin[N[(t$95$3 * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$0 * t$95$2), $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 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -3.4 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(t\_3 \cdot \cos t\_0, y.im, \sin t\_0\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 2.9 \cdot 10^{+79}:\\
\;\;\;\;\frac{-1}{\frac{\frac{\frac{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{t\_2}}{\sin \left(\mathsf{fma}\left(t\_3, y.im, t\_0\right)\right)}}{-1}}\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{+216}:\\
\;\;\;\;\sin \left(t\_3 \cdot y.im\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_2\\
\end{array}
\end{array}
if y.re < -3.39999999999999974e-7Initial program 52.3%
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
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
Applied rewrites81.6%
if -3.39999999999999974e-7 < y.re < 2.89999999999999992e79Initial program 36.7%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites78.0%
Applied rewrites79.4%
if 2.89999999999999992e79 < y.re < 4.0000000000000001e216Initial program 37.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.f6484.4
Applied rewrites84.4%
if 4.0000000000000001e216 < y.re Initial program 27.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.f6461.1
Applied rewrites61.1%
Taylor expanded in y.re around 0
Applied rewrites94.4%
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 (* t_0 (pow (hypot x.re x.im) y.re))))
(if (<= y.re -7.2e+70)
t_1
(if (<= y.re 6.4e+43)
(pow
(/
(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)))
-1.0)
(if (<= y.re 4e+216)
(*
(sin (* (log (hypot x.re x.im)) y.im))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -7.2e+70) {
tmp = t_1;
} else if (y_46_re <= 6.4e+43) {
tmp = pow((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))), -1.0);
} else if (y_46_re <= 4e+216) {
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) - (y_46_im * atan2(x_46_im, x_46_re))));
} 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(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -7.2e+70) tmp = t_1; elseif (y_46_re <= 6.4e+43) tmp = 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))) ^ -1.0; elseif (y_46_re <= 4e+216) 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) - Float64(y_46_im * atan(x_46_im, x_46_re))))); 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[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.2e+70], t$95$1, If[LessEqual[y$46$re, 6.4e+43], N[Power[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], -1.0], $MachinePrecision], If[LessEqual[y$46$re, 4e+216], 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] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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 := t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -7.2 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 6.4 \cdot 10^{+43}:\\
\;\;\;\;{\left(\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}}\right)}^{-1}\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{+216}:\\
\;\;\;\;\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 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -7.1999999999999999e70 or 4.0000000000000001e216 < y.re Initial program 44.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.f6469.7
Applied rewrites69.7%
Taylor expanded in y.re around 0
Applied rewrites84.2%
if -7.1999999999999999e70 < y.re < 6.40000000000000029e43Initial program 38.8%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites79.9%
if 6.40000000000000029e43 < y.re < 4.0000000000000001e216Initial program 36.8%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.4
Applied rewrites76.4%
Final simplification80.5%
(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)))))
(t_1 (pow (hypot x.re x.im) y.re))
(t_2 (* (atan2 x.im x.re) y.re))
(t_3 (log (hypot x.re x.im))))
(if (<= y.re -1.8e+64)
(* (sin (* (fma y.im (/ t_3 y.re) (atan2 x.im x.re)) y.re)) t_0)
(if (<= y.re 2.9e+79)
(/
-1.0
(/
(/
(/ (pow (exp y.im) (atan2 x.im x.re)) t_1)
(sin (fma t_3 y.im t_2)))
-1.0))
(if (<= y.re 4e+216) (* (sin (* t_3 y.im)) t_0) (* t_2 t_1))))))
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 t_1 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_2 = atan2(x_46_im, x_46_re) * y_46_re;
double t_3 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -1.8e+64) {
tmp = sin((fma(y_46_im, (t_3 / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re)) * t_0;
} else if (y_46_re <= 2.9e+79) {
tmp = -1.0 / (((pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / t_1) / sin(fma(t_3, y_46_im, t_2))) / -1.0);
} else if (y_46_re <= 4e+216) {
tmp = sin((t_3 * y_46_im)) * t_0;
} else {
tmp = t_2 * t_1;
}
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)))) t_1 = hypot(x_46_re, x_46_im) ^ y_46_re t_2 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_3 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -1.8e+64) tmp = Float64(sin(Float64(fma(y_46_im, Float64(t_3 / y_46_re), atan(x_46_im, x_46_re)) * y_46_re)) * t_0); elseif (y_46_re <= 2.9e+79) tmp = Float64(-1.0 / Float64(Float64(Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) / t_1) / sin(fma(t_3, y_46_im, t_2))) / -1.0)); elseif (y_46_re <= 4e+216) tmp = Float64(sin(Float64(t_3 * y_46_im)) * t_0); else tmp = Float64(t_2 * t_1); end return 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]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.8e+64], N[(N[Sin[N[(N[(y$46$im * N[(t$95$3 / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 2.9e+79], N[(-1.0 / N[(N[(N[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision] / N[Sin[N[(t$95$3 * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4e+216], N[(N[Sin[N[(t$95$3 * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$2 * t$95$1), $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}}\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{+64}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.im, \frac{t\_3}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 2.9 \cdot 10^{+79}:\\
\;\;\;\;\frac{-1}{\frac{\frac{\frac{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{t\_1}}{\sin \left(\mathsf{fma}\left(t\_3, y.im, t\_2\right)\right)}}{-1}}\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{+216}:\\
\;\;\;\;\sin \left(t\_3 \cdot y.im\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot t\_1\\
\end{array}
\end{array}
if y.re < -1.80000000000000007e64Initial program 51.9%
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.f6480.9
Applied rewrites80.9%
if -1.80000000000000007e64 < y.re < 2.89999999999999992e79Initial program 38.1%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites77.9%
Applied rewrites79.9%
if 2.89999999999999992e79 < y.re < 4.0000000000000001e216Initial program 37.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.f6484.4
Applied rewrites84.4%
if 4.0000000000000001e216 < y.re Initial program 27.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.f6461.1
Applied rewrites61.1%
Taylor expanded in y.re around 0
Applied rewrites94.4%
Final simplification80.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (log (hypot x.re x.im)) y.im)))
(t_1 (* y.im (atan2 x.im x.re))))
(if (<= y.im -3.4e-36)
(/ -1.0 (/ (- (pow (exp y.im) (atan2 x.im x.re))) t_0))
(if (<= y.im 0.05)
(pow
(/
(+ t_1 1.0)
(*
(sin (fma y.im (log (hypot x.im x.re)) (* (atan2 x.im x.re) y.re)))
(pow (hypot x.im x.re) y.re)))
-1.0)
(*
t_0
(exp
(- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_1)))))))
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 t_1 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -3.4e-36) {
tmp = -1.0 / (-pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / t_0);
} else if (y_46_im <= 0.05) {
tmp = pow(((t_1 + 1.0) / (sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), (atan2(x_46_im, x_46_re) * y_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re))), -1.0);
} else {
tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_1));
}
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)) t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -3.4e-36) tmp = Float64(-1.0 / Float64(Float64(-(exp(y_46_im) ^ atan(x_46_im, x_46_re))) / t_0)); elseif (y_46_im <= 0.05) tmp = Float64(Float64(t_1 + 1.0) / Float64(sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), Float64(atan(x_46_im, x_46_re) * y_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re))) ^ -1.0; else 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) - t_1))); 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]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.4e-36], N[(-1.0 / N[((-N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 0.05], N[Power[N[(N[(t$95$1 + 1.0), $MachinePrecision] / N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], 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] - t$95$1), $MachinePrecision]], $MachinePrecision]), $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)\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -3.4 \cdot 10^{-36}:\\
\;\;\;\;\frac{-1}{\frac{-{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{t\_0}}\\
\mathbf{elif}\;y.im \leq 0.05:\\
\;\;\;\;{\left(\frac{t\_1 + 1}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_1}\\
\end{array}
\end{array}
if y.im < -3.4000000000000003e-36Initial program 35.5%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites51.4%
Applied rewrites68.9%
Taylor expanded in y.re around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6474.4
Applied rewrites74.4%
if -3.4000000000000003e-36 < y.im < 0.050000000000000003Initial program 45.8%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites89.1%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-*.f64N/A
lower-atan2.f6488.7
Applied rewrites88.7%
if 0.050000000000000003 < y.im Initial program 32.8%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6460.5
Applied rewrites60.5%
Final simplification73.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (pow (hypot x.re x.im) y.re))
(t_2 (* t_0 t_1)))
(if (<= y.re -1e+78)
t_2
(if (<= y.re -2.8e-7)
(*
(*
(fma
(* (* y.re y.re) -0.16666666666666666)
(pow (atan2 x.im x.re) 3.0)
(atan2 x.im x.re))
y.re)
t_1)
(if (<= y.re 22500000000.0)
(*
(sin (pow (pow (fma y.im (log (hypot x.im x.re)) t_0) -1.0) -1.0))
(exp (* (- y.im) (atan2 x.im x.re))))
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 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_2 = t_0 * t_1;
double tmp;
if (y_46_re <= -1e+78) {
tmp = t_2;
} else if (y_46_re <= -2.8e-7) {
tmp = (fma(((y_46_re * y_46_re) * -0.16666666666666666), pow(atan2(x_46_im, x_46_re), 3.0), atan2(x_46_im, x_46_re)) * y_46_re) * t_1;
} else if (y_46_re <= 22500000000.0) {
tmp = sin(pow(pow(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0), -1.0), -1.0)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 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 = hypot(x_46_re, x_46_im) ^ y_46_re t_2 = Float64(t_0 * t_1) tmp = 0.0 if (y_46_re <= -1e+78) tmp = t_2; elseif (y_46_re <= -2.8e-7) tmp = Float64(Float64(fma(Float64(Float64(y_46_re * y_46_re) * -0.16666666666666666), (atan(x_46_im, x_46_re) ^ 3.0), atan(x_46_im, x_46_re)) * y_46_re) * t_1); elseif (y_46_re <= 22500000000.0) tmp = Float64(sin(((fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0) ^ -1.0) ^ -1.0)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = 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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -1e+78], t$95$2, If[LessEqual[y$46$re, -2.8e-7], N[(N[(N[(N[(N[(y$46$re * y$46$re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 22500000000.0], N[(N[Sin[N[Power[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], -1.0], $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_2 := t\_0 \cdot t\_1\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{+78}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -2.8 \cdot 10^{-7}:\\
\;\;\;\;\left(\mathsf{fma}\left(\left(y.re \cdot y.re\right) \cdot -0.16666666666666666, {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 22500000000:\\
\;\;\;\;\sin \left({\left({\left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right)}^{-1}\right)}^{-1}\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -1.00000000000000001e78 or 2.25e10 < y.re 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.f6464.7
Applied rewrites64.7%
Taylor expanded in y.re around 0
Applied rewrites74.7%
if -1.00000000000000001e78 < y.re < -2.80000000000000019e-7Initial program 58.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.f6476.7
Applied rewrites76.7%
Taylor expanded in y.re around 0
Applied rewrites88.4%
if -2.80000000000000019e-7 < y.re < 2.25e10Initial program 36.2%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites44.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.f6480.2
Applied rewrites80.2%
Final simplification78.4%
(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)))))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (log (hypot x.re x.im))))
(if (<= y.re -2.6e-7)
(* (sin (* (fma y.im (/ t_2 y.re) (atan2 x.im x.re)) y.re)) t_0)
(if (<= y.re 1.7e+68)
(*
(sin (pow (pow (fma y.im (log (hypot x.im x.re)) t_1) -1.0) -1.0))
(exp (* (- y.im) (atan2 x.im x.re))))
(if (<= y.re 4e+216)
(* (sin (* t_2 y.im)) t_0)
(* t_1 (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 = 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_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -2.6e-7) {
tmp = sin((fma(y_46_im, (t_2 / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re)) * t_0;
} else if (y_46_re <= 1.7e+68) {
tmp = sin(pow(pow(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1), -1.0), -1.0)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 4e+216) {
tmp = sin((t_2 * y_46_im)) * t_0;
} else {
tmp = t_1 * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -2.6e-7) tmp = Float64(sin(Float64(fma(y_46_im, Float64(t_2 / y_46_re), atan(x_46_im, x_46_re)) * y_46_re)) * t_0); elseif (y_46_re <= 1.7e+68) tmp = Float64(sin(((fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1) ^ -1.0) ^ -1.0)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 4e+216) tmp = Float64(sin(Float64(t_2 * y_46_im)) * t_0); else tmp = Float64(t_1 * (hypot(x_46_re, x_46_im) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[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$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.6e-7], N[(N[Sin[N[(N[(y$46$im * N[(t$95$2 / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.7e+68], N[(N[Sin[N[Power[N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4e+216], N[(N[Sin[N[(t$95$2 * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$1 * 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 := 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_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -2.6 \cdot 10^{-7}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.im, \frac{t\_2}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{+68}:\\
\;\;\;\;\sin \left({\left({\left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_1\right)\right)}^{-1}\right)}^{-1}\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{+216}:\\
\;\;\;\;\sin \left(t\_2 \cdot y.im\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.59999999999999999e-7Initial program 52.3%
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.f6480.1
Applied rewrites80.1%
if -2.59999999999999999e-7 < y.re < 1.70000000000000008e68Initial program 36.5%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites44.3%
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.f6477.4
Applied rewrites77.4%
if 1.70000000000000008e68 < y.re < 4.0000000000000001e216Initial program 38.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.f6482.4
Applied rewrites82.4%
if 4.0000000000000001e216 < y.re Initial program 27.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.f6461.1
Applied rewrites61.1%
Taylor expanded in y.re around 0
Applied rewrites94.4%
Final simplification79.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 (* (log (hypot x.re x.im)) y.im))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))))
(if (<= y.re -1.0)
t_1
(if (<= y.re 1.7e+68)
(*
(sin (pow (pow (fma y.im (log (hypot x.im x.re)) t_0) -1.0) -1.0))
(exp (* (- y.im) (atan2 x.im x.re))))
(if (<= y.re 4e+216) t_1 (* 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 t_1 = 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) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.0) {
tmp = t_1;
} else if (y_46_re <= 1.7e+68) {
tmp = sin(pow(pow(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0), -1.0), -1.0)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 4e+216) {
tmp = t_1;
} else {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = 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) - Float64(y_46_im * atan(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_re <= -1.0) tmp = t_1; elseif (y_46_re <= 1.7e+68) tmp = Float64(sin(((fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0) ^ -1.0) ^ -1.0)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 4e+216) tmp = t_1; else tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = 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] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.0], t$95$1, If[LessEqual[y$46$re, 1.7e+68], N[(N[Sin[N[Power[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], -1.0], $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4e+216], t$95$1, 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\\
t_1 := \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 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{+68}:\\
\;\;\;\;\sin \left({\left({\left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right)}^{-1}\right)}^{-1}\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{+216}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -1 or 1.70000000000000008e68 < y.re < 4.0000000000000001e216Initial program 46.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.f6480.7
Applied rewrites80.7%
if -1 < y.re < 1.70000000000000008e68Initial program 37.0%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites44.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.f6477.1
Applied rewrites77.1%
if 4.0000000000000001e216 < y.re Initial program 27.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.f6461.1
Applied rewrites61.1%
Taylor expanded in y.re around 0
Applied rewrites94.4%
Final simplification79.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)) (t_1 (log (hypot x.im x.re))))
(if (<= y.im -1.35e+61)
(/
-1.0
(/
(- (pow (exp y.im) (atan2 x.im x.re)))
(sin (* (log (hypot x.re x.im)) y.im))))
(if (<= y.im 0.28)
(pow
(/ 1.0 (* (sin (fma y.im t_1 t_0)) (pow (hypot x.im x.re) y.re)))
-1.0)
(if (<= y.im 4.5e+206)
(*
(sin t_0)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(* (sin (* t_1 y.im)) (exp (* (- y.im) (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -1.35e+61) {
tmp = -1.0 / (-pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / sin((log(hypot(x_46_re, x_46_im)) * y_46_im)));
} else if (y_46_im <= 0.28) {
tmp = pow((1.0 / (sin(fma(y_46_im, t_1, t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re))), -1.0);
} else if (y_46_im <= 4.5e+206) {
tmp = 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))));
} else {
tmp = sin((t_1 * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -1.35e+61) tmp = Float64(-1.0 / Float64(Float64(-(exp(y_46_im) ^ atan(x_46_im, x_46_re))) / sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)))); elseif (y_46_im <= 0.28) tmp = Float64(1.0 / Float64(sin(fma(y_46_im, t_1, t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re))) ^ -1.0; elseif (y_46_im <= 4.5e+206) tmp = 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))))); else tmp = Float64(sin(Float64(t_1 * y_46_im)) * exp(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.35e+61], N[(-1.0 / N[((-N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]) / N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 0.28], N[Power[N[(1.0 / N[(N[Sin[N[(y$46$im * t$95$1 + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], If[LessEqual[y$46$im, 4.5e+206], 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], N[(N[Sin[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -1.35 \cdot 10^{+61}:\\
\;\;\;\;\frac{-1}{\frac{-{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)}}\\
\mathbf{elif}\;y.im \leq 0.28:\\
\;\;\;\;{\left(\frac{1}{\sin \left(\mathsf{fma}\left(y.im, t\_1, t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}\right)}^{-1}\\
\mathbf{elif}\;y.im \leq 4.5 \cdot 10^{+206}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;\sin \left(t\_1 \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < -1.3500000000000001e61Initial program 32.7%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites49.4%
Applied rewrites69.9%
Taylor expanded in y.re around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6478.2
Applied rewrites78.2%
if -1.3500000000000001e61 < y.im < 0.28000000000000003Initial program 46.5%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites87.7%
Taylor expanded in y.im around 0
Applied rewrites85.7%
if 0.28000000000000003 < y.im < 4.50000000000000018e206Initial program 30.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6454.9
Applied rewrites54.9%
if 4.50000000000000018e206 < y.im Initial program 36.5%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites42.9%
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.f6477.8
Applied rewrites77.8%
Final simplification73.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re))
(t_1 (* (* (atan2 x.im x.re) y.re) t_0)))
(if (<= y.re -6.4e+102)
t_1
(if (<= y.re -5.4e-77)
(*
(*
(fma
(* (* y.re y.re) -0.16666666666666666)
(pow (atan2 x.im x.re) 3.0)
(atan2 x.im x.re))
y.re)
t_0)
(if (<= y.re 1.8e+35)
(/
-1.0
(/
(- (pow (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 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = (atan2(x_46_im, x_46_re) * y_46_re) * t_0;
double tmp;
if (y_46_re <= -6.4e+102) {
tmp = t_1;
} else if (y_46_re <= -5.4e-77) {
tmp = (fma(((y_46_re * y_46_re) * -0.16666666666666666), pow(atan2(x_46_im, x_46_re), 3.0), atan2(x_46_im, x_46_re)) * y_46_re) * t_0;
} else if (y_46_re <= 1.8e+35) {
tmp = -1.0 / (-pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / sin((log(hypot(x_46_re, x_46_im)) * y_46_im)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -6.4e+102) tmp = t_1; elseif (y_46_re <= -5.4e-77) tmp = Float64(Float64(fma(Float64(Float64(y_46_re * y_46_re) * -0.16666666666666666), (atan(x_46_im, x_46_re) ^ 3.0), atan(x_46_im, x_46_re)) * y_46_re) * t_0); elseif (y_46_re <= 1.8e+35) tmp = Float64(-1.0 / Float64(Float64(-(exp(y_46_im) ^ atan(x_46_im, x_46_re))) / sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)))); 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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -6.4e+102], t$95$1, If[LessEqual[y$46$re, -5.4e-77], N[(N[(N[(N[(N[(y$46$re * y$46$re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.8e+35], N[(-1.0 / N[((-N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]) / N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_0\\
\mathbf{if}\;y.re \leq -6.4 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -5.4 \cdot 10^{-77}:\\
\;\;\;\;\left(\mathsf{fma}\left(\left(y.re \cdot y.re\right) \cdot -0.16666666666666666, {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{+35}:\\
\;\;\;\;\frac{-1}{\frac{-{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -6.3999999999999999e102 or 1.8e35 < y.re Initial program 42.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.f6465.5
Applied rewrites65.5%
Taylor expanded in y.re around 0
Applied rewrites76.1%
if -6.3999999999999999e102 < y.re < -5.4000000000000001e-77Initial program 57.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.f6462.1
Applied rewrites62.1%
Taylor expanded in y.re around 0
Applied rewrites68.6%
if -5.4000000000000001e-77 < y.re < 1.8e35Initial program 33.7%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites80.2%
Applied rewrites81.9%
Taylor expanded in y.re around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6466.0
Applied rewrites66.0%
Final simplification69.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re))
(t_1 (* (* (atan2 x.im x.re) y.re) t_0)))
(if (<= y.re -6.4e+102)
t_1
(if (<= y.re -5.4e-77)
(*
(*
(fma
(* (* y.re y.re) -0.16666666666666666)
(pow (atan2 x.im x.re) 3.0)
(atan2 x.im x.re))
y.re)
t_0)
(if (<= y.re 1.22e-81)
(*
(sin (* (log (hypot x.im x.re)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = (atan2(x_46_im, x_46_re) * y_46_re) * t_0;
double tmp;
if (y_46_re <= -6.4e+102) {
tmp = t_1;
} else if (y_46_re <= -5.4e-77) {
tmp = (fma(((y_46_re * y_46_re) * -0.16666666666666666), pow(atan2(x_46_im, x_46_re), 3.0), atan2(x_46_im, x_46_re)) * y_46_re) * t_0;
} else if (y_46_re <= 1.22e-81) {
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_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -6.4e+102) tmp = t_1; elseif (y_46_re <= -5.4e-77) tmp = Float64(Float64(fma(Float64(Float64(y_46_re * y_46_re) * -0.16666666666666666), (atan(x_46_im, x_46_re) ^ 3.0), atan(x_46_im, x_46_re)) * y_46_re) * t_0); elseif (y_46_re <= 1.22e-81) 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_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -6.4e+102], t$95$1, If[LessEqual[y$46$re, -5.4e-77], N[(N[(N[(N[(N[(y$46$re * y$46$re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.22e-81], 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$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_0\\
\mathbf{if}\;y.re \leq -6.4 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -5.4 \cdot 10^{-77}:\\
\;\;\;\;\left(\mathsf{fma}\left(\left(y.re \cdot y.re\right) \cdot -0.16666666666666666, {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.22 \cdot 10^{-81}:\\
\;\;\;\;\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\_1\\
\end{array}
\end{array}
if y.re < -6.3999999999999999e102 or 1.22000000000000009e-81 < y.re Initial program 38.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.f6461.8
Applied rewrites61.8%
Taylor expanded in y.re around 0
Applied rewrites69.7%
if -6.3999999999999999e102 < y.re < -5.4000000000000001e-77Initial program 57.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.f6462.1
Applied rewrites62.1%
Taylor expanded in y.re around 0
Applied rewrites68.6%
if -5.4000000000000001e-77 < y.re < 1.22000000000000009e-81Initial program 37.3%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites45.9%
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.f6471.6
Applied rewrites71.6%
Final simplification70.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -5.4e-77) (not (<= y.re 1.22e-81)))
(* (* (atan2 x.im x.re) y.re) (pow (hypot x.re x.im) y.re))
(*
(sin (* (log (hypot x.im x.re)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -5.4e-77) || !(y_46_re <= 1.22e-81)) {
tmp = (atan2(x_46_im, x_46_re) * y_46_re) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -5.4e-77) || !(y_46_re <= 1.22e-81)) {
tmp = (Math.atan2(x_46_im, x_46_re) * y_46_re) * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else {
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)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -5.4e-77) or not (y_46_re <= 1.22e-81): tmp = (math.atan2(x_46_im, x_46_re) * y_46_re) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) else: 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))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -5.4e-77) || !(y_46_re <= 1.22e-81)) tmp = Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else 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)))); 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 <= -5.4e-77) || ~((y_46_re <= 1.22e-81))) tmp = (atan2(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_re, x_46_im) ^ y_46_re); else tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -5.4e-77], N[Not[LessEqual[y$46$re, 1.22e-81]], $MachinePrecision]], 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], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5.4 \cdot 10^{-77} \lor \neg \left(y.re \leq 1.22 \cdot 10^{-81}\right):\\
\;\;\;\;\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{else}:\\
\;\;\;\;\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}}\\
\end{array}
\end{array}
if y.re < -5.4000000000000001e-77 or 1.22000000000000009e-81 < y.re Initial program 41.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.f6461.9
Applied rewrites61.9%
Taylor expanded in y.re around 0
Applied rewrites66.8%
if -5.4000000000000001e-77 < y.re < 1.22000000000000009e-81Initial program 37.3%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites45.9%
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.f6471.6
Applied rewrites71.6%
Final simplification68.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re -3.25e+224)
(*
(sin (* (- y.im) (log (/ -1.0 x.re))))
(exp (* (- y.im) (atan2 x.im x.re))))
(* (* (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) {
double tmp;
if (x_46_re <= -3.25e+224) {
tmp = sin((-y_46_im * log((-1.0 / x_46_re)))) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = (atan2(x_46_im, x_46_re) * y_46_re) * 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 tmp;
if (x_46_re <= -3.25e+224) {
tmp = Math.sin((-y_46_im * Math.log((-1.0 / x_46_re)))) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = (Math.atan2(x_46_im, x_46_re) * y_46_re) * 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): tmp = 0 if x_46_re <= -3.25e+224: tmp = math.sin((-y_46_im * math.log((-1.0 / x_46_re)))) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = (math.atan2(x_46_im, x_46_re) * y_46_re) * 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) tmp = 0.0 if (x_46_re <= -3.25e+224) tmp = Float64(sin(Float64(Float64(-y_46_im) * log(Float64(-1.0 / x_46_re)))) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) * (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) tmp = 0.0; if (x_46_re <= -3.25e+224) tmp = sin((-y_46_im * log((-1.0 / x_46_re)))) * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = (atan2(x_46_im, x_46_re) * y_46_re) * (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_] := If[LessEqual[x$46$re, -3.25e+224], N[(N[Sin[N[((-y$46$im) * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -3.25 \cdot 10^{+224}:\\
\;\;\;\;\sin \left(\left(-y.im\right) \cdot \log \left(\frac{-1}{x.re}\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;\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}
\end{array}
if x.re < -3.25000000000000006e224Initial program 0.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 rewrites99.6%
Taylor expanded in y.re around 0
Applied rewrites74.9%
if -3.25000000000000006e224 < x.re Initial program 42.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.f6445.6
Applied rewrites45.6%
Taylor expanded in y.re around 0
Applied rewrites49.2%
Final simplification50.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 2.95e+212) (* (* (atan2 x.im x.re) y.re) (pow (hypot x.re x.im) y.re)) (* (sin (* (log x.im) y.im)) (exp (* (- y.im) (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 2.95e+212) {
tmp = (atan2(x_46_im, x_46_re) * y_46_re) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = sin((log(x_46_im) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 2.95e+212) {
tmp = (Math.atan2(x_46_im, x_46_re) * y_46_re) * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = Math.sin((Math.log(x_46_im) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= 2.95e+212: tmp = (math.atan2(x_46_im, x_46_re) * y_46_re) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) else: tmp = math.sin((math.log(x_46_im) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= 2.95e+212) tmp = Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64(sin(Float64(log(x_46_im) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= 2.95e+212) tmp = (atan2(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_re, x_46_im) ^ y_46_re); else tmp = sin((log(x_46_im) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, 2.95e+212], 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], N[(N[Sin[N[(N[Log[x$46$im], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 2.95 \cdot 10^{+212}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;\sin \left(\log x.im \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < 2.94999999999999998e212Initial program 40.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.f6446.0
Applied rewrites46.0%
Taylor expanded in y.re around 0
Applied rewrites49.6%
if 2.94999999999999998e212 < y.im Initial program 34.7%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites42.0%
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.f6447.9
Applied rewrites47.9%
Taylor expanded in y.im around 0
Applied rewrites8.9%
Taylor expanded in y.re around 0
Applied rewrites47.9%
Final simplification49.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (or (<= y.re -3.5e-302) (not (<= y.re 4.8e-201)))
(* t_0 (pow (hypot x.re x.im) y.re))
(*
(pow (* (- x.re) (/ (* 0.5 (* x.im x.im)) (* x.re x.re))) 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_re <= -3.5e-302) || !(y_46_re <= 4.8e-201)) {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = pow((-x_46_re * ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))), y_46_re) * sin(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;
double tmp;
if ((y_46_re <= -3.5e-302) || !(y_46_re <= 4.8e-201)) {
tmp = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = Math.pow((-x_46_re * ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))), y_46_re) * Math.sin(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 tmp = 0 if (y_46_re <= -3.5e-302) or not (y_46_re <= 4.8e-201): tmp = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) else: tmp = math.pow((-x_46_re * ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))), y_46_re) * math.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_re <= -3.5e-302) || !(y_46_re <= 4.8e-201)) tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64((Float64(Float64(-x_46_re) * Float64(Float64(0.5 * Float64(x_46_im * x_46_im)) / Float64(x_46_re * x_46_re))) ^ y_46_re) * sin(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; tmp = 0.0; if ((y_46_re <= -3.5e-302) || ~((y_46_re <= 4.8e-201))) tmp = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); else tmp = ((-x_46_re * ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))) ^ y_46_re) * sin(t_0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -3.5e-302], N[Not[LessEqual[y$46$re, 4.8e-201]], $MachinePrecision]], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[((-x$46$re) * N[(N[(0.5 * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $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.re \leq -3.5 \cdot 10^{-302} \lor \neg \left(y.re \leq 4.8 \cdot 10^{-201}\right):\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(-x.re\right) \cdot \frac{0.5 \cdot \left(x.im \cdot x.im\right)}{x.re \cdot x.re}\right)}^{y.re} \cdot \sin t\_0\\
\end{array}
\end{array}
if y.re < -3.5000000000000001e-302 or 4.80000000000000018e-201 < y.re Initial program 40.7%
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.f6448.8
Applied rewrites48.8%
Taylor expanded in y.re around 0
Applied rewrites52.3%
if -3.5000000000000001e-302 < y.re < 4.80000000000000018e-201Initial program 36.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.f6410.6
Applied rewrites10.6%
Taylor expanded in x.re around -inf
Applied rewrites27.8%
Taylor expanded in x.im around inf
Applied rewrites37.2%
Final simplification50.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= x.re 2.7e-100)
(*
(pow (* (- -1.0 (/ (* 0.5 (* x.im x.im)) (* x.re x.re))) x.re) y.re)
t_0)
(* (pow x.re 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 (x_46_re <= 2.7e-100) {
tmp = pow(((-1.0 - ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))) * x_46_re), y_46_re) * t_0;
} else {
tmp = pow(x_46_re, y_46_re) * sin(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 = atan2(x_46im, x_46re) * y_46re
if (x_46re <= 2.7d-100) then
tmp = ((((-1.0d0) - ((0.5d0 * (x_46im * x_46im)) / (x_46re * x_46re))) * x_46re) ** y_46re) * t_0
else
tmp = (x_46re ** y_46re) * sin(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.atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_re <= 2.7e-100) {
tmp = Math.pow(((-1.0 - ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))) * x_46_re), y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_re, y_46_re) * Math.sin(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 tmp = 0 if x_46_re <= 2.7e-100: tmp = math.pow(((-1.0 - ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))) * x_46_re), y_46_re) * t_0 else: tmp = math.pow(x_46_re, y_46_re) * math.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 (x_46_re <= 2.7e-100) tmp = Float64((Float64(Float64(-1.0 - Float64(Float64(0.5 * Float64(x_46_im * x_46_im)) / Float64(x_46_re * x_46_re))) * x_46_re) ^ y_46_re) * t_0); else tmp = Float64((x_46_re ^ y_46_re) * sin(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; tmp = 0.0; if (x_46_re <= 2.7e-100) tmp = (((-1.0 - ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))) * x_46_re) ^ y_46_re) * t_0; else tmp = (x_46_re ^ y_46_re) * sin(t_0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[x$46$re, 2.7e-100], N[(N[Power[N[(N[(-1.0 - N[(N[(0.5 * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$re, 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}\;x.re \leq 2.7 \cdot 10^{-100}:\\
\;\;\;\;{\left(\left(-1 - \frac{0.5 \cdot \left(x.im \cdot x.im\right)}{x.re \cdot x.re}\right) \cdot x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin t\_0\\
\end{array}
\end{array}
if x.re < 2.70000000000000016e-100Initial program 42.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.f6443.3
Applied rewrites43.3%
Taylor expanded in x.re around -inf
Applied rewrites38.8%
Taylor expanded in y.re around 0
Applied rewrites42.2%
if 2.70000000000000016e-100 < x.re Initial program 35.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.9
Applied rewrites45.9%
Taylor expanded in x.im around 0
Applied rewrites42.5%
Final simplification42.3%
(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 40.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.f6444.2
Applied rewrites44.2%
Taylor expanded in y.re around 0
Applied rewrites47.3%
Final simplification47.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (pow (* (- -1.0 (/ (* 0.5 (* x.im x.im)) (* x.re x.re))) x.re) y.re) (* (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 pow(((-1.0 - ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))) * x_46_re), y_46_re) * (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 = ((((-1.0d0) - ((0.5d0 * (x_46im * x_46im)) / (x_46re * x_46re))) * x_46re) ** y_46re) * (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.pow(((-1.0 - ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))) * x_46_re), y_46_re) * (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.pow(((-1.0 - ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))) * x_46_re), y_46_re) * (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((Float64(Float64(-1.0 - Float64(Float64(0.5 * Float64(x_46_im * x_46_im)) / Float64(x_46_re * x_46_re))) * x_46_re) ^ y_46_re) * 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 = (((-1.0 - ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))) * x_46_re) ^ y_46_re) * (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[Power[N[(N[(-1.0 - N[(N[(0.5 * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\left(-1 - \frac{0.5 \cdot \left(x.im \cdot x.im\right)}{x.re \cdot x.re}\right) \cdot x.re\right)}^{y.re} \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
Initial program 40.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.f6444.2
Applied rewrites44.2%
Taylor expanded in x.re around -inf
Applied rewrites38.0%
Taylor expanded in y.re around 0
Applied rewrites39.8%
Final simplification39.8%
(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 40.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.f6444.2
Applied rewrites44.2%
Taylor expanded in y.re around 0
Applied rewrites13.2%
Final simplification13.2%
herbie shell --seed 2024271
(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)))))