
(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 21 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 (* (atan2 x.im x.re) y.re))
(t_1 (cos t_0))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_3 (cos (* (log (hypot x.im x.re)) y.im))))
(if (<= y.re -3.4e-16)
(* t_2 t_1)
(if (<= y.re 5e-216)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_3)
(if (<= y.re 370000000.0)
(/
(*
(pow (hypot x.im x.re) y.re)
(fma (- y.im) (* (sin t_0) (log (hypot x.re x.im))) t_1))
(pow (exp y.im) (atan2 x.im x.re)))
(* 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 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = cos(t_0);
double t_2 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_re <= -3.4e-16) {
tmp = t_2 * t_1;
} else if (y_46_re <= 5e-216) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_3;
} else if (y_46_re <= 370000000.0) {
tmp = (pow(hypot(x_46_im, x_46_re), y_46_re) * fma(-y_46_im, (sin(t_0) * log(hypot(x_46_re, x_46_im))), t_1)) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = t_2 * t_3;
}
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 = cos(t_0) t_2 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0.0 if (y_46_re <= -3.4e-16) tmp = Float64(t_2 * t_1); elseif (y_46_re <= 5e-216) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * t_3); elseif (y_46_re <= 370000000.0) tmp = Float64(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * fma(Float64(-y_46_im), Float64(sin(t_0) * log(hypot(x_46_re, x_46_im))), t_1)) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = Float64(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.4e-16], N[(t$95$2 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 5e-216], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 370000000.0], N[(N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[((-y$46$im) * N[(N[Sin[t$95$0], $MachinePrecision] * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * t$95$3), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \cos t\_0\\
t_2 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -3.4 \cdot 10^{-16}:\\
\;\;\;\;t\_2 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{-216}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_3\\
\mathbf{elif}\;y.re \leq 370000000:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \mathsf{fma}\left(-y.im, \sin t\_0 \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), t\_1\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot t\_3\\
\end{array}
\end{array}
if y.re < -3.4e-16Initial program 40.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6484.3
Applied rewrites84.3%
if -3.4e-16 < y.re < 5.00000000000000021e-216Initial program 32.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6482.6
Applied rewrites82.6%
if 5.00000000000000021e-216 < y.re < 3.7e8Initial program 36.7%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in y.im around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites88.7%
if 3.7e8 < y.re Initial program 42.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.5
Applied rewrites75.5%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -3.5e-16)
(* t_1 (cos (* (atan2 x.im x.re) y.re)))
(if (<= y.re 370000000.0)
(/
(*
(pow (hypot x.im x.re) y.re)
(cos (fma y.im t_0 (* y.re (atan2 x.im x.re)))))
(pow (sqrt (exp y.im)) (* (atan2 x.im x.re) 2.0)))
(* t_1 (cos (* t_0 y.im)))))))
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_im, x_46_re));
double t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -3.5e-16) {
tmp = t_1 * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 370000000.0) {
tmp = (pow(hypot(x_46_im, x_46_re), y_46_re) * cos(fma(y_46_im, t_0, (y_46_re * atan2(x_46_im, x_46_re))))) / pow(sqrt(exp(y_46_im)), (atan2(x_46_im, x_46_re) * 2.0));
} else {
tmp = t_1 * cos((t_0 * y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -3.5e-16) tmp = Float64(t_1 * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 370000000.0) tmp = Float64(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(fma(y_46_im, t_0, Float64(y_46_re * atan(x_46_im, x_46_re))))) / (sqrt(exp(y_46_im)) ^ Float64(atan(x_46_im, x_46_re) * 2.0))); else tmp = Float64(t_1 * cos(Float64(t_0 * y_46_im))); 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.5e-16], N[(t$95$1 * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 370000000.0], N[(N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(y$46$im * t$95$0 + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Power[N[Sqrt[N[Exp[y$46$im], $MachinePrecision]], $MachinePrecision], N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Cos[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -3.5 \cdot 10^{-16}:\\
\;\;\;\;t\_1 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 370000000:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\mathsf{fma}\left(y.im, t\_0, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}{{\left(\sqrt{e^{y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot 2\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \cos \left(t\_0 \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -3.50000000000000017e-16Initial program 40.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6484.3
Applied rewrites84.3%
if -3.50000000000000017e-16 < y.re < 3.7e8Initial program 34.1%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites81.4%
lift-pow.f64N/A
sqr-powN/A
pow2N/A
lower-pow.f64N/A
lower-pow.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6481.4
Applied rewrites81.4%
lift-pow.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
*-commutativeN/A
pow-unpowN/A
pow-powN/A
lower-pow.f64N/A
unpow1/2N/A
lower-sqrt.f64N/A
lower-*.f6481.4
Applied rewrites81.4%
if 3.7e8 < y.re Initial program 42.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.5
Applied rewrites75.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -3.5e-16)
(* t_1 (cos (* (atan2 x.im x.re) y.re)))
(if (<= y.re 370000000.0)
(/
(*
(pow (hypot x.im x.re) y.re)
(cos (fma y.im t_0 (* y.re (atan2 x.im x.re)))))
(pow (exp y.im) (atan2 x.im x.re)))
(* t_1 (cos (* t_0 y.im)))))))
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_im, x_46_re));
double t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -3.5e-16) {
tmp = t_1 * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 370000000.0) {
tmp = (pow(hypot(x_46_im, x_46_re), y_46_re) * cos(fma(y_46_im, t_0, (y_46_re * atan2(x_46_im, x_46_re))))) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = t_1 * cos((t_0 * y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -3.5e-16) tmp = Float64(t_1 * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 370000000.0) tmp = Float64(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(fma(y_46_im, t_0, Float64(y_46_re * atan(x_46_im, x_46_re))))) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = Float64(t_1 * cos(Float64(t_0 * y_46_im))); 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.5e-16], N[(t$95$1 * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 370000000.0], N[(N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(y$46$im * t$95$0 + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Cos[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -3.5 \cdot 10^{-16}:\\
\;\;\;\;t\_1 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 370000000:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\mathsf{fma}\left(y.im, t\_0, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \cos \left(t\_0 \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -3.50000000000000017e-16Initial program 40.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6484.3
Applied rewrites84.3%
if -3.50000000000000017e-16 < y.re < 3.7e8Initial program 34.1%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites81.4%
if 3.7e8 < y.re Initial program 42.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.5
Applied rewrites75.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_1 (cos (* (log (hypot x.im x.re)) y.im))))
(if (<= y.re -3.4e-16)
(* t_0 (cos (* (atan2 x.im x.re) y.re)))
(if (<= y.re 1.9e-6)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_1)
(* t_0 t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_re <= -3.4e-16) {
tmp = t_0 * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 1.9e-6) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_1;
} else {
tmp = t_0 * t_1;
}
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_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_re <= -3.4e-16) {
tmp = t_0 * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 1.9e-6) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * t_1;
} else {
tmp = t_0 * t_1;
}
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_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) t_1 = math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0 if y_46_re <= -3.4e-16: tmp = t_0 * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) elif y_46_re <= 1.9e-6: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * t_1 else: tmp = t_0 * 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_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_1 = cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0.0 if (y_46_re <= -3.4e-16) tmp = Float64(t_0 * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 1.9e-6) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * t_1); else tmp = Float64(t_0 * t_1); 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_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); t_1 = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)); tmp = 0.0; if (y_46_re <= -3.4e-16) tmp = t_0 * cos((atan2(x_46_im, x_46_re) * y_46_re)); elseif (y_46_re <= 1.9e-6) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_1; else tmp = t_0 * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.4e-16], 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, 1.9e-6], 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$0 * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -3.4 \cdot 10^{-16}:\\
\;\;\;\;t\_0 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{-6}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\end{array}
\end{array}
if y.re < -3.4e-16Initial program 40.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6484.3
Applied rewrites84.3%
if -3.4e-16 < y.re < 1.9e-6Initial program 34.1%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6482.2
Applied rewrites82.2%
if 1.9e-6 < y.re Initial program 42.2%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6473.5
Applied rewrites73.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (<= y.re -3.4e-16)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* (atan2 x.im x.re) y.re)))
(if (<= y.re 1.22e-14)
(* (exp (* (- y.im) (atan2 x.im x.re))) (cos (* t_0 y.im)))
(* (exp (* t_0 y.re)) (cos (* (log (hypot x.re x.im)) y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -3.4e-16) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 1.22e-14) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((t_0 * y_46_im));
} else {
tmp = exp((t_0 * y_46_re)) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -3.4e-16) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 1.22e-14) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.cos((t_0 * y_46_im));
} else {
tmp = Math.exp((t_0 * y_46_re)) * Math.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_im, x_46_re)) tmp = 0 if y_46_re <= -3.4e-16: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) elif y_46_re <= 1.22e-14: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.cos((t_0 * y_46_im)) else: tmp = math.exp((t_0 * y_46_re)) * math.cos((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -3.4e-16) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 1.22e-14) 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(exp(Float64(t_0 * y_46_re)) * cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)); tmp = 0.0; if (y_46_re <= -3.4e-16) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((atan2(x_46_im, x_46_re) * y_46_re)); elseif (y_46_re <= 1.22e-14) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((t_0 * y_46_im)); else tmp = exp((t_0 * y_46_re)) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.4e-16], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.22e-14], 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[Exp[N[(t$95$0 * y$46$re), $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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -3.4 \cdot 10^{-16}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 1.22 \cdot 10^{-14}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(t\_0 \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;e^{t\_0 \cdot y.re} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -3.4e-16Initial program 40.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6484.3
Applied rewrites84.3%
if -3.4e-16 < y.re < 1.21999999999999994e-14Initial program 34.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6482.5
Applied rewrites82.5%
if 1.21999999999999994e-14 < y.re Initial program 40.9%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6436.4
Applied rewrites36.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6469.8
Applied rewrites69.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -3.4e-16) (not (<= y.re 2.9e-5)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* (atan2 x.im x.re) y.re)))
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(cos (* (log (hypot x.im x.re)) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.4e-16) || !(y_46_re <= 2.9e-5)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.4e-16) || !(y_46_re <= 2.9e-5)) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -3.4e-16) or not (y_46_re <= 2.9e-5): tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -3.4e-16) || !(y_46_re <= 2.9e-5)) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -3.4e-16) || ~((y_46_re <= 2.9e-5))) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(hypot(x_46_im, x_46_re)) * y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3.4e-16], N[Not[LessEqual[y$46$re, 2.9e-5]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.4 \cdot 10^{-16} \lor \neg \left(y.re \leq 2.9 \cdot 10^{-5}\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -3.4e-16 or 2.9e-5 < y.re Initial program 40.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6476.4
Applied rewrites76.4%
if -3.4e-16 < y.re < 2.9e-5Initial program 34.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6481.8
Applied rewrites81.8%
Final simplification79.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -3.9e-16) (not (<= y.re 5e+17)))
(* (pow (hypot x.im x.re) y.re) (cos (* (atan2 x.im x.re) y.re)))
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(cos (* (log (hypot x.im x.re)) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.9e-16) || !(y_46_re <= 5e+17)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.9e-16) || !(y_46_re <= 5e+17)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -3.9e-16) or not (y_46_re <= 5e+17): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -3.9e-16) || !(y_46_re <= 5e+17)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -3.9e-16) || ~((y_46_re <= 5e+17))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(hypot(x_46_im, x_46_re)) * y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3.9e-16], N[Not[LessEqual[y$46$re, 5e+17]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.9 \cdot 10^{-16} \lor \neg \left(y.re \leq 5 \cdot 10^{+17}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -3.89999999999999977e-16 or 5e17 < y.re Initial program 41.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6472.9
Applied rewrites72.9%
if -3.89999999999999977e-16 < y.re < 5e17Initial program 34.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6479.7
Applied rewrites79.7%
Final simplification76.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.re -3.9e-16)
(* (pow (hypot x.im x.re) y.re) t_0)
(if (<= y.re 5e+17)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(cos (* (log (hypot x.im x.re)) y.im)))
(* (pow (pow (hypot x.re x.im) 2.0) (* y.re 0.5)) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -3.9e-16) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
} else if (y_46_re <= 5e+17) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = pow(pow(hypot(x_46_re, x_46_im), 2.0), (y_46_re * 0.5)) * 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.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -3.9e-16) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * t_0;
} else if (y_46_re <= 5e+17) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = Math.pow(Math.pow(Math.hypot(x_46_re, x_46_im), 2.0), (y_46_re * 0.5)) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -3.9e-16: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * t_0 elif y_46_re <= 5e+17: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) else: tmp = math.pow(math.pow(math.hypot(x_46_re, x_46_im), 2.0), (y_46_re * 0.5)) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -3.9e-16) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= 5e+17) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(((hypot(x_46_re, x_46_im) ^ 2.0) ^ Float64(y_46_re * 0.5)) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -3.9e-16) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * t_0; elseif (y_46_re <= 5e+17) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = ((hypot(x_46_re, x_46_im) ^ 2.0) ^ (y_46_re * 0.5)) * 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[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.9e-16], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 5e+17], 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -3.9 \cdot 10^{-16}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{+17}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{2}\right)}^{\left(y.re \cdot 0.5\right)} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -3.89999999999999977e-16Initial program 40.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6476.8
Applied rewrites76.8%
if -3.89999999999999977e-16 < y.re < 5e17Initial program 34.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6479.7
Applied rewrites79.7%
if 5e17 < y.re Initial program 42.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6468.5
Applied rewrites68.5%
Applied rewrites68.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.im 1.9e+19)
(* (pow (hypot x.im x.re) y.re) t_0)
(*
(pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= 1.9e+19) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
} else {
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) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_im <= 1.9e+19) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_0); else 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) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, 1.9e+19], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], 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] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.im \leq 1.9 \cdot 10^{+19}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{\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 t\_0\\
\end{array}
\end{array}
if y.im < 1.9e19Initial program 39.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6471.5
Applied rewrites71.5%
if 1.9e19 < y.im Initial program 33.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6428.8
Applied rewrites28.8%
Taylor expanded in x.re around inf
Applied rewrites39.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.re -6.6e-8)
(* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) t_0)
(if (<= y.re 4.8e-34)
(* 1.0 t_0)
(if (<= y.re 4.2e+23)
(fma
y.re
(log
(sqrt
(/
(/ (- (pow x.im 4.0) (pow x.re 4.0)) (+ x.re x.im))
(- x.im x.re))))
1.0)
(* (pow (fma (/ (* x.re x.re) x.im) 0.5 x.im) y.re) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -6.6e-8) {
tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * t_0;
} else if (y_46_re <= 4.8e-34) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 4.2e+23) {
tmp = fma(y_46_re, log(sqrt((((pow(x_46_im, 4.0) - pow(x_46_re, 4.0)) / (x_46_re + x_46_im)) / (x_46_im - x_46_re)))), 1.0);
} else {
tmp = pow(fma(((x_46_re * x_46_re) / x_46_im), 0.5, x_46_im), y_46_re) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -6.6e-8) tmp = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= 4.8e-34) tmp = Float64(1.0 * t_0); elseif (y_46_re <= 4.2e+23) tmp = fma(y_46_re, log(sqrt(Float64(Float64(Float64((x_46_im ^ 4.0) - (x_46_re ^ 4.0)) / Float64(x_46_re + x_46_im)) / Float64(x_46_im - x_46_re)))), 1.0); else tmp = Float64((fma(Float64(Float64(x_46_re * x_46_re) / x_46_im), 0.5, x_46_im) ^ y_46_re) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -6.6e-8], 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] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 4.8e-34], N[(1.0 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 4.2e+23], N[(y$46$re * N[Log[N[Sqrt[N[(N[(N[(N[Power[x$46$im, 4.0], $MachinePrecision] - N[Power[x$46$re, 4.0], $MachinePrecision]), $MachinePrecision] / N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision] / N[(x$46$im - x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision], N[(N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5 + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -6.6 \cdot 10^{-8}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 4.8 \cdot 10^{-34}:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{elif}\;y.re \leq 4.2 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(y.re, \log \left(\sqrt{\frac{\frac{{x.im}^{4} - {x.re}^{4}}{x.re + x.im}}{x.im - x.re}}\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -6.59999999999999954e-8Initial program 41.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.0
Applied rewrites78.0%
Taylor expanded in x.im around 0
Applied rewrites76.5%
if -6.59999999999999954e-8 < y.re < 4.79999999999999982e-34Initial program 33.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6452.7
Applied rewrites52.7%
Taylor expanded in y.re around 0
Applied rewrites52.7%
if 4.79999999999999982e-34 < y.re < 4.2000000000000003e23Initial program 41.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6430.6
Applied rewrites30.6%
Applied rewrites23.7%
Taylor expanded in y.re around 0
Applied rewrites53.9%
if 4.2000000000000003e23 < y.re Initial program 41.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.2
Applied rewrites69.2%
Taylor expanded in x.re around 0
Applied rewrites67.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (or (<= y.re -6.6e-8) (not (<= y.re 13000000.0)))
(* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) t_0)
(* 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 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_re <= -6.6e-8) || !(y_46_re <= 13000000.0)) {
tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * t_0;
} else {
tmp = 1.0 * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if ((y_46_re <= -6.6e-8) || !(y_46_re <= 13000000.0)) tmp = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * t_0); else tmp = Float64(1.0 * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -6.6e-8], N[Not[LessEqual[y$46$re, 13000000.0]], $MachinePrecision]], 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] * t$95$0), $MachinePrecision], N[(1.0 * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -6.6 \cdot 10^{-8} \lor \neg \left(y.re \leq 13000000\right):\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -6.59999999999999954e-8 or 1.3e7 < y.re Initial program 41.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6472.0
Applied rewrites72.0%
Taylor expanded in x.im around 0
Applied rewrites68.0%
if -6.59999999999999954e-8 < y.re < 1.3e7Initial program 33.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.7
Applied rewrites50.7%
Taylor expanded in y.re around 0
Applied rewrites50.1%
Final simplification58.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.re -6.6e-8)
(* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) t_0)
(if (<= y.re 13000000.0)
(* 1.0 t_0)
(* (pow (fma (/ (* x.re x.re) x.im) 0.5 x.im) y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -6.6e-8) {
tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * t_0;
} else if (y_46_re <= 13000000.0) {
tmp = 1.0 * t_0;
} else {
tmp = pow(fma(((x_46_re * x_46_re) / x_46_im), 0.5, x_46_im), y_46_re) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -6.6e-8) tmp = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= 13000000.0) tmp = Float64(1.0 * t_0); else tmp = Float64((fma(Float64(Float64(x_46_re * x_46_re) / x_46_im), 0.5, x_46_im) ^ y_46_re) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -6.6e-8], 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] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 13000000.0], N[(1.0 * t$95$0), $MachinePrecision], N[(N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5 + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -6.6 \cdot 10^{-8}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 13000000:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -6.59999999999999954e-8Initial program 41.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.0
Applied rewrites78.0%
Taylor expanded in x.im around 0
Applied rewrites76.5%
if -6.59999999999999954e-8 < y.re < 1.3e7Initial program 33.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.7
Applied rewrites50.7%
Taylor expanded in y.re around 0
Applied rewrites50.1%
if 1.3e7 < y.re Initial program 42.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6465.7
Applied rewrites65.7%
Taylor expanded in x.re around 0
Applied rewrites64.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= x.re -1.65e-113)
(* (pow (- x.re) y.re) t_0)
(if (<= x.re 2.4e-113)
(* (pow (* (/ (* x.im x.im) x.re) 0.5) y.re) t_0)
(* (pow x.re y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= -1.65e-113) {
tmp = pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= 2.4e-113) {
tmp = pow((((x_46_im * x_46_im) / x_46_re) * 0.5), y_46_re) * t_0;
} else {
tmp = pow(x_46_re, y_46_re) * t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = cos((atan2(x_46im, x_46re) * y_46re))
if (x_46re <= (-1.65d-113)) then
tmp = (-x_46re ** y_46re) * t_0
else if (x_46re <= 2.4d-113) then
tmp = ((((x_46im * x_46im) / x_46re) * 0.5d0) ** y_46re) * t_0
else
tmp = (x_46re ** y_46re) * t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= -1.65e-113) {
tmp = Math.pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= 2.4e-113) {
tmp = Math.pow((((x_46_im * x_46_im) / x_46_re) * 0.5), y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if x_46_re <= -1.65e-113: tmp = math.pow(-x_46_re, y_46_re) * t_0 elif x_46_re <= 2.4e-113: tmp = math.pow((((x_46_im * x_46_im) / x_46_re) * 0.5), y_46_re) * t_0 else: tmp = math.pow(x_46_re, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (x_46_re <= -1.65e-113) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * t_0); elseif (x_46_re <= 2.4e-113) tmp = Float64((Float64(Float64(Float64(x_46_im * x_46_im) / x_46_re) * 0.5) ^ y_46_re) * t_0); else tmp = Float64((x_46_re ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (x_46_re <= -1.65e-113) tmp = (-x_46_re ^ y_46_re) * t_0; elseif (x_46_re <= 2.4e-113) tmp = ((((x_46_im * x_46_im) / x_46_re) * 0.5) ^ y_46_re) * t_0; else tmp = (x_46_re ^ y_46_re) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -1.65e-113], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$re, 2.4e-113], N[(N[Power[N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.re \leq -1.65 \cdot 10^{-113}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.re \leq 2.4 \cdot 10^{-113}:\\
\;\;\;\;{\left(\frac{x.im \cdot x.im}{x.re} \cdot 0.5\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < -1.6500000000000001e-113Initial program 32.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.5
Applied rewrites62.5%
Taylor expanded in x.re around -inf
Applied rewrites62.3%
if -1.6500000000000001e-113 < x.re < 2.40000000000000012e-113Initial program 49.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.5
Applied rewrites55.5%
Taylor expanded in x.re around inf
Applied rewrites44.7%
Taylor expanded in x.re around 0
Applied rewrites47.2%
if 2.40000000000000012e-113 < x.re Initial program 32.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.3
Applied rewrites64.3%
Taylor expanded in x.im around 0
Applied rewrites60.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (or (<= y.re -1.45e-5) (not (<= y.re 13000000.0)))
(* (pow x.re y.re) t_0)
(* 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 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_re <= -1.45e-5) || !(y_46_re <= 13000000.0)) {
tmp = pow(x_46_re, y_46_re) * t_0;
} else {
tmp = 1.0 * 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 = cos((atan2(x_46im, x_46re) * y_46re))
if ((y_46re <= (-1.45d-5)) .or. (.not. (y_46re <= 13000000.0d0))) then
tmp = (x_46re ** y_46re) * t_0
else
tmp = 1.0d0 * 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.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_re <= -1.45e-5) || !(y_46_re <= 13000000.0)) {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
} 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.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if (y_46_re <= -1.45e-5) or not (y_46_re <= 13000000.0): tmp = math.pow(x_46_re, y_46_re) * t_0 else: tmp = 1.0 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if ((y_46_re <= -1.45e-5) || !(y_46_re <= 13000000.0)) tmp = Float64((x_46_re ^ y_46_re) * t_0); 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 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if ((y_46_re <= -1.45e-5) || ~((y_46_re <= 13000000.0))) tmp = (x_46_re ^ y_46_re) * t_0; 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[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -1.45e-5], N[Not[LessEqual[y$46$re, 13000000.0]], $MachinePrecision]], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(1.0 * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -1.45 \cdot 10^{-5} \lor \neg \left(y.re \leq 13000000\right):\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.45e-5 or 1.3e7 < y.re Initial program 41.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6472.0
Applied rewrites72.0%
Taylor expanded in x.im around 0
Applied rewrites56.1%
if -1.45e-5 < y.re < 1.3e7Initial program 33.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.7
Applied rewrites50.7%
Taylor expanded in y.re around 0
Applied rewrites50.1%
Final simplification53.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -0.6) (not (<= y.re 4.6e+17))) (* (pow x.im y.re) (cos (* (atan2 x.im x.re) y.re))) (* 1.0 (fma (* -0.5 (* y.re y.re)) (pow (atan2 x.im x.re) 2.0) 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 <= -0.6) || !(y_46_re <= 4.6e+17)) {
tmp = pow(x_46_im, y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * fma((-0.5 * (y_46_re * y_46_re)), pow(atan2(x_46_im, x_46_re), 2.0), 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 <= -0.6) || !(y_46_re <= 4.6e+17)) tmp = Float64((x_46_im ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(1.0 * fma(Float64(-0.5 * Float64(y_46_re * y_46_re)), (atan(x_46_im, x_46_re) ^ 2.0), 1.0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -0.6], N[Not[LessEqual[y$46$re, 4.6e+17]], $MachinePrecision]], N[(N[Power[x$46$im, 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[(N[(-0.5 * N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.6 \lor \neg \left(y.re \leq 4.6 \cdot 10^{+17}\right):\\
\;\;\;\;{x.im}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \mathsf{fma}\left(-0.5 \cdot \left(y.re \cdot y.re\right), {\tan^{-1}_* \frac{x.im}{x.re}}^{2}, 1\right)\\
\end{array}
\end{array}
if y.re < -0.599999999999999978 or 4.6e17 < y.re Initial program 40.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6473.1
Applied rewrites73.1%
Taylor expanded in x.re around 0
Applied rewrites50.6%
if -0.599999999999999978 < y.re < 4.6e17Initial program 35.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.7
Applied rewrites50.7%
Taylor expanded in y.re around 0
Applied rewrites50.1%
Taylor expanded in y.re around 0
Applied rewrites48.1%
Final simplification49.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= x.re -2.5e-107)
(* (pow (- x.re) y.re) t_0)
(if (<= x.re 3.1e-111) (* (pow x.im y.re) t_0) (* (pow x.re y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= -2.5e-107) {
tmp = pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= 3.1e-111) {
tmp = pow(x_46_im, y_46_re) * t_0;
} else {
tmp = pow(x_46_re, y_46_re) * t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = cos((atan2(x_46im, x_46re) * y_46re))
if (x_46re <= (-2.5d-107)) then
tmp = (-x_46re ** y_46re) * t_0
else if (x_46re <= 3.1d-111) then
tmp = (x_46im ** y_46re) * t_0
else
tmp = (x_46re ** y_46re) * t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= -2.5e-107) {
tmp = Math.pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= 3.1e-111) {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if x_46_re <= -2.5e-107: tmp = math.pow(-x_46_re, y_46_re) * t_0 elif x_46_re <= 3.1e-111: tmp = math.pow(x_46_im, y_46_re) * t_0 else: tmp = math.pow(x_46_re, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (x_46_re <= -2.5e-107) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * t_0); elseif (x_46_re <= 3.1e-111) tmp = Float64((x_46_im ^ y_46_re) * t_0); else tmp = Float64((x_46_re ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (x_46_re <= -2.5e-107) tmp = (-x_46_re ^ y_46_re) * t_0; elseif (x_46_re <= 3.1e-111) tmp = (x_46_im ^ y_46_re) * t_0; else tmp = (x_46_re ^ y_46_re) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -2.5e-107], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$re, 3.1e-111], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.re \leq -2.5 \cdot 10^{-107}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.re \leq 3.1 \cdot 10^{-111}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < -2.49999999999999985e-107Initial program 31.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.1
Applied rewrites62.1%
Taylor expanded in x.re around -inf
Applied rewrites61.8%
if -2.49999999999999985e-107 < x.re < 3.10000000000000014e-111Initial program 50.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6456.1
Applied rewrites56.1%
Taylor expanded in x.re around 0
Applied rewrites47.7%
if 3.10000000000000014e-111 < x.re Initial program 32.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.3
Applied rewrites64.3%
Taylor expanded in x.im around 0
Applied rewrites60.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= x.im -1.35e-42)
(* (pow (- x.im) y.re) t_0)
(if (<= x.im 9200000000000.0)
(* (pow x.re y.re) t_0)
(* (pow x.im y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= -1.35e-42) {
tmp = pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 9200000000000.0) {
tmp = pow(x_46_re, y_46_re) * t_0;
} else {
tmp = pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = cos((atan2(x_46im, x_46re) * y_46re))
if (x_46im <= (-1.35d-42)) then
tmp = (-x_46im ** y_46re) * t_0
else if (x_46im <= 9200000000000.0d0) then
tmp = (x_46re ** y_46re) * t_0
else
tmp = (x_46im ** y_46re) * t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= -1.35e-42) {
tmp = Math.pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 9200000000000.0) {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if x_46_im <= -1.35e-42: tmp = math.pow(-x_46_im, y_46_re) * t_0 elif x_46_im <= 9200000000000.0: tmp = math.pow(x_46_re, y_46_re) * t_0 else: tmp = math.pow(x_46_im, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (x_46_im <= -1.35e-42) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * t_0); elseif (x_46_im <= 9200000000000.0) tmp = Float64((x_46_re ^ y_46_re) * t_0); else tmp = Float64((x_46_im ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (x_46_im <= -1.35e-42) tmp = (-x_46_im ^ y_46_re) * t_0; elseif (x_46_im <= 9200000000000.0) tmp = (x_46_re ^ y_46_re) * t_0; else tmp = (x_46_im ^ y_46_re) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.35e-42], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 9200000000000.0], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.im \leq -1.35 \cdot 10^{-42}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.im \leq 9200000000000:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -1.35e-42Initial program 28.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6458.8
Applied rewrites58.8%
Taylor expanded in x.im around -inf
Applied rewrites56.8%
if -1.35e-42 < x.im < 9.2e12Initial program 47.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.1
Applied rewrites64.1%
Taylor expanded in x.im around 0
Applied rewrites53.1%
if 9.2e12 < x.im Initial program 30.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.8
Applied rewrites57.8%
Taylor expanded in x.re around 0
Applied rewrites57.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (atan2 x.im x.re) 2.0)) (t_1 (* -0.5 (* y.re y.re))))
(if (or (<= y.im -3100000000000.0) (not (<= y.im 4000.0)))
(* 1.0 (* t_1 t_0))
(* 1.0 (fma t_1 t_0 1.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(atan2(x_46_im, x_46_re), 2.0);
double t_1 = -0.5 * (y_46_re * y_46_re);
double tmp;
if ((y_46_im <= -3100000000000.0) || !(y_46_im <= 4000.0)) {
tmp = 1.0 * (t_1 * t_0);
} else {
tmp = 1.0 * fma(t_1, t_0, 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan(x_46_im, x_46_re) ^ 2.0 t_1 = Float64(-0.5 * Float64(y_46_re * y_46_re)) tmp = 0.0 if ((y_46_im <= -3100000000000.0) || !(y_46_im <= 4000.0)) tmp = Float64(1.0 * Float64(t_1 * t_0)); else tmp = Float64(1.0 * fma(t_1, t_0, 1.0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(-0.5 * N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -3100000000000.0], N[Not[LessEqual[y$46$im, 4000.0]], $MachinePrecision]], N[(1.0 * N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(t$95$1 * t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\\
t_1 := -0.5 \cdot \left(y.re \cdot y.re\right)\\
\mathbf{if}\;y.im \leq -3100000000000 \lor \neg \left(y.im \leq 4000\right):\\
\;\;\;\;1 \cdot \left(t\_1 \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \mathsf{fma}\left(t\_1, t\_0, 1\right)\\
\end{array}
\end{array}
if y.im < -3.1e12 or 4e3 < y.im Initial program 31.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6429.8
Applied rewrites29.8%
Taylor expanded in y.re around 0
Applied rewrites13.3%
Taylor expanded in y.re around 0
Applied rewrites5.2%
Taylor expanded in y.re around inf
Applied rewrites17.4%
if -3.1e12 < y.im < 4e3Initial program 43.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6486.9
Applied rewrites86.9%
Taylor expanded in y.re around 0
Applied rewrites65.6%
Taylor expanded in y.re around 0
Applied rewrites50.7%
Final simplification35.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -125000000.0) (not (<= y.im 1.65e+57))) (* 1.0 (* (* -0.5 (* y.re y.re)) (pow (atan2 x.im x.re) 2.0))) (* 1.0 (fma (pow (* (atan2 x.im x.re) y.re) 2.0) -0.5 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_im <= -125000000.0) || !(y_46_im <= 1.65e+57)) {
tmp = 1.0 * ((-0.5 * (y_46_re * y_46_re)) * pow(atan2(x_46_im, x_46_re), 2.0));
} else {
tmp = 1.0 * fma(pow((atan2(x_46_im, x_46_re) * y_46_re), 2.0), -0.5, 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -125000000.0) || !(y_46_im <= 1.65e+57)) tmp = Float64(1.0 * Float64(Float64(-0.5 * Float64(y_46_re * y_46_re)) * (atan(x_46_im, x_46_re) ^ 2.0))); else tmp = Float64(1.0 * fma((Float64(atan(x_46_im, x_46_re) * y_46_re) ^ 2.0), -0.5, 1.0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -125000000.0], N[Not[LessEqual[y$46$im, 1.65e+57]], $MachinePrecision]], N[(1.0 * N[(N[(-0.5 * N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(N[Power[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision], 2.0], $MachinePrecision] * -0.5 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -125000000 \lor \neg \left(y.im \leq 1.65 \cdot 10^{+57}\right):\\
\;\;\;\;1 \cdot \left(\left(-0.5 \cdot \left(y.re \cdot y.re\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \mathsf{fma}\left({\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}^{2}, -0.5, 1\right)\\
\end{array}
\end{array}
if y.im < -1.25e8 or 1.6500000000000001e57 < y.im Initial program 32.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6429.6
Applied rewrites29.6%
Taylor expanded in y.re around 0
Applied rewrites14.5%
Taylor expanded in y.re around 0
Applied rewrites5.3%
Taylor expanded in y.re around inf
Applied rewrites17.8%
if -1.25e8 < y.im < 1.6500000000000001e57Initial program 42.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6485.8
Applied rewrites85.8%
Taylor expanded in y.re around 0
Applied rewrites63.6%
Taylor expanded in y.re around 0
Applied rewrites49.6%
Applied rewrites49.1%
Final simplification35.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 1.0 (fma (pow (* (atan2 x.im x.re) y.re) 2.0) -0.5 1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 * fma(pow((atan2(x_46_im, x_46_re) * y_46_re), 2.0), -0.5, 1.0);
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 * fma((Float64(atan(x_46_im, x_46_re) * y_46_re) ^ 2.0), -0.5, 1.0)) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 * N[(N[Power[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision], 2.0], $MachinePrecision] * -0.5 + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot \mathsf{fma}\left({\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}^{2}, -0.5, 1\right)
\end{array}
Initial program 37.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.0
Applied rewrites61.0%
Taylor expanded in y.re around 0
Applied rewrites41.9%
Taylor expanded in y.re around 0
Applied rewrites30.1%
Applied rewrites29.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 1.0 (cos (* (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 1.0 * cos((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 * cos((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 1.0 * Math.cos((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 1.0 * math.cos((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(1.0 * cos(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 * cos((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[(1.0 * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
Initial program 37.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.0
Applied rewrites61.0%
Taylor expanded in y.re around 0
Applied rewrites27.2%
herbie shell --seed 2024315
(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)))))