
(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)))
(cos (+ (* 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))) * cos(((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))) * cos(((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.cos(((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.cos(((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))) * cos(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))) * cos(((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[Cos[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 \cos \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 17 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)))
(cos (+ (* 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))) * cos(((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))) * cos(((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.cos(((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.cos(((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))) * cos(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))) * cos(((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[Cos[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 \cos \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
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(t_1 (log (hypot x.im x.re)))
(t_2 (* (atan2 x.im x.re) y.re))
(t_3 (cos (fma (- (atan2 x.im x.re)) y.re (* t_1 y.im))))
(t_4 (log (hypot x.re x.im)))
(t_5 (* t_4 y.im)))
(if (<= y.re -41000.0)
(* (fma (- y.re) (* (sin t_5) (atan2 x.im x.re)) (cos t_5)) t_0)
(if (<= y.re 116000000.0)
(/
(* (* (cos (fma y.im t_1 t_2)) t_3) (pow (hypot x.im x.re) y.re))
(* (pow (exp y.im) (atan2 x.im x.re)) t_3))
(* (fma (- y.im) (* (sin t_2) t_4) (cos t_2)) 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 t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = atan2(x_46_im, x_46_re) * y_46_re;
double t_3 = cos(fma(-atan2(x_46_im, x_46_re), y_46_re, (t_1 * y_46_im)));
double t_4 = log(hypot(x_46_re, x_46_im));
double t_5 = t_4 * y_46_im;
double tmp;
if (y_46_re <= -41000.0) {
tmp = fma(-y_46_re, (sin(t_5) * atan2(x_46_im, x_46_re)), cos(t_5)) * t_0;
} else if (y_46_re <= 116000000.0) {
tmp = ((cos(fma(y_46_im, t_1, t_2)) * t_3) * pow(hypot(x_46_im, x_46_re), y_46_re)) / (pow(exp(y_46_im), atan2(x_46_im, x_46_re)) * t_3);
} else {
tmp = fma(-y_46_im, (sin(t_2) * t_4), cos(t_2)) * 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)))) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_3 = cos(fma(Float64(-atan(x_46_im, x_46_re)), y_46_re, Float64(t_1 * y_46_im))) t_4 = log(hypot(x_46_re, x_46_im)) t_5 = Float64(t_4 * y_46_im) tmp = 0.0 if (y_46_re <= -41000.0) tmp = Float64(fma(Float64(-y_46_re), Float64(sin(t_5) * atan(x_46_im, x_46_re)), cos(t_5)) * t_0); elseif (y_46_re <= 116000000.0) tmp = Float64(Float64(Float64(cos(fma(y_46_im, t_1, t_2)) * t_3) * (hypot(x_46_im, x_46_re) ^ y_46_re)) / Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) * t_3)); else tmp = Float64(fma(Float64(-y_46_im), Float64(sin(t_2) * t_4), cos(t_2)) * t_0); 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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$re + N[(t$95$1 * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, -41000.0], N[(N[((-y$46$re) * N[(N[Sin[t$95$5], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[Cos[t$95$5], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 116000000.0], N[(N[(N[(N[Cos[N[(y$46$im * t$95$1 + t$95$2), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[((-y$46$im) * N[(N[Sin[t$95$2], $MachinePrecision] * t$95$4), $MachinePrecision] + N[Cos[t$95$2], $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}}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_3 := \cos \left(\mathsf{fma}\left(-\tan^{-1}_* \frac{x.im}{x.re}, y.re, t\_1 \cdot y.im\right)\right)\\
t_4 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_5 := t\_4 \cdot y.im\\
\mathbf{if}\;y.re \leq -41000:\\
\;\;\;\;\mathsf{fma}\left(-y.re, \sin t\_5 \cdot \tan^{-1}_* \frac{x.im}{x.re}, \cos t\_5\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 116000000:\\
\;\;\;\;\frac{\left(\cos \left(\mathsf{fma}\left(y.im, t\_1, t\_2\right)\right) \cdot t\_3\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_3}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y.im, \sin t\_2 \cdot t\_4, \cos t\_2\right) \cdot t\_0\\
\end{array}
\end{array}
if y.re < -41000Initial program 47.6%
Taylor expanded in y.re around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.4%
if -41000 < y.re < 1.16e8Initial program 49.2%
Applied rewrites82.4%
if 1.16e8 < y.re Initial program 38.6%
Taylor expanded in y.im around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites75.5%
Final simplification82.1%
(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)))
(t_3 (* t_2 y.im))
(t_4 (cos t_3)))
(if (<= y.re -0.00175)
(* (fma (- y.re) (* (sin t_3) (atan2 x.im x.re)) t_4) t_0)
(if (<= y.re 0.0003)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_4)
(* (fma (- y.im) (* (sin t_1) t_2) (cos t_1)) 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 t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log(hypot(x_46_re, x_46_im));
double t_3 = t_2 * y_46_im;
double t_4 = cos(t_3);
double tmp;
if (y_46_re <= -0.00175) {
tmp = fma(-y_46_re, (sin(t_3) * atan2(x_46_im, x_46_re)), t_4) * t_0;
} else if (y_46_re <= 0.0003) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_4;
} else {
tmp = fma(-y_46_im, (sin(t_1) * t_2), cos(t_1)) * 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)))) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = log(hypot(x_46_re, x_46_im)) t_3 = Float64(t_2 * y_46_im) t_4 = cos(t_3) tmp = 0.0 if (y_46_re <= -0.00175) tmp = Float64(fma(Float64(-y_46_re), Float64(sin(t_3) * atan(x_46_im, x_46_re)), t_4) * t_0); elseif (y_46_re <= 0.0003) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * t_4); else tmp = Float64(fma(Float64(-y_46_im), Float64(sin(t_1) * t_2), cos(t_1)) * t_0); 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]}, Block[{t$95$3 = N[(t$95$2 * y$46$im), $MachinePrecision]}, Block[{t$95$4 = N[Cos[t$95$3], $MachinePrecision]}, If[LessEqual[y$46$re, -0.00175], N[(N[((-y$46$re) * N[(N[Sin[t$95$3], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 0.0003], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$4), $MachinePrecision], N[(N[((-y$46$im) * N[(N[Sin[t$95$1], $MachinePrecision] * t$95$2), $MachinePrecision] + N[Cos[t$95$1], $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}}\\
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)\\
t_3 := t\_2 \cdot y.im\\
t_4 := \cos t\_3\\
\mathbf{if}\;y.re \leq -0.00175:\\
\;\;\;\;\mathsf{fma}\left(-y.re, \sin t\_3 \cdot \tan^{-1}_* \frac{x.im}{x.re}, t\_4\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 0.0003:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_4\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y.im, \sin t\_1 \cdot t\_2, \cos t\_1\right) \cdot t\_0\\
\end{array}
\end{array}
if y.re < -0.00175000000000000004Initial program 46.9%
Taylor expanded in y.re around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites86.8%
if -0.00175000000000000004 < y.re < 2.99999999999999974e-4Initial program 49.6%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.8%
Taylor expanded in x.re around -inf
*-commutativeN/A
*-commutativeN/A
neg-mul-1N/A
prod-expN/A
sub-negN/A
lower-*.f64N/A
Applied rewrites42.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6482.3
Applied rewrites82.3%
if 2.99999999999999974e-4 < y.re Initial program 38.6%
Taylor expanded in y.im around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites75.5%
Final simplification81.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (cos t_1))
(t_3
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re))))))
(if (<= y.re -1.25e-8)
(* t_2 t_3)
(if (<= y.re 0.0003)
(* (exp (* (- y.im) (atan2 x.im x.re))) (cos (* t_0 y.im)))
(* (fma (- y.im) (* (sin t_1) t_0) t_2) t_3)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = cos(t_1);
double t_3 = 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.25e-8) {
tmp = t_2 * t_3;
} else if (y_46_re <= 0.0003) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((t_0 * y_46_im));
} else {
tmp = fma(-y_46_im, (sin(t_1) * t_0), t_2) * t_3;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = cos(t_1) t_3 = 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.25e-8) tmp = Float64(t_2 * t_3); elseif (y_46_re <= 0.0003) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * cos(Float64(t_0 * y_46_im))); else tmp = Float64(fma(Float64(-y_46_im), Float64(sin(t_1) * t_0), t_2) * t_3); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, Block[{t$95$3 = 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, -1.25e-8], N[(t$95$2 * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 0.0003], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[((-y$46$im) * N[(N[Sin[t$95$1], $MachinePrecision] * t$95$0), $MachinePrecision] + t$95$2), $MachinePrecision] * t$95$3), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \cos t\_1\\
t_3 := 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.25 \cdot 10^{-8}:\\
\;\;\;\;t\_2 \cdot t\_3\\
\mathbf{elif}\;y.re \leq 0.0003:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(t\_0 \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y.im, \sin t\_1 \cdot t\_0, t\_2\right) \cdot t\_3\\
\end{array}
\end{array}
if y.re < -1.2499999999999999e-8Initial program 46.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6484.9
Applied rewrites84.9%
if -1.2499999999999999e-8 < y.re < 2.99999999999999974e-4Initial program 49.6%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.8%
Taylor expanded in x.re around -inf
*-commutativeN/A
*-commutativeN/A
neg-mul-1N/A
prod-expN/A
sub-negN/A
lower-*.f64N/A
Applied rewrites42.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6482.3
Applied rewrites82.3%
if 2.99999999999999974e-4 < y.re Initial program 38.6%
Taylor expanded in y.im around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites75.5%
Final simplification81.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 (cos (* (log (hypot x.re x.im)) y.im))))
(if (<= y.re -1.25e-8)
(* (cos (* (atan2 x.im x.re) y.re)) t_0)
(if (<= y.re 0.0095)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_1)
(* t_1 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 t_1 = cos((log(hypot(x_46_re, x_46_im)) * y_46_im));
double tmp;
if (y_46_re <= -1.25e-8) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_0;
} else if (y_46_re <= 0.0095) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_1;
} else {
tmp = t_1 * 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 t_1 = Math.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
double tmp;
if (y_46_re <= -1.25e-8) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * t_0;
} else if (y_46_re <= 0.0095) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * t_1;
} else {
tmp = t_1 * 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)))) t_1 = math.cos((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) tmp = 0 if y_46_re <= -1.25e-8: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_0 elif y_46_re <= 0.0095: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * t_1 else: tmp = t_1 * 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)))) t_1 = cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) tmp = 0.0 if (y_46_re <= -1.25e-8) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * t_0); elseif (y_46_re <= 0.0095) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * t_1); else tmp = Float64(t_1 * 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)))); t_1 = cos((log(hypot(x_46_re, x_46_im)) * y_46_im)); tmp = 0.0; if (y_46_re <= -1.25e-8) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_0; elseif (y_46_re <= 0.0095) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_1; else tmp = t_1 * 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]}, Block[{t$95$1 = N[Cos[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.25e-8], N[(N[Cos[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.0095], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * 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}}\\
t_1 := \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{-8}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 0.0095:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.2499999999999999e-8Initial program 46.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6484.9
Applied rewrites84.9%
if -1.2499999999999999e-8 < y.re < 0.00949999999999999976Initial program 49.6%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.8%
Taylor expanded in x.re around -inf
*-commutativeN/A
*-commutativeN/A
neg-mul-1N/A
prod-expN/A
sub-negN/A
lower-*.f64N/A
Applied rewrites42.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6482.3
Applied rewrites82.3%
if 0.00949999999999999976 < y.re Initial program 38.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.f6473.8
Applied rewrites73.8%
Final simplification81.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.25e-8)
(*
(cos (* (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 9.5e-15)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(cos (* (log (hypot x.re x.im)) y.im)))
(* 1.0 (pow (hypot x.re x.im) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.25e-8) {
tmp = cos((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 <= 9.5e-15) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = 1.0 * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.25e-8) {
tmp = Math.cos((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 <= 9.5e-15) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = 1.0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -1.25e-8: tmp = math.cos((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 <= 9.5e-15: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.cos((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) else: tmp = 1.0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -1.25e-8) tmp = Float64(cos(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 <= 9.5e-15) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = Float64(1.0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -1.25e-8) tmp = cos((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 <= 9.5e-15) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = 1.0 * (hypot(x_46_re, x_46_im) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.25e-8], N[(N[Cos[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, 9.5e-15], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.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}
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{-8}:\\
\;\;\;\;\cos \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 9.5 \cdot 10^{-15}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.2499999999999999e-8Initial program 46.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6484.9
Applied rewrites84.9%
if -1.2499999999999999e-8 < y.re < 9.5000000000000005e-15Initial program 49.9%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.6%
Taylor expanded in x.re around -inf
*-commutativeN/A
*-commutativeN/A
neg-mul-1N/A
prod-expN/A
sub-negN/A
lower-*.f64N/A
Applied rewrites41.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6482.3
Applied rewrites82.3%
if 9.5000000000000005e-15 < y.re Initial program 37.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.3
Applied rewrites62.3%
Taylor expanded in y.re around 0
Applied rewrites70.9%
Final simplification80.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -0.00037)
(* t_0 (cos (* (atan2 x.im x.re) y.re)))
(if (<= y.re 9.5e-15)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(cos (* (log (hypot x.re x.im)) y.im)))
(* 1.0 t_0)))))
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 tmp;
if (y_46_re <= -0.00037) {
tmp = t_0 * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 9.5e-15) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = 1.0 * 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.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -0.00037) {
tmp = t_0 * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 9.5e-15) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = 1.0 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -0.00037: tmp = t_0 * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) elif y_46_re <= 9.5e-15: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.cos((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) else: tmp = 1.0 * t_0 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 tmp = 0.0 if (y_46_re <= -0.00037) tmp = Float64(t_0 * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 9.5e-15) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = Float64(1.0 * t_0); end return tmp end
function tmp_2 = 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; tmp = 0.0; if (y_46_re <= -0.00037) tmp = t_0 * cos((atan2(x_46_im, x_46_re) * y_46_re)); elseif (y_46_re <= 9.5e-15) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = 1.0 * 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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -0.00037], N[(t$95$0 * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9.5e-15], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -0.00037:\\
\;\;\;\;t\_0 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-15}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -3.6999999999999999e-4Initial program 46.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6482.0
Applied rewrites82.0%
if -3.6999999999999999e-4 < y.re < 9.5000000000000005e-15Initial program 49.9%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.6%
Taylor expanded in x.re around -inf
*-commutativeN/A
*-commutativeN/A
neg-mul-1N/A
prod-expN/A
sub-negN/A
lower-*.f64N/A
Applied rewrites41.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6482.3
Applied rewrites82.3%
if 9.5000000000000005e-15 < y.re Initial program 37.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.3
Applied rewrites62.3%
Taylor expanded in y.re around 0
Applied rewrites70.9%
Final simplification79.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 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.re -1.05e-8)
(* t_0 t_1)
(if (<= y.re 9.5e-15)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_1)
(* 1.0 t_0)))))
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 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1.05e-8) {
tmp = t_0 * t_1;
} else if (y_46_re <= 9.5e-15) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_1;
} else {
tmp = 1.0 * 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.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_1 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1.05e-8) {
tmp = t_0 * t_1;
} else if (y_46_re <= 9.5e-15) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * t_1;
} else {
tmp = 1.0 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_1 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -1.05e-8: tmp = t_0 * t_1 elif y_46_re <= 9.5e-15: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * t_1 else: tmp = 1.0 * t_0 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 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -1.05e-8) tmp = Float64(t_0 * t_1); elseif (y_46_re <= 9.5e-15) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * t_1); else tmp = Float64(1.0 * t_0); end return tmp end
function tmp_2 = 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 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -1.05e-8) tmp = t_0 * t_1; elseif (y_46_re <= 9.5e-15) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_1; else tmp = 1.0 * 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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.05e-8], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 9.5e-15], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(1.0 * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -1.05 \cdot 10^{-8}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-15}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.04999999999999997e-8Initial program 46.2%
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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6480.8
Applied rewrites80.8%
if -1.04999999999999997e-8 < y.re < 9.5000000000000005e-15Initial program 50.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6453.9
Applied rewrites53.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.f6480.7
Applied rewrites80.7%
if 9.5000000000000005e-15 < y.re Initial program 37.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.3
Applied rewrites62.3%
Taylor expanded in y.re around 0
Applied rewrites70.9%
Final simplification78.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -4.6e+18)
(*
(pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
(cos (* (atan2 x.im x.re) y.re)))
(* 1.0 (pow (hypot x.re x.im) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -4.6e+18) {
tmp = pow((fma((0.5 / x_46_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -4.6e+18) tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), Float64(Float64(x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re) ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(1.0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -4.6e+18], N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.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}
\mathbf{if}\;y.im \leq -4.6 \cdot 10^{+18}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -4.6e18Initial program 42.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6431.5
Applied rewrites31.5%
Taylor expanded in x.re around inf
Applied rewrites36.7%
if -4.6e18 < y.im Initial program 47.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6470.0
Applied rewrites70.0%
Taylor expanded in y.re around 0
Applied rewrites72.8%
Final simplification63.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -4.6e+18)
(*
(pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re)
(cos (* (atan2 x.im x.re) y.re)))
(* 1.0 (pow (hypot x.re x.im) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -4.6e+18) {
tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -4.6e+18) tmp = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(1.0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -4.6e+18], N[(N[Power[N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5 + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.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}
\mathbf{if}\;y.im \leq -4.6 \cdot 10^{+18}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -4.6e18Initial program 42.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6431.5
Applied rewrites31.5%
Taylor expanded in x.im around 0
Applied rewrites35.3%
if -4.6e18 < y.im Initial program 47.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6470.0
Applied rewrites70.0%
Taylor expanded in y.re around 0
Applied rewrites72.8%
Final simplification62.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) 1.0)))
(if (<= y.re -0.096)
t_0
(if (<= y.re 0.0009) (fma (log (hypot x.re x.im)) y.re 1.0) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * 1.0;
double tmp;
if (y_46_re <= -0.096) {
tmp = t_0;
} else if (y_46_re <= 0.0009) {
tmp = fma(log(hypot(x_46_re, x_46_im)), y_46_re, 1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -0.096) tmp = t_0; elseif (y_46_re <= 0.0009) tmp = fma(log(hypot(x_46_re, x_46_im)), y_46_re, 1.0); 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[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -0.096], t$95$0, If[LessEqual[y$46$re, 0.0009], N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + 1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -0.096:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.0009:\\
\;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.096000000000000002 or 8.9999999999999998e-4 < y.re Initial program 42.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6472.3
Applied rewrites72.3%
Taylor expanded in x.im around inf
Applied rewrites64.2%
Taylor expanded in y.re around 0
Applied rewrites67.5%
Taylor expanded in x.im around 0
Applied rewrites69.2%
if -0.096000000000000002 < y.re < 8.9999999999999998e-4Initial program 49.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.4
Applied rewrites48.4%
Taylor expanded in y.re around 0
Applied rewrites47.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -1.12e+20) (* (pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re) 1.0) (* 1.0 (pow (hypot x.re x.im) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -1.12e+20) {
tmp = pow((fma((0.5 / x_46_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * 1.0;
} else {
tmp = 1.0 * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -1.12e+20) tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), Float64(Float64(x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re) ^ y_46_re) * 1.0); else tmp = Float64(1.0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -1.12e+20], N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(1.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}
\mathbf{if}\;y.im \leq -1.12 \cdot 10^{+20}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -1.12e20Initial program 42.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6431.5
Applied rewrites31.5%
Taylor expanded in x.im around inf
Applied rewrites30.4%
Taylor expanded in y.re around 0
Applied rewrites26.0%
Taylor expanded in x.re around inf
Applied rewrites32.3%
if -1.12e20 < y.im Initial program 47.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6470.0
Applied rewrites70.0%
Taylor expanded in y.re around 0
Applied rewrites72.8%
Final simplification62.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) 1.0))) (if (<= y.re -0.096) t_0 (if (<= y.re 1.08e-32) 1.0 t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * 1.0;
double tmp;
if (y_46_re <= -0.096) {
tmp = t_0;
} else if (y_46_re <= 1.08e-32) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -0.096) tmp = t_0; elseif (y_46_re <= 1.08e-32) tmp = 1.0; 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[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -0.096], t$95$0, If[LessEqual[y$46$re, 1.08e-32], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -0.096:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.08 \cdot 10^{-32}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.096000000000000002 or 1.08e-32 < y.re Initial program 42.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6471.7
Applied rewrites71.7%
Taylor expanded in x.im around inf
Applied rewrites63.0%
Taylor expanded in y.re around 0
Applied rewrites66.2%
Taylor expanded in x.im around 0
Applied rewrites68.6%
if -0.096000000000000002 < y.re < 1.08e-32Initial program 50.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.3
Applied rewrites48.3%
Taylor expanded in y.re around 0
Applied rewrites47.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -1.14e-74) (* (pow (- x.re) y.re) 1.0) (if (<= x.re 9.2e-72) (* (pow (- x.im) y.re) 1.0) (* (pow x.re y.re) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -1.14e-74) {
tmp = pow(-x_46_re, y_46_re) * 1.0;
} else if (x_46_re <= 9.2e-72) {
tmp = pow(-x_46_im, y_46_re) * 1.0;
} else {
tmp = pow(x_46_re, y_46_re) * 1.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) :: tmp
if (x_46re <= (-1.14d-74)) then
tmp = (-x_46re ** y_46re) * 1.0d0
else if (x_46re <= 9.2d-72) then
tmp = (-x_46im ** y_46re) * 1.0d0
else
tmp = (x_46re ** y_46re) * 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -1.14e-74) {
tmp = Math.pow(-x_46_re, y_46_re) * 1.0;
} else if (x_46_re <= 9.2e-72) {
tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
} else {
tmp = Math.pow(x_46_re, y_46_re) * 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -1.14e-74: tmp = math.pow(-x_46_re, y_46_re) * 1.0 elif x_46_re <= 9.2e-72: tmp = math.pow(-x_46_im, y_46_re) * 1.0 else: tmp = math.pow(x_46_re, y_46_re) * 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -1.14e-74) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * 1.0); elseif (x_46_re <= 9.2e-72) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0); else tmp = Float64((x_46_re ^ y_46_re) * 1.0); 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 <= -1.14e-74) tmp = (-x_46_re ^ y_46_re) * 1.0; elseif (x_46_re <= 9.2e-72) tmp = (-x_46_im ^ y_46_re) * 1.0; else tmp = (x_46_re ^ y_46_re) * 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -1.14e-74], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$re, 9.2e-72], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -1.14 \cdot 10^{-74}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.re \leq 9.2 \cdot 10^{-72}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.re < -1.13999999999999993e-74Initial program 35.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6451.8
Applied rewrites51.8%
Taylor expanded in x.im around inf
Applied rewrites32.5%
Taylor expanded in y.re around 0
Applied rewrites38.2%
Taylor expanded in x.re around -inf
Applied rewrites56.1%
if -1.13999999999999993e-74 < x.re < 9.19999999999999978e-72Initial program 57.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.7
Applied rewrites61.7%
Taylor expanded in x.im around inf
Applied rewrites41.8%
Taylor expanded in y.re around 0
Applied rewrites43.8%
Taylor expanded in x.im around -inf
Applied rewrites55.7%
if 9.19999999999999978e-72 < x.re Initial program 41.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.2
Applied rewrites64.2%
Taylor expanded in x.im around inf
Applied rewrites41.8%
Taylor expanded in y.re around 0
Applied rewrites39.4%
Taylor expanded in x.im around 0
Applied rewrites60.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -1.85) (* (pow x.im y.re) 1.0) (if (<= y.re 1.8e-7) 1.0 (* (pow x.re y.re) 1.0))))
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.85) {
tmp = pow(x_46_im, y_46_re) * 1.0;
} else if (y_46_re <= 1.8e-7) {
tmp = 1.0;
} else {
tmp = pow(x_46_re, y_46_re) * 1.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) :: tmp
if (y_46re <= (-1.85d0)) then
tmp = (x_46im ** y_46re) * 1.0d0
else if (y_46re <= 1.8d-7) then
tmp = 1.0d0
else
tmp = (x_46re ** y_46re) * 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.85) {
tmp = Math.pow(x_46_im, y_46_re) * 1.0;
} else if (y_46_re <= 1.8e-7) {
tmp = 1.0;
} else {
tmp = Math.pow(x_46_re, y_46_re) * 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -1.85: tmp = math.pow(x_46_im, y_46_re) * 1.0 elif y_46_re <= 1.8e-7: tmp = 1.0 else: tmp = math.pow(x_46_re, y_46_re) * 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -1.85) tmp = Float64((x_46_im ^ y_46_re) * 1.0); elseif (y_46_re <= 1.8e-7) tmp = 1.0; else tmp = Float64((x_46_re ^ y_46_re) * 1.0); 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.85) tmp = (x_46_im ^ y_46_re) * 1.0; elseif (y_46_re <= 1.8e-7) tmp = 1.0; else tmp = (x_46_re ^ y_46_re) * 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.85], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 1.8e-7], 1.0, N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.85:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -1.8500000000000001Initial program 46.2%
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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6481.7
Applied rewrites81.7%
Taylor expanded in x.im around inf
Applied rewrites72.6%
Taylor expanded in y.re around 0
Applied rewrites71.1%
Taylor expanded in x.re around 0
Applied rewrites60.4%
if -1.8500000000000001 < y.re < 1.79999999999999997e-7Initial program 49.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.4
Applied rewrites48.4%
Taylor expanded in y.re around 0
Applied rewrites47.6%
if 1.79999999999999997e-7 < y.re Initial program 38.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.6
Applied rewrites61.6%
Taylor expanded in x.im around inf
Applied rewrites54.7%
Taylor expanded in y.re around 0
Applied rewrites63.5%
Taylor expanded in x.im around 0
Applied rewrites61.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow x.im y.re) 1.0))) (if (<= y.re -1.85) t_0 (if (<= y.re 2.8) 1.0 t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(x_46_im, y_46_re) * 1.0;
double tmp;
if (y_46_re <= -1.85) {
tmp = t_0;
} else if (y_46_re <= 2.8) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = (x_46im ** y_46re) * 1.0d0
if (y_46re <= (-1.85d0)) then
tmp = t_0
else if (y_46re <= 2.8d0) then
tmp = 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(x_46_im, y_46_re) * 1.0;
double tmp;
if (y_46_re <= -1.85) {
tmp = t_0;
} else if (y_46_re <= 2.8) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(x_46_im, y_46_re) * 1.0 tmp = 0 if y_46_re <= -1.85: tmp = t_0 elif y_46_re <= 2.8: tmp = 1.0 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((x_46_im ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -1.85) tmp = t_0; elseif (y_46_re <= 2.8) tmp = 1.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_im ^ y_46_re) * 1.0; tmp = 0.0; if (y_46_re <= -1.85) tmp = t_0; elseif (y_46_re <= 2.8) tmp = 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -1.85], t$95$0, If[LessEqual[y$46$re, 2.8], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x.im}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -1.85:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.8:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.8500000000000001 or 2.7999999999999998 < y.re Initial program 42.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6472.3
Applied rewrites72.3%
Taylor expanded in x.im around inf
Applied rewrites64.2%
Taylor expanded in y.re around 0
Applied rewrites67.5%
Taylor expanded in x.re around 0
Applied rewrites60.2%
if -1.8500000000000001 < y.re < 2.7999999999999998Initial program 49.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.4
Applied rewrites48.4%
Taylor expanded in y.re around 0
Applied rewrites47.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -8e-307) (* (pow (- x.im) y.re) 1.0) (* (pow x.im y.re) 1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -8e-307) {
tmp = pow(-x_46_im, y_46_re) * 1.0;
} else {
tmp = pow(x_46_im, y_46_re) * 1.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) :: tmp
if (x_46im <= (-8d-307)) then
tmp = (-x_46im ** y_46re) * 1.0d0
else
tmp = (x_46im ** y_46re) * 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -8e-307) {
tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -8e-307: tmp = math.pow(-x_46_im, y_46_re) * 1.0 else: tmp = math.pow(x_46_im, y_46_re) * 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -8e-307) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0); else tmp = Float64((x_46_im ^ y_46_re) * 1.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_im <= -8e-307) tmp = (-x_46_im ^ y_46_re) * 1.0; else tmp = (x_46_im ^ y_46_re) * 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -8e-307], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -8 \cdot 10^{-307}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.im < -7.99999999999999927e-307Initial program 47.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.6
Applied rewrites62.6%
Taylor expanded in x.im around inf
Applied rewrites30.3%
Taylor expanded in y.re around 0
Applied rewrites33.2%
Taylor expanded in x.im around -inf
Applied rewrites57.7%
if -7.99999999999999927e-307 < x.im Initial program 44.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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6456.6
Applied rewrites56.6%
Taylor expanded in x.im around inf
Applied rewrites49.8%
Taylor expanded in y.re around 0
Applied rewrites49.8%
Taylor expanded in x.re around 0
Applied rewrites49.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
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
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 46.4%
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-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.8
Applied rewrites59.8%
Taylor expanded in y.re around 0
Applied rewrites26.2%
herbie shell --seed 2024278
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))