
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (cos t_0))
(t_2 (* t_1 (exp (* (atan2 x.im x.re) (- y.im)))))
(t_3 (log (hypot x.im x.re)))
(t_4 (pow t_3 2.0)))
(if (<= y.im -9.8e+118)
t_2
(if (<= y.im 4.5e-33)
(/
(* (+ (* t_4 (* (* y.im y.im) -0.5)) 1.0) (pow (hypot x.im x.re) y.re))
(pow (exp y.im) (atan2 x.im x.re)))
(if (<= y.im 1e+143)
(*
(fma (fma (* -0.5 y.im) (* t_1 t_4) (* (- t_3) (sin t_0))) y.im t_1)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
t_2)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = cos(t_0);
double t_2 = t_1 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
double t_3 = log(hypot(x_46_im, x_46_re));
double t_4 = pow(t_3, 2.0);
double tmp;
if (y_46_im <= -9.8e+118) {
tmp = t_2;
} else if (y_46_im <= 4.5e-33) {
tmp = (((t_4 * ((y_46_im * y_46_im) * -0.5)) + 1.0) * pow(hypot(x_46_im, x_46_re), y_46_re)) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else if (y_46_im <= 1e+143) {
tmp = fma(fma((-0.5 * y_46_im), (t_1 * t_4), (-t_3 * sin(t_0))), y_46_im, t_1) * 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_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = cos(t_0) t_2 = Float64(t_1 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) t_3 = log(hypot(x_46_im, x_46_re)) t_4 = t_3 ^ 2.0 tmp = 0.0 if (y_46_im <= -9.8e+118) tmp = t_2; elseif (y_46_im <= 4.5e-33) tmp = Float64(Float64(Float64(Float64(t_4 * Float64(Float64(y_46_im * y_46_im) * -0.5)) + 1.0) * (hypot(x_46_im, x_46_re) ^ y_46_re)) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); elseif (y_46_im <= 1e+143) tmp = Float64(fma(fma(Float64(-0.5 * y_46_im), Float64(t_1 * t_4), Float64(Float64(-t_3) * sin(t_0))), y_46_im, t_1) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = t_2; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Power[t$95$3, 2.0], $MachinePrecision]}, If[LessEqual[y$46$im, -9.8e+118], t$95$2, If[LessEqual[y$46$im, 4.5e-33], N[(N[(N[(N[(t$95$4 * N[(N[(y$46$im * y$46$im), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1e+143], N[(N[(N[(N[(-0.5 * y$46$im), $MachinePrecision] * N[(t$95$1 * t$95$4), $MachinePrecision] + N[((-t$95$3) * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y$46$im + t$95$1), $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], t$95$2]]]]]]]]
\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 := t\_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_4 := {t\_3}^{2}\\
\mathbf{if}\;y.im \leq -9.8 \cdot 10^{+118}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 4.5 \cdot 10^{-33}:\\
\;\;\;\;\frac{\left(t\_4 \cdot \left(\left(y.im \cdot y.im\right) \cdot -0.5\right) + 1\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.im \leq 10^{+143}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y.im, t\_1 \cdot t\_4, \left(-t\_3\right) \cdot \sin t\_0\right), y.im, t\_1\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}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.im < -9.8000000000000006e118 or 1e143 < y.im Initial program 27.2%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.9
Applied rewrites46.9%
Taylor expanded in y.re around 0
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6458.3
Applied rewrites58.3%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-atan2.f6467.0
Applied rewrites67.0%
if -9.8000000000000006e118 < y.im < 4.49999999999999991e-33Initial program 47.6%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites85.5%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites87.6%
Taylor expanded in y.re around 0
Applied rewrites91.5%
if 4.49999999999999991e-33 < y.im < 1e143Initial program 36.3%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites70.7%
Final simplification81.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(cos (* (atan2 x.im x.re) y.re))
(exp (* (atan2 x.im x.re) (- y.im)))))
(t_1 (log (hypot x.im x.re)))
(t_2 (* t_1 y.im)))
(if (<= y.im -9.8e+118)
t_0
(if (<= y.im 4.5e-33)
(/
(*
(+ (* (pow t_1 2.0) (* (* y.im y.im) -0.5)) 1.0)
(pow (hypot x.im x.re) y.re))
(pow (exp y.im) (atan2 x.im x.re)))
(if (<= y.im 1.2e+142)
(*
(fma (- y.re) (* (sin t_2) (atan2 x.im x.re)) (cos t_2))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = t_1 * y_46_im;
double tmp;
if (y_46_im <= -9.8e+118) {
tmp = t_0;
} else if (y_46_im <= 4.5e-33) {
tmp = (((pow(t_1, 2.0) * ((y_46_im * y_46_im) * -0.5)) + 1.0) * pow(hypot(x_46_im, x_46_re), y_46_re)) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else if (y_46_im <= 1.2e+142) {
tmp = fma(-y_46_re, (sin(t_2) * atan2(x_46_im, x_46_re)), cos(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 = 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)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(t_1 * y_46_im) tmp = 0.0 if (y_46_im <= -9.8e+118) tmp = t_0; elseif (y_46_im <= 4.5e-33) tmp = Float64(Float64(Float64(Float64((t_1 ^ 2.0) * Float64(Float64(y_46_im * y_46_im) * -0.5)) + 1.0) * (hypot(x_46_im, x_46_re) ^ y_46_re)) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); elseif (y_46_im <= 1.2e+142) tmp = Float64(fma(Float64(-y_46_re), Float64(sin(t_2) * atan(x_46_im, x_46_re)), cos(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 = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -9.8e+118], t$95$0, If[LessEqual[y$46$im, 4.5e-33], N[(N[(N[(N[(N[Power[t$95$1, 2.0], $MachinePrecision] * N[(N[(y$46$im * y$46$im), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.2e+142], N[(N[((-y$46$re) * N[(N[Sin[t$95$2], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $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 e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := t\_1 \cdot y.im\\
\mathbf{if}\;y.im \leq -9.8 \cdot 10^{+118}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 4.5 \cdot 10^{-33}:\\
\;\;\;\;\frac{\left({t\_1}^{2} \cdot \left(\left(y.im \cdot y.im\right) \cdot -0.5\right) + 1\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.im \leq 1.2 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(-y.re, \sin t\_2 \cdot \tan^{-1}_* \frac{x.im}{x.re}, \cos 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}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -9.8000000000000006e118 or 1.2e142 < y.im Initial program 27.2%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.9
Applied rewrites46.9%
Taylor expanded in y.re around 0
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6458.3
Applied rewrites58.3%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-atan2.f6467.0
Applied rewrites67.0%
if -9.8000000000000006e118 < y.im < 4.49999999999999991e-33Initial program 47.6%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites85.5%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites87.6%
Taylor expanded in y.re around 0
Applied rewrites91.5%
if 4.49999999999999991e-33 < y.im < 1.2e142Initial program 36.3%
Taylor expanded in y.re around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites66.8%
Final simplification80.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(cos (* (atan2 x.im x.re) y.re))
(exp (* (atan2 x.im x.re) (- y.im)))))
(t_1 (log (hypot x.im x.re))))
(if (<= y.im -9.8e+118)
t_0
(if (<= y.im 4.5e-33)
(/
(*
(+ (* (pow t_1 2.0) (* (* y.im y.im) -0.5)) 1.0)
(pow (hypot x.im x.re) y.re))
(pow (exp y.im) (atan2 x.im x.re)))
(if (<= y.im 3.8e+103)
(*
(cos (* t_1 y.im))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -9.8e+118) {
tmp = t_0;
} else if (y_46_im <= 4.5e-33) {
tmp = (((pow(t_1, 2.0) * ((y_46_im * y_46_im) * -0.5)) + 1.0) * pow(hypot(x_46_im, x_46_re), y_46_re)) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else if (y_46_im <= 3.8e+103) {
tmp = cos((t_1 * y_46_im)) * 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;
}
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.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = Math.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -9.8e+118) {
tmp = t_0;
} else if (y_46_im <= 4.5e-33) {
tmp = (((Math.pow(t_1, 2.0) * ((y_46_im * y_46_im) * -0.5)) + 1.0) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else if (y_46_im <= 3.8e+103) {
tmp = Math.cos((t_1 * y_46_im)) * 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;
}
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.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) t_1 = math.log(math.hypot(x_46_im, x_46_re)) tmp = 0 if y_46_im <= -9.8e+118: tmp = t_0 elif y_46_im <= 4.5e-33: tmp = (((math.pow(t_1, 2.0) * ((y_46_im * y_46_im) * -0.5)) + 1.0) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) elif y_46_im <= 3.8e+103: tmp = math.cos((t_1 * y_46_im)) * 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 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)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) t_1 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -9.8e+118) tmp = t_0; elseif (y_46_im <= 4.5e-33) tmp = Float64(Float64(Float64(Float64((t_1 ^ 2.0) * Float64(Float64(y_46_im * y_46_im) * -0.5)) + 1.0) * (hypot(x_46_im, x_46_re) ^ y_46_re)) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); elseif (y_46_im <= 3.8e+103) tmp = Float64(cos(Float64(t_1 * y_46_im)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, 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)) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); t_1 = log(hypot(x_46_im, x_46_re)); tmp = 0.0; if (y_46_im <= -9.8e+118) tmp = t_0; elseif (y_46_im <= 4.5e-33) tmp = ((((t_1 ^ 2.0) * ((y_46_im * y_46_im) * -0.5)) + 1.0) * (hypot(x_46_im, x_46_re) ^ y_46_re)) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); elseif (y_46_im <= 3.8e+103) tmp = cos((t_1 * y_46_im)) * 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; 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $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, -9.8e+118], t$95$0, If[LessEqual[y$46$im, 4.5e-33], N[(N[(N[(N[(N[Power[t$95$1, 2.0], $MachinePrecision] * N[(N[(y$46$im * y$46$im), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.8e+103], N[(N[Cos[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $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 e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -9.8 \cdot 10^{+118}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 4.5 \cdot 10^{-33}:\\
\;\;\;\;\frac{\left({t\_1}^{2} \cdot \left(\left(y.im \cdot y.im\right) \cdot -0.5\right) + 1\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.im \leq 3.8 \cdot 10^{+103}:\\
\;\;\;\;\cos \left(t\_1 \cdot y.im\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}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -9.8000000000000006e118 or 3.7999999999999997e103 < y.im Initial program 27.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6445.4
Applied rewrites45.4%
Taylor expanded in y.re around 0
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6455.9
Applied rewrites55.9%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-atan2.f6465.1
Applied rewrites65.1%
if -9.8000000000000006e118 < y.im < 4.49999999999999991e-33Initial program 47.6%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites85.5%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites87.6%
Taylor expanded in y.re around 0
Applied rewrites91.5%
if 4.49999999999999991e-33 < y.im < 3.7999999999999997e103Initial program 38.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6469.4
Applied rewrites69.4%
Final simplification80.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re)))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -4.4e-10)
(* t_0 t_1)
(if (<= y.re 3.6e+14)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(* (cos (* (log (hypot x.im x.re)) y.im)) t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -4.4e-10) {
tmp = t_0 * t_1;
} else if (y_46_re <= 3.6e+14) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * 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 = 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)));
double tmp;
if (y_46_re <= -4.4e-10) {
tmp = t_0 * t_1;
} else if (y_46_re <= 3.6e+14) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * 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 = 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))) tmp = 0 if y_46_re <= -4.4e-10: tmp = t_0 * t_1 elif y_46_re <= 3.6e+14: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * 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 = 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))) tmp = 0.0 if (y_46_re <= -4.4e-10) tmp = Float64(t_0 * t_1); elseif (y_46_re <= 3.6e+14) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * 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 = 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))); tmp = 0.0; if (y_46_re <= -4.4e-10) tmp = t_0 * t_1; elseif (y_46_re <= 3.6e+14) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * 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[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]}, If[LessEqual[y$46$re, -4.4e-10], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 3.6e+14], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $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] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := 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{if}\;y.re \leq -4.4 \cdot 10^{-10}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{+14}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot t\_1\\
\end{array}
\end{array}
if y.re < -4.3999999999999998e-10Initial program 40.3%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6487.2
Applied rewrites87.2%
if -4.3999999999999998e-10 < y.re < 3.6e14Initial program 41.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6449.8
Applied rewrites49.8%
Taylor expanded in y.re around 0
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6474.7
Applied rewrites74.7%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-atan2.f6478.6
Applied rewrites78.6%
if 3.6e14 < y.re Initial program 38.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6467.2
Applied rewrites67.2%
Final simplification77.2%
(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
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))))
(if (<= y.re -4.4e-10)
t_1
(if (<= y.re 6.9)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 1.02e+197)
t_1
(*
(fma
(* y.re y.re)
(fma
(* (* y.re y.re) 0.041666666666666664)
(pow (atan2 x.im x.re) 4.0)
(* (pow (atan2 x.im x.re) 2.0) -0.5))
1.0)
1.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 t_1 = 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)));
double tmp;
if (y_46_re <= -4.4e-10) {
tmp = t_1;
} else if (y_46_re <= 6.9) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1.02e+197) {
tmp = t_1;
} else {
tmp = fma((y_46_re * y_46_re), fma(((y_46_re * y_46_re) * 0.041666666666666664), pow(atan2(x_46_im, x_46_re), 4.0), (pow(atan2(x_46_im, x_46_re), 2.0) * -0.5)), 1.0) * 1.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)) t_1 = 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)))) tmp = 0.0 if (y_46_re <= -4.4e-10) tmp = t_1; elseif (y_46_re <= 6.9) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 1.02e+197) tmp = t_1; else tmp = Float64(fma(Float64(y_46_re * y_46_re), fma(Float64(Float64(y_46_re * y_46_re) * 0.041666666666666664), (atan(x_46_im, x_46_re) ^ 4.0), Float64((atan(x_46_im, x_46_re) ^ 2.0) * -0.5)), 1.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[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[(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$re, -4.4e-10], t$95$1, If[LessEqual[y$46$re, 6.9], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.02e+197], t$95$1, N[(N[(N[(y$46$re * y$46$re), $MachinePrecision] * N[(N[(N[(y$46$re * y$46$re), $MachinePrecision] * 0.041666666666666664), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 4.0], $MachinePrecision] + N[(N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * 1.0), $MachinePrecision]]]]]]
\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^{\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{if}\;y.re \leq -4.4 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 6.9:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 1.02 \cdot 10^{+197}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y.re \cdot y.re, \mathsf{fma}\left(\left(y.re \cdot y.re\right) \cdot 0.041666666666666664, {\tan^{-1}_* \frac{x.im}{x.re}}^{4}, {\tan^{-1}_* \frac{x.im}{x.re}}^{2} \cdot -0.5\right), 1\right) \cdot 1\\
\end{array}
\end{array}
if y.re < -4.3999999999999998e-10 or 6.9000000000000004 < y.re < 1.02000000000000008e197Initial program 40.8%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6475.2
Applied rewrites75.2%
if -4.3999999999999998e-10 < y.re < 6.9000000000000004Initial program 42.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6450.2
Applied rewrites50.2%
Taylor expanded in y.re around 0
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6477.2
Applied rewrites77.2%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-atan2.f6479.4
Applied rewrites79.4%
if 1.02000000000000008e197 < y.re Initial program 26.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.f6438.5
Applied rewrites38.5%
Taylor expanded in y.re around 0
Applied rewrites1.6%
Taylor expanded in y.re around 0
Applied rewrites7.8%
Taylor expanded in y.re around 0
Applied rewrites73.2%
Final simplification76.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 (* t_0 (exp (* (atan2 x.im x.re) (- y.im))))))
(if (<= y.im -2.4e+25)
t_1
(if (<= y.im 2.7e+73) (* 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((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_im <= -2.4e+25) {
tmp = t_1;
} else if (y_46_im <= 2.7e+73) {
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((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_im <= -2.4e+25) {
tmp = t_1;
} else if (y_46_im <= 2.7e+73) {
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((math.atan2(x_46_im, x_46_re) * -y_46_im)) tmp = 0 if y_46_im <= -2.4e+25: tmp = t_1 elif y_46_im <= 2.7e+73: 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(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (y_46_im <= -2.4e+25) tmp = t_1; elseif (y_46_im <= 2.7e+73) 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((atan2(x_46_im, x_46_re) * -y_46_im)); tmp = 0.0; if (y_46_im <= -2.4e+25) tmp = t_1; elseif (y_46_im <= 2.7e+73) 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.4e+25], t$95$1, If[LessEqual[y$46$im, 2.7e+73], 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^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.im \leq -2.4 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 2.7 \cdot 10^{+73}:\\
\;\;\;\;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 < -2.39999999999999996e25 or 2.6999999999999999e73 < y.im Initial program 27.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6447.8
Applied rewrites47.8%
Taylor expanded in y.re around 0
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6453.6
Applied rewrites53.6%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-atan2.f6460.9
Applied rewrites60.9%
if -2.39999999999999996e25 < y.im < 2.6999999999999999e73Initial program 48.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.f6484.8
Applied rewrites84.8%
Final simplification74.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 -1.65e+42)
(* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) t_0)
(if (<= y.im 7.2e+73)
(* t_0 (pow (hypot x.im x.re) y.re))
(* (exp (* (atan2 x.im x.re) (- y.im))) (cos (* (log 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 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= -1.65e+42) {
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_im <= 7.2e+73) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * cos((log(x_46_im) * y_46_im));
}
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.65e+42) 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_im <= 7.2e+73) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * cos(Float64(log(x_46_im) * 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[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.65e+42], 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$im, 7.2e+73], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[Log[x$46$im], $MachinePrecision] * y$46$im), $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 -1.65 \cdot 10^{+42}:\\
\;\;\;\;{\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.im \leq 7.2 \cdot 10^{+73}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \cos \left(\log x.im \cdot y.im\right)\\
\end{array}
\end{array}
if y.im < -1.6499999999999999e42Initial program 28.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.f6427.8
Applied rewrites27.8%
Taylor expanded in x.im around 0
Applied rewrites41.2%
if -1.6499999999999999e42 < y.im < 7.1999999999999998e73Initial program 49.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.f6483.4
Applied rewrites83.4%
if 7.1999999999999998e73 < y.im Initial program 23.9%
Taylor expanded in x.im around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites35.8%
Taylor expanded in y.re around 0
Applied rewrites35.9%
Final simplification65.7%
(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.65e+42)
(* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) t_0)
(if (<= y.im 7.2e+73)
(* t_0 (pow (hypot x.im x.re) y.re))
(*
(*
(pow (atan2 x.im x.re) 6.0)
(* (pow y.re 6.0) -0.001388888888888889))
1.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.65e+42) {
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_im <= 7.2e+73) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = (pow(atan2(x_46_im, x_46_re), 6.0) * (pow(y_46_re, 6.0) * -0.001388888888888889)) * 1.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.65e+42) 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_im <= 7.2e+73) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(Float64((atan(x_46_im, x_46_re) ^ 6.0) * Float64((y_46_re ^ 6.0) * -0.001388888888888889)) * 1.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.65e+42], 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$im, 7.2e+73], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 6.0], $MachinePrecision] * N[(N[Power[y$46$re, 6.0], $MachinePrecision] * -0.001388888888888889), $MachinePrecision]), $MachinePrecision] * 1.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.65 \cdot 10^{+42}:\\
\;\;\;\;{\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.im \leq 7.2 \cdot 10^{+73}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\left({\tan^{-1}_* \frac{x.im}{x.re}}^{6} \cdot \left({y.re}^{6} \cdot -0.001388888888888889\right)\right) \cdot 1\\
\end{array}
\end{array}
if y.im < -1.6499999999999999e42Initial program 28.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.f6427.8
Applied rewrites27.8%
Taylor expanded in x.im around 0
Applied rewrites41.2%
if -1.6499999999999999e42 < y.im < 7.1999999999999998e73Initial program 49.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.f6483.4
Applied rewrites83.4%
if 7.1999999999999998e73 < y.im Initial program 23.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.f6413.3
Applied rewrites13.3%
Taylor expanded in y.re around 0
Applied rewrites2.3%
Taylor expanded in y.re around 0
Applied rewrites11.6%
Taylor expanded in y.re around inf
Applied rewrites26.8%
Final simplification63.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))) (t_1 (/ (* x.im x.im) x.re)))
(if (<= x.re -3.1e-49)
(* (pow (* (fma (/ 0.5 x.re) t_1 1.0) (- x.re)) y.re) t_0)
(if (<= x.re -1.25e-244)
(* (pow x.im y.re) t_0)
(if (<= x.re 1.05e-45)
(* (pow (fma t_1 0.5 x.re) 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 t_1 = (x_46_im * x_46_im) / x_46_re;
double tmp;
if (x_46_re <= -3.1e-49) {
tmp = pow((fma((0.5 / x_46_re), t_1, 1.0) * -x_46_re), y_46_re) * t_0;
} else if (x_46_re <= -1.25e-244) {
tmp = pow(x_46_im, y_46_re) * t_0;
} else if (x_46_re <= 1.05e-45) {
tmp = pow(fma(t_1, 0.5, x_46_re), y_46_re) * t_0;
} else {
tmp = 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)) t_1 = Float64(Float64(x_46_im * x_46_im) / x_46_re) tmp = 0.0 if (x_46_re <= -3.1e-49) tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), t_1, 1.0) * Float64(-x_46_re)) ^ y_46_re) * t_0); elseif (x_46_re <= -1.25e-244) tmp = Float64((x_46_im ^ y_46_re) * t_0); elseif (x_46_re <= 1.05e-45) tmp = Float64((fma(t_1, 0.5, x_46_re) ^ y_46_re) * t_0); else tmp = Float64((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]}, Block[{t$95$1 = N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]}, If[LessEqual[x$46$re, -3.1e-49], N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision] * (-x$46$re)), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$re, -1.25e-244], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$re, 1.05e-45], N[(N[Power[N[(t$95$1 * 0.5 + x$46$re), $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)\\
t_1 := \frac{x.im \cdot x.im}{x.re}\\
\mathbf{if}\;x.re \leq -3.1 \cdot 10^{-49}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, t\_1, 1\right) \cdot \left(-x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.re \leq -1.25 \cdot 10^{-244}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.re \leq 1.05 \cdot 10^{-45}:\\
\;\;\;\;{\left(\mathsf{fma}\left(t\_1, 0.5, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < -3.1e-49Initial 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.f6458.7
Applied rewrites58.7%
Taylor expanded in x.re around -inf
Applied rewrites58.6%
if -3.1e-49 < x.re < -1.24999999999999999e-244Initial program 60.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.f6463.6
Applied rewrites63.6%
Taylor expanded in x.re around 0
Applied rewrites60.6%
if -1.24999999999999999e-244 < x.re < 1.04999999999999998e-45Initial 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.f6449.5
Applied rewrites49.5%
Taylor expanded in x.im around 0
Applied rewrites53.9%
if 1.04999999999999998e-45 < x.re Initial program 34.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.f6465.7
Applied rewrites65.7%
Taylor expanded in x.im around 0
Applied rewrites65.7%
Final simplification59.5%
(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 -6e-49)
(* (pow (- x.re) y.re) t_0)
(if (<= x.re -1.25e-244)
(* (pow x.im y.re) t_0)
(if (<= x.re 1.05e-45)
(* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) 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 <= -6e-49) {
tmp = pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= -1.25e-244) {
tmp = pow(x_46_im, y_46_re) * t_0;
} else if (x_46_re <= 1.05e-45) {
tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * t_0;
} else {
tmp = 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 <= -6e-49) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * t_0); elseif (x_46_re <= -1.25e-244) tmp = Float64((x_46_im ^ y_46_re) * t_0); elseif (x_46_re <= 1.05e-45) 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((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, -6e-49], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$re, -1.25e-244], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$re, 1.05e-45], 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[(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 -6 \cdot 10^{-49}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.re \leq -1.25 \cdot 10^{-244}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.re \leq 1.05 \cdot 10^{-45}:\\
\;\;\;\;{\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}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < -6e-49Initial 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.f6458.7
Applied rewrites58.7%
Taylor expanded in x.im around inf
Applied rewrites46.0%
Taylor expanded in x.re around -inf
Applied rewrites57.4%
if -6e-49 < x.re < -1.24999999999999999e-244Initial program 60.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.f6463.6
Applied rewrites63.6%
Taylor expanded in x.re around 0
Applied rewrites60.6%
if -1.24999999999999999e-244 < x.re < 1.04999999999999998e-45Initial 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.f6449.5
Applied rewrites49.5%
Taylor expanded in x.im around 0
Applied rewrites53.9%
if 1.04999999999999998e-45 < x.re Initial program 34.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.f6465.7
Applied rewrites65.7%
Taylor expanded in x.im around 0
Applied rewrites65.7%
(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 -6e-49)
(* (pow (- x.re) y.re) t_0)
(if (<= x.re 2.25e-94) (* (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 <= -6e-49) {
tmp = pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= 2.25e-94) {
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 <= (-6d-49)) then
tmp = (-x_46re ** y_46re) * t_0
else if (x_46re <= 2.25d-94) 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 <= -6e-49) {
tmp = Math.pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= 2.25e-94) {
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 <= -6e-49: tmp = math.pow(-x_46_re, y_46_re) * t_0 elif x_46_re <= 2.25e-94: 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 <= -6e-49) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * t_0); elseif (x_46_re <= 2.25e-94) 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 <= -6e-49) tmp = (-x_46_re ^ y_46_re) * t_0; elseif (x_46_re <= 2.25e-94) 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, -6e-49], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$re, 2.25e-94], 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 -6 \cdot 10^{-49}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.re \leq 2.25 \cdot 10^{-94}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < -6e-49Initial 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.f6458.7
Applied rewrites58.7%
Taylor expanded in x.im around inf
Applied rewrites46.0%
Taylor expanded in x.re around -inf
Applied rewrites57.4%
if -6e-49 < x.re < 2.2500000000000001e-94Initial program 46.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.f6454.9
Applied rewrites54.9%
Taylor expanded in x.re around 0
Applied rewrites48.0%
if 2.2500000000000001e-94 < x.re Initial program 37.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.f6462.8
Applied rewrites62.8%
Taylor expanded in x.im around 0
Applied rewrites62.8%
(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 -3e-11)
(* (pow (- x.im) y.re) t_0)
(if (<= x.im 2.9e-172) (* (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 <= -3e-11) {
tmp = pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 2.9e-172) {
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 <= (-3d-11)) then
tmp = (-x_46im ** y_46re) * t_0
else if (x_46im <= 2.9d-172) 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 <= -3e-11) {
tmp = Math.pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 2.9e-172) {
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 <= -3e-11: tmp = math.pow(-x_46_im, y_46_re) * t_0 elif x_46_im <= 2.9e-172: 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 <= -3e-11) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * t_0); elseif (x_46_im <= 2.9e-172) 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 <= -3e-11) tmp = (-x_46_im ^ y_46_re) * t_0; elseif (x_46_im <= 2.9e-172) 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, -3e-11], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 2.9e-172], 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 \cdot 10^{-11}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.im \leq 2.9 \cdot 10^{-172}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -3e-11Initial program 31.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.f6456.4
Applied rewrites56.4%
Taylor expanded in x.im around -inf
Applied rewrites55.8%
if -3e-11 < x.im < 2.89999999999999997e-172Initial program 47.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.f6467.3
Applied rewrites67.3%
Taylor expanded in x.im around 0
Applied rewrites55.8%
if 2.89999999999999997e-172 < x.im Initial program 39.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.f6452.7
Applied rewrites52.7%
Taylor expanded in x.re around 0
Applied rewrites50.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 -5.4e+22)
t_0
(if (<= y.re 2.5e-5) (+ (* (log (hypot x.im x.re)) y.re) 1.0) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(x_46_im, y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -5.4e+22) {
tmp = t_0;
} else if (y_46_re <= 2.5e-5) {
tmp = (log(hypot(x_46_im, x_46_re)) * y_46_re) + 1.0;
} 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.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 <= -5.4e+22) {
tmp = t_0;
} else if (y_46_re <= 2.5e-5) {
tmp = (Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_re) + 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 <= -5.4e+22: tmp = t_0 elif y_46_re <= 2.5e-5: tmp = (math.log(math.hypot(x_46_im, x_46_re)) * y_46_re) + 1.0 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((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 <= -5.4e+22) tmp = t_0; elseif (y_46_re <= 2.5e-5) tmp = Float64(Float64(log(hypot(x_46_im, x_46_re)) * y_46_re) + 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 <= -5.4e+22) tmp = t_0; elseif (y_46_re <= 2.5e-5) tmp = (log(hypot(x_46_im, x_46_re)) * y_46_re) + 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, -5.4e+22], t$95$0, If[LessEqual[y$46$re, 2.5e-5], N[(N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] + 1.0), $MachinePrecision], 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 -5.4 \cdot 10^{+22}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-5}:\\
\;\;\;\;\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.re + 1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -5.4000000000000004e22 or 2.50000000000000012e-5 < y.re Initial program 37.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.f6464.1
Applied rewrites64.1%
Taylor expanded in x.re around 0
Applied rewrites48.4%
if -5.4000000000000004e22 < y.re < 2.50000000000000012e-5Initial program 43.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.f6451.5
Applied rewrites51.5%
Taylor expanded in y.re around 0
Applied rewrites48.1%
Taylor expanded in y.re around 0
Applied rewrites48.7%
Final simplification48.5%
(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.25e-94) (* (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.25e-94) {
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.25d-94) 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.25e-94) {
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.25e-94: 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.25e-94) 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.25e-94) 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.25e-94], 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.25 \cdot 10^{-94}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < 2.2500000000000001e-94Initial 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.f6456.5
Applied rewrites56.5%
Taylor expanded in x.re around 0
Applied rewrites44.2%
if 2.2500000000000001e-94 < x.re Initial program 37.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.f6462.8
Applied rewrites62.8%
Taylor expanded in x.im around 0
Applied rewrites62.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (fma (* (* y.re y.re) -0.5) (pow (atan2 x.im x.re) 2.0) 1.0) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return fma(((y_46_re * y_46_re) * -0.5), pow(atan2(x_46_im, x_46_re), 2.0), 1.0) * 1.0;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 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) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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]
\begin{array}{l}
\\
\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
\end{array}
Initial program 39.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.f6458.6
Applied rewrites58.6%
Taylor expanded in y.re around 0
Applied rewrites22.5%
Taylor expanded in y.re around 0
Applied rewrites28.3%
Taylor expanded in y.re around 0
Applied rewrites25.8%
Final simplification25.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ (* (log (hypot x.im x.re)) y.re) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (log(hypot(x_46_im, x_46_re)) * y_46_re) + 1.0;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_re) + 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return (math.log(math.hypot(x_46_im, x_46_re)) * y_46_re) + 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(log(hypot(x_46_im, x_46_re)) * y_46_re) + 1.0) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = (log(hypot(x_46_im, x_46_re)) * y_46_re) + 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] + 1.0), $MachinePrecision]
\begin{array}{l}
\\
\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.re + 1
\end{array}
Initial program 39.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.f6458.6
Applied rewrites58.6%
Taylor expanded in y.re around 0
Applied rewrites22.5%
Taylor expanded in y.re around 0
Applied rewrites23.3%
Final simplification23.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 39.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.f6458.6
Applied rewrites58.6%
Taylor expanded in y.re around 0
Applied rewrites22.5%
Taylor expanded in y.re around 0
Applied rewrites22.7%
herbie shell --seed 2024284
(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)))))