
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(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 (log (hypot x.im x.re)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (cos t_1))
(t_3 (sin t_1)))
(if (<= y.im 0.000165)
(*
(pow (exp y.im) (- (atan2 x.im x.re)))
(* (cos (* t_0 y.im)) (pow (hypot x.im x.re) y.re)))
(if (<= y.im 4e+114)
(*
(fma
(fma (* -0.5 y.im) (* (pow t_0 2.0) t_2) (* (- t_0) t_3))
y.im
t_2)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
(*
(fma (- y.im) (* t_3 t_0) t_2)
(exp (* (- y.im) (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = cos(t_1);
double t_3 = sin(t_1);
double tmp;
if (y_46_im <= 0.000165) {
tmp = pow(exp(y_46_im), -atan2(x_46_im, x_46_re)) * (cos((t_0 * y_46_im)) * pow(hypot(x_46_im, x_46_re), y_46_re));
} else if (y_46_im <= 4e+114) {
tmp = fma(fma((-0.5 * y_46_im), (pow(t_0, 2.0) * t_2), (-t_0 * t_3)), y_46_im, t_2) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = fma(-y_46_im, (t_3 * t_0), t_2) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = cos(t_1) t_3 = sin(t_1) tmp = 0.0 if (y_46_im <= 0.000165) tmp = Float64((exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))) * Float64(cos(Float64(t_0 * y_46_im)) * (hypot(x_46_im, x_46_re) ^ y_46_re))); elseif (y_46_im <= 4e+114) tmp = Float64(fma(fma(Float64(-0.5 * y_46_im), Float64((t_0 ^ 2.0) * t_2), Float64(Float64(-t_0) * t_3)), y_46_im, t_2) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(fma(Float64(-y_46_im), Float64(t_3 * t_0), t_2) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 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[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[y$46$im, 0.000165], N[(N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision] * N[(N[Cos[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4e+114], N[(N[(N[(N[(-0.5 * y$46$im), $MachinePrecision] * N[(N[Power[t$95$0, 2.0], $MachinePrecision] * t$95$2), $MachinePrecision] + N[((-t$95$0) * t$95$3), $MachinePrecision]), $MachinePrecision] * y$46$im + t$95$2), $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[((-y$46$im) * N[(t$95$3 * t$95$0), $MachinePrecision] + t$95$2), $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \cos t\_1\\
t_3 := \sin t\_1\\
\mathbf{if}\;y.im \leq 0.000165:\\
\;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \left(\cos \left(t\_0 \cdot y.im\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\
\mathbf{elif}\;y.im \leq 4 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y.im, {t\_0}^{2} \cdot t\_2, \left(-t\_0\right) \cdot t\_3\right), y.im, t\_2\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y.im, t\_3 \cdot t\_0, t\_2\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < 1.65e-4Initial program 42.7%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6469.6
Applied rewrites69.6%
lift-*.f64N/A
Applied rewrites84.4%
if 1.65e-4 < y.im < 4e114Initial program 56.8%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites75.0%
if 4e114 < y.im Initial program 41.9%
Taylor expanded in y.im around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites70.6%
Taylor expanded in y.re around 0
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6487.0
Applied rewrites87.0%
Final simplification84.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (cos t_1)))
(if (<= y.im 0.000165)
(*
(pow (exp y.im) (- (atan2 x.im x.re)))
(* (cos (* t_0 y.im)) (pow (hypot x.im x.re) y.re)))
(if (<= y.im 3.2e+106)
(*
t_2
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
(*
(fma (- y.im) (* (sin t_1) t_0) t_2)
(exp (* (- y.im) (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = cos(t_1);
double tmp;
if (y_46_im <= 0.000165) {
tmp = pow(exp(y_46_im), -atan2(x_46_im, x_46_re)) * (cos((t_0 * y_46_im)) * pow(hypot(x_46_im, x_46_re), y_46_re));
} else if (y_46_im <= 3.2e+106) {
tmp = t_2 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = fma(-y_46_im, (sin(t_1) * t_0), t_2) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = cos(t_1) tmp = 0.0 if (y_46_im <= 0.000165) tmp = Float64((exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))) * Float64(cos(Float64(t_0 * y_46_im)) * (hypot(x_46_im, x_46_re) ^ y_46_re))); elseif (y_46_im <= 3.2e+106) tmp = Float64(t_2 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(fma(Float64(-y_46_im), Float64(sin(t_1) * t_0), t_2) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 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]}, If[LessEqual[y$46$im, 0.000165], N[(N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision] * N[(N[Cos[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.2e+106], N[(t$95$2 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[((-y$46$im) * N[(N[Sin[t$95$1], $MachinePrecision] * t$95$0), $MachinePrecision] + t$95$2), $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \cos t\_1\\
\mathbf{if}\;y.im \leq 0.000165:\\
\;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \left(\cos \left(t\_0 \cdot y.im\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\
\mathbf{elif}\;y.im \leq 3.2 \cdot 10^{+106}:\\
\;\;\;\;t\_2 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y.im, \sin t\_1 \cdot t\_0, t\_2\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < 1.65e-4Initial program 42.7%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6469.6
Applied rewrites69.6%
lift-*.f64N/A
Applied rewrites84.4%
if 1.65e-4 < y.im < 3.1999999999999998e106Initial program 57.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6476.5
Applied rewrites76.5%
if 3.1999999999999998e106 < y.im Initial program 42.3%
Taylor expanded in y.im around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites69.7%
Taylor expanded in y.re around 0
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6485.3
Applied rewrites85.3%
Final simplification83.9%
(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 0.000165)
(*
(pow (exp y.im) (- (atan2 x.im x.re)))
(* (cos (* (log (hypot x.im x.re)) y.im)) (pow (hypot x.im x.re) y.re)))
(if (<= y.im 1.16e+107)
(*
t_0
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
(* t_0 (exp (* (- y.im) (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= 0.000165) {
tmp = pow(exp(y_46_im), -atan2(x_46_im, x_46_re)) * (cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * pow(hypot(x_46_im, x_46_re), y_46_re));
} else if (y_46_im <= 1.16e+107) {
tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= 0.000165) {
tmp = Math.pow(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)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re));
} else if (y_46_im <= 1.16e+107) {
tmp = t_0 * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = t_0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_im <= 0.000165: tmp = math.pow(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)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)) elif y_46_im <= 1.16e+107: tmp = t_0 * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) else: tmp = t_0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_im <= 0.000165) tmp = Float64((exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))) * Float64(cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * (hypot(x_46_im, x_46_re) ^ y_46_re))); elseif (y_46_im <= 1.16e+107) tmp = Float64(t_0 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_im <= 0.000165) tmp = (exp(y_46_im) ^ -atan2(x_46_im, x_46_re)) * (cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 1.16e+107) tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); else tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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, 0.000165], N[(N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision] * N[(N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.16e+107], N[(t$95$0 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.im \leq 0.000165:\\
\;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \left(\cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\
\mathbf{elif}\;y.im \leq 1.16 \cdot 10^{+107}:\\
\;\;\;\;t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < 1.65e-4Initial program 42.7%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6469.6
Applied rewrites69.6%
lift-*.f64N/A
Applied rewrites84.4%
if 1.65e-4 < y.im < 1.1600000000000001e107Initial program 57.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6476.5
Applied rewrites76.5%
if 1.1600000000000001e107 < y.im Initial program 42.3%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6465.2
Applied rewrites65.2%
Taylor expanded in y.re around 0
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6480.9
Applied rewrites80.9%
Final simplification83.2%
(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)
(* (atan2 x.im x.re) y.im)))
(cos (* (log (hypot x.im x.re)) y.im)))))
(if (<= y.re -0.98)
t_0
(if (<= y.re 5.8e+45)
(*
(cos (* (atan2 x.im x.re) y.re))
(exp (* (- y.im) (atan2 x.im x.re))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_re <= -0.98) {
tmp = t_0;
} else if (y_46_re <= 5.8e+45) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_re <= -0.98) {
tmp = t_0;
} else if (y_46_re <= 5.8e+45) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0 if y_46_re <= -0.98: tmp = t_0 elif y_46_re <= 5.8e+45: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))) tmp = 0.0 if (y_46_re <= -0.98) tmp = t_0; elseif (y_46_re <= 5.8e+45) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((log(hypot(x_46_im, x_46_re)) * y_46_im)); tmp = 0.0; if (y_46_re <= -0.98) tmp = t_0; elseif (y_46_re <= 5.8e+45) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $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]}, If[LessEqual[y$46$re, -0.98], t$95$0, If[LessEqual[y$46$re, 5.8e+45], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -0.98:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5.8 \cdot 10^{+45}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.97999999999999998 or 5.7999999999999994e45 < y.re Initial program 42.9%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6485.1
Applied rewrites85.1%
if -0.97999999999999998 < y.re < 5.7999999999999994e45Initial program 44.8%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6453.1
Applied rewrites53.1%
Taylor expanded in y.re around 0
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6480.5
Applied rewrites80.5%
Final simplification82.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))) (t_1 (log (hypot x.im x.re))))
(if (<= y.im -1260000000000.0)
(*
t_0
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
(if (<= y.im 2.3e+27)
(* (exp (* t_1 y.re)) (cos (* t_1 y.im)))
(* t_0 (exp (* (- y.im) (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -1260000000000.0) {
tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_im <= 2.3e+27) {
tmp = exp((t_1 * y_46_re)) * cos((t_1 * y_46_im));
} else {
tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = Math.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -1260000000000.0) {
tmp = t_0 * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_im <= 2.3e+27) {
tmp = Math.exp((t_1 * y_46_re)) * Math.cos((t_1 * y_46_im));
} else {
tmp = t_0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) t_1 = math.log(math.hypot(x_46_im, x_46_re)) tmp = 0 if y_46_im <= -1260000000000.0: tmp = t_0 * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) elif y_46_im <= 2.3e+27: tmp = math.exp((t_1 * y_46_re)) * math.cos((t_1 * y_46_im)) else: tmp = t_0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_1 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -1260000000000.0) tmp = Float64(t_0 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_im <= 2.3e+27) tmp = Float64(exp(Float64(t_1 * y_46_re)) * cos(Float64(t_1 * y_46_im))); else tmp = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)); t_1 = log(hypot(x_46_im, x_46_re)); tmp = 0.0; if (y_46_im <= -1260000000000.0) tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); elseif (y_46_im <= 2.3e+27) tmp = exp((t_1 * y_46_re)) * cos((t_1 * y_46_im)); else tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1260000000000.0], N[(t$95$0 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.3e+27], N[(N[Exp[N[(t$95$1 * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -1260000000000:\\
\;\;\;\;t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;y.im \leq 2.3 \cdot 10^{+27}:\\
\;\;\;\;e^{t\_1 \cdot y.re} \cdot \cos \left(t\_1 \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < -1.26e12Initial program 47.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6465.9
Applied rewrites65.9%
if -1.26e12 < y.im < 2.3000000000000001e27Initial program 41.2%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6440.6
Applied rewrites40.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6492.7
Applied rewrites92.7%
if 2.3000000000000001e27 < y.im Initial program 45.3%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.0
Applied rewrites69.0%
Taylor expanded in y.re around 0
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6475.8
Applied rewrites75.8%
Final simplification82.1%
(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 -1260000000000.0)
(*
t_0
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
(if (<= y.im 5.8e+32)
(* t_0 (pow (hypot x.im x.re) y.re))
(* t_0 (exp (* (- y.im) (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= -1260000000000.0) {
tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_im <= 5.8e+32) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= -1260000000000.0) {
tmp = t_0 * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_im <= 5.8e+32) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_im <= -1260000000000.0: tmp = t_0 * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) elif y_46_im <= 5.8e+32: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_im <= -1260000000000.0) tmp = Float64(t_0 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_im <= 5.8e+32) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_im <= -1260000000000.0) tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); elseif (y_46_im <= 5.8e+32) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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, -1260000000000.0], N[(t$95$0 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5.8e+32], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.im \leq -1260000000000:\\
\;\;\;\;t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;y.im \leq 5.8 \cdot 10^{+32}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < -1.26e12Initial program 47.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6465.9
Applied rewrites65.9%
if -1.26e12 < y.im < 5.80000000000000006e32Initial program 40.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.f6484.9
Applied rewrites84.9%
if 5.80000000000000006e32 < y.im Initial program 46.1%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6468.5
Applied rewrites68.5%
Taylor expanded in y.re around 0
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6477.1
Applied rewrites77.1%
Final simplification78.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re)))
(t_1 (* t_0 (exp (* (- y.im) (atan2 x.im x.re))))))
(if (<= y.im -3900.0)
t_1
(if (<= y.im 5.8e+32) (* t_0 (pow (hypot x.im x.re) y.re)) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -3900.0) {
tmp = t_1;
} else if (y_46_im <= 5.8e+32) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 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.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = t_0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -3900.0) {
tmp = t_1;
} else if (y_46_im <= 5.8e+32) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_1;
}
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)) t_1 = t_0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= -3900.0: tmp = t_1 elif y_46_im <= 5.8e+32: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_1 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)) t_1 = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -3900.0) tmp = t_1; elseif (y_46_im <= 5.8e+32) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)); t_1 = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= -3900.0) tmp = t_1; elseif (y_46_im <= 5.8e+32) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3900.0], t$95$1, If[LessEqual[y$46$im, 5.8e+32], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -3900:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 5.8 \cdot 10^{+32}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -3900 or 5.80000000000000006e32 < y.im Initial program 45.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6465.6
Applied rewrites65.6%
Taylor expanded in y.re around 0
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6468.1
Applied rewrites68.1%
if -3900 < y.im < 5.80000000000000006e32Initial 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.f6486.8
Applied rewrites86.8%
Final simplification77.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (cos (* (atan2 x.im x.re) y.re)) (pow (hypot x.im x.re) y.re))))
(if (<= x.re -5e-310)
t_0
(if (<= x.re 3.4e-194)
(* (exp (* (- y.im) (atan2 x.im x.re))) (cos (* (log x.re) y.im)))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (x_46_re <= -5e-310) {
tmp = t_0;
} else if (x_46_re <= 3.4e-194) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(x_46_re) * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (x_46_re <= -5e-310) {
tmp = t_0;
} else if (x_46_re <= 3.4e-194) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.cos((Math.log(x_46_re) * y_46_im));
} else {
tmp = 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)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if x_46_re <= -5e-310: tmp = t_0 elif x_46_re <= 3.4e-194: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.cos((math.log(x_46_re) * y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (x_46_re <= -5e-310) tmp = t_0; elseif (x_46_re <= 3.4e-194) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * cos(Float64(log(x_46_re) * y_46_im))); 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 = cos((atan2(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re); tmp = 0.0; if (x_46_re <= -5e-310) tmp = t_0; elseif (x_46_re <= 3.4e-194) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(x_46_re) * y_46_im)); 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[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -5e-310], t$95$0, If[LessEqual[x$46$re, 3.4e-194], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[Log[x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x.re \leq 3.4 \cdot 10^{-194}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log x.re \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x.re < -4.999999999999985e-310 or 3.40000000000000009e-194 < x.re Initial 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.f6463.0
Applied rewrites63.0%
if -4.999999999999985e-310 < x.re < 3.40000000000000009e-194Initial program 50.0%
Taylor expanded in x.re around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites81.0%
Taylor expanded in y.re around 0
Applied rewrites81.3%
Final simplification64.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.im 8.5e+36)
(* t_0 (pow (hypot x.im x.re) y.re))
(* (pow (* x.re x.re) (* 0.5 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 <= 8.5e+36) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow((x_46_re * x_46_re), (0.5 * y_46_re)) * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= 8.5e+36) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.pow((x_46_re * x_46_re), (0.5 * 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 y_46_im <= 8.5e+36: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.pow((x_46_re * x_46_re), (0.5 * 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 <= 8.5e+36) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64((Float64(x_46_re * x_46_re) ^ Float64(0.5 * 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 (y_46_im <= 8.5e+36) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = ((x_46_re * x_46_re) ^ (0.5 * 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[y$46$im, 8.5e+36], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(x$46$re * x$46$re), $MachinePrecision], N[(0.5 * y$46$re), $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.im \leq 8.5 \cdot 10^{+36}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(x.re \cdot x.re\right)}^{\left(0.5 \cdot y.re\right)} \cdot t\_0\\
\end{array}
\end{array}
if y.im < 8.50000000000000014e36Initial program 43.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6468.7
Applied rewrites68.7%
if 8.50000000000000014e36 < y.im Initial program 45.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.f6433.1
Applied rewrites33.1%
Applied rewrites37.8%
Taylor expanded in x.re around inf
Applied rewrites41.0%
Final simplification62.4%
(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 -7.5e-60)
(* (pow (- x.re) y.re) t_0)
(if (<= x.re 5.3e-214)
(* (pow (* x.im x.im) (* 0.5 y.re)) t_0)
(* (pow (fma (/ (* x.im x.im) x.re) 0.5 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 <= -7.5e-60) {
tmp = pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= 5.3e-214) {
tmp = pow((x_46_im * x_46_im), (0.5 * y_46_re)) * t_0;
} else {
tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, 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 <= -7.5e-60) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * t_0); elseif (x_46_re <= 5.3e-214) tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(0.5 * y_46_re)) * t_0); else tmp = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, 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[x$46$re, -7.5e-60], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$re, 5.3e-214], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$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]]]]
\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 -7.5 \cdot 10^{-60}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.re \leq 5.3 \cdot 10^{-214}:\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(0.5 \cdot y.re\right)} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < -7.5000000000000002e-60Initial program 42.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.f6462.0
Applied rewrites62.0%
Taylor expanded in x.re around -inf
Applied rewrites62.0%
if -7.5000000000000002e-60 < x.re < 5.30000000000000005e-214Initial program 52.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.f6459.5
Applied rewrites59.5%
Applied rewrites56.3%
Taylor expanded in x.re around 0
Applied rewrites55.3%
if 5.30000000000000005e-214 < x.re Initial program 37.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6460.6
Applied rewrites60.6%
Taylor expanded in x.im around 0
Applied rewrites59.2%
Final simplification58.6%
(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 -7.5e-60)
(* (pow (- x.re) y.re) t_0)
(if (<= x.re 1.22e-24)
(* (pow (* x.im x.im) (* 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 <= -7.5e-60) {
tmp = pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= 1.22e-24) {
tmp = pow((x_46_im * x_46_im), (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 <= (-7.5d-60)) then
tmp = (-x_46re ** y_46re) * t_0
else if (x_46re <= 1.22d-24) then
tmp = ((x_46im * x_46im) ** (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 <= -7.5e-60) {
tmp = Math.pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= 1.22e-24) {
tmp = Math.pow((x_46_im * x_46_im), (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 <= -7.5e-60: tmp = math.pow(-x_46_re, y_46_re) * t_0 elif x_46_re <= 1.22e-24: tmp = math.pow((x_46_im * x_46_im), (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 <= -7.5e-60) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * t_0); elseif (x_46_re <= 1.22e-24) tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(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 <= -7.5e-60) tmp = (-x_46_re ^ y_46_re) * t_0; elseif (x_46_re <= 1.22e-24) tmp = ((x_46_im * x_46_im) ^ (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, -7.5e-60], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$re, 1.22e-24], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $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 -7.5 \cdot 10^{-60}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.re \leq 1.22 \cdot 10^{-24}:\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(0.5 \cdot y.re\right)} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < -7.5000000000000002e-60Initial program 42.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.f6462.0
Applied rewrites62.0%
Taylor expanded in x.re around -inf
Applied rewrites62.0%
if -7.5000000000000002e-60 < x.re < 1.22000000000000004e-24Initial program 53.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.f6460.2
Applied rewrites60.2%
Applied rewrites55.6%
Taylor expanded in x.re around 0
Applied rewrites54.1%
if 1.22000000000000004e-24 < x.re Initial program 26.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.9
Applied rewrites59.9%
Taylor expanded in x.im around 0
Applied rewrites59.9%
Final simplification57.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))) (t_1 (* (pow x.re y.re) t_0)))
(if (<= y.re -2e+230)
(* (pow x.im y.re) t_0)
(if (<= y.re -0.0126)
t_1
(if (<= y.re 102000.0) (fma (log (hypot x.im x.re)) y.re 1.0) t_1)))))
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 t_1 = pow(x_46_re, y_46_re) * t_0;
double tmp;
if (y_46_re <= -2e+230) {
tmp = pow(x_46_im, y_46_re) * t_0;
} else if (y_46_re <= -0.0126) {
tmp = t_1;
} else if (y_46_re <= 102000.0) {
tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0);
} else {
tmp = t_1;
}
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)) t_1 = Float64((x_46_re ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -2e+230) tmp = Float64((x_46_im ^ y_46_re) * t_0); elseif (y_46_re <= -0.0126) tmp = t_1; elseif (y_46_re <= 102000.0) tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0); else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -2e+230], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, -0.0126], t$95$1, If[LessEqual[y$46$re, 102000.0], N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + 1.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := {x.re}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -2 \cdot 10^{+230}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq -0.0126:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 102000:\\
\;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.0000000000000002e230Initial program 57.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.f6479.0
Applied rewrites79.0%
Taylor expanded in x.re around 0
Applied rewrites68.7%
if -2.0000000000000002e230 < y.re < -0.0126 or 102000 < y.re Initial program 40.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.f6468.3
Applied rewrites68.3%
Taylor expanded in x.im around 0
Applied rewrites54.3%
if -0.0126 < y.re < 102000Initial program 45.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.f6449.9
Applied rewrites49.9%
Taylor expanded in y.re around 0
Applied rewrites47.6%
(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.18e-86)
(* (pow (- x.im) y.re) t_0)
(if (<= x.im 5e-74)
(* (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.18e-86) {
tmp = pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 5e-74) {
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.18d-86)) then
tmp = (-x_46im ** y_46re) * t_0
else if (x_46im <= 5d-74) 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.18e-86) {
tmp = Math.pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 5e-74) {
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.18e-86: tmp = math.pow(-x_46_im, y_46_re) * t_0 elif x_46_im <= 5e-74: 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.18e-86) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * t_0); elseif (x_46_im <= 5e-74) tmp = Float64((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.18e-86) tmp = (-x_46_im ^ y_46_re) * t_0; elseif (x_46_im <= 5e-74) 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.18e-86], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 5e-74], 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.18 \cdot 10^{-86}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.im \leq 5 \cdot 10^{-74}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -1.1799999999999999e-86Initial program 35.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.f6455.6
Applied rewrites55.6%
Taylor expanded in x.im around -inf
Applied rewrites53.4%
if -1.1799999999999999e-86 < x.im < 4.99999999999999998e-74Initial program 50.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.f6464.3
Applied rewrites64.3%
Taylor expanded in x.re around -inf
Applied rewrites55.0%
if 4.99999999999999998e-74 < x.im Initial program 45.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.f6461.8
Applied rewrites61.8%
Taylor expanded in x.re around 0
Applied rewrites61.9%
(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 -3.6e-98)
(* (pow (- x.im) y.re) t_0)
(if (<= x.im 6.4e-137) (* (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 <= -3.6e-98) {
tmp = pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 6.4e-137) {
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 <= (-3.6d-98)) then
tmp = (-x_46im ** y_46re) * t_0
else if (x_46im <= 6.4d-137) 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 <= -3.6e-98) {
tmp = Math.pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 6.4e-137) {
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 <= -3.6e-98: tmp = math.pow(-x_46_im, y_46_re) * t_0 elif x_46_im <= 6.4e-137: 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 <= -3.6e-98) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * t_0); elseif (x_46_im <= 6.4e-137) 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 <= -3.6e-98) tmp = (-x_46_im ^ y_46_re) * t_0; elseif (x_46_im <= 6.4e-137) 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, -3.6e-98], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 6.4e-137], 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 -3.6 \cdot 10^{-98}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.im \leq 6.4 \cdot 10^{-137}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -3.6000000000000002e-98Initial program 34.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.f6456.1
Applied rewrites56.1%
Taylor expanded in x.im around -inf
Applied rewrites53.9%
if -3.6000000000000002e-98 < x.im < 6.40000000000000043e-137Initial 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.f6468.3
Applied rewrites68.3%
Taylor expanded in x.im around 0
Applied rewrites56.2%
if 6.40000000000000043e-137 < x.im Initial program 49.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.f6458.6
Applied rewrites58.6%
Taylor expanded in x.re around 0
Applied rewrites56.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow x.im y.re) (cos (* (atan2 x.im x.re) y.re))))) (if (<= y.re -290.0) t_0 (if (<= y.re 102000.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 = pow(x_46_im, y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -290.0) {
tmp = t_0;
} else if (y_46_re <= 102000.0) {
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) * cos((atan2(x_46im, x_46re) * y_46re))
if (y_46re <= (-290.0d0)) then
tmp = t_0
else if (y_46re <= 102000.0d0) 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) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -290.0) {
tmp = t_0;
} else if (y_46_re <= 102000.0) {
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) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -290.0: tmp = t_0 elif y_46_re <= 102000.0: 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) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))) tmp = 0.0 if (y_46_re <= -290.0) tmp = t_0; elseif (y_46_re <= 102000.0) 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) * cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -290.0) tmp = t_0; elseif (y_46_re <= 102000.0) 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] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -290.0], t$95$0, If[LessEqual[y$46$re, 102000.0], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x.im}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -290:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 102000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -290 or 102000 < y.re Initial 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.f6469.8
Applied rewrites69.8%
Taylor expanded in x.re around 0
Applied rewrites50.9%
if -290 < y.re < 102000Initial program 45.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.4
Applied rewrites50.4%
Taylor expanded in y.re around 0
Applied rewrites46.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 3600.0) (* (fma (* (* y.re y.re) -0.5) (pow (atan2 x.im x.re) 2.0) 1.0) 1.0) (fma (* 0.5 y.re) (log (fma x.im x.im (* x.re x.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 <= 3600.0) {
tmp = fma(((y_46_re * y_46_re) * -0.5), pow(atan2(x_46_im, x_46_re), 2.0), 1.0) * 1.0;
} else {
tmp = fma((0.5 * y_46_re), log(fma(x_46_im, x_46_im, (x_46_re * x_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 <= 3600.0) tmp = Float64(fma(Float64(Float64(y_46_re * y_46_re) * -0.5), (atan(x_46_im, x_46_re) ^ 2.0), 1.0) * 1.0); else tmp = fma(Float64(0.5 * y_46_re), log(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))), 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 3600.0], N[(N[(N[(N[(y$46$re * y$46$re), $MachinePrecision] * -0.5), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(0.5 * y$46$re), $MachinePrecision] * N[Log[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 3600:\\
\;\;\;\;\mathsf{fma}\left(\left(y.re \cdot y.re\right) \cdot -0.5, {\tan^{-1}_* \frac{x.im}{x.re}}^{2}, 1\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5 \cdot y.re, \log \left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right), 1\right)\\
\end{array}
\end{array}
if y.re < 3600Initial program 45.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.8
Applied rewrites62.8%
Taylor expanded in y.re around 0
Applied rewrites45.9%
Taylor expanded in y.re around 0
Applied rewrites31.1%
if 3600 < y.re Initial program 38.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.f6454.0
Applied rewrites54.0%
Applied rewrites54.0%
Taylor expanded in y.re around 0
Applied rewrites23.3%
Final simplification29.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 3600.0) 1.0 (fma (* 0.5 y.re) (log (fma x.im x.im (* x.re x.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 <= 3600.0) {
tmp = 1.0;
} else {
tmp = fma((0.5 * y_46_re), log(fma(x_46_im, x_46_im, (x_46_re * x_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 <= 3600.0) tmp = 1.0; else tmp = fma(Float64(0.5 * y_46_re), log(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))), 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 3600.0], 1.0, N[(N[(0.5 * y$46$re), $MachinePrecision] * N[Log[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 3600:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5 \cdot y.re, \log \left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right), 1\right)\\
\end{array}
\end{array}
if y.re < 3600Initial program 45.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.8
Applied rewrites62.8%
Taylor expanded in y.re around 0
Applied rewrites30.5%
if 3600 < y.re Initial program 38.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.f6454.0
Applied rewrites54.0%
Applied rewrites54.0%
Taylor expanded in y.re around 0
Applied rewrites23.3%
(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 43.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.f6460.6
Applied rewrites60.6%
Taylor expanded in y.re around 0
Applied rewrites23.4%
herbie shell --seed 2024308
(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)))))