
(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 19 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))))
(*
(cos (* t_0 y.im))
(exp (* (- y.re) (fma y.im (/ (atan2 x.im 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 = log(hypot(x_46_im, x_46_re));
return cos((t_0 * y_46_im)) * exp((-y_46_re * fma(y_46_im, (atan2(x_46_im, x_46_re) / y_46_re), -t_0)));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) return Float64(cos(Float64(t_0 * y_46_im)) * exp(Float64(Float64(-y_46_re) * fma(y_46_im, Float64(atan(x_46_im, x_46_re) / y_46_re), Float64(-t_0))))) 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]}, N[(N[Cos[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$re) * N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision] + (-t$95$0)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\cos \left(t\_0 \cdot y.im\right) \cdot e^{\left(-y.re\right) \cdot \mathsf{fma}\left(y.im, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}, -t\_0\right)}
\end{array}
\end{array}
Initial program 40.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6467.0
Applied rewrites67.0%
Taylor expanded in y.re around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.4%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (log (hypot x.im x.re)) 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_0)))
(if (<= y.re -8.2e-8)
t_1
(if (<= y.re 4.4e-34) (* t_0 (exp (* (- y.im) (atan2 x.im x.re)))) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
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))) * t_0;
double tmp;
if (y_46_re <= -8.2e-8) {
tmp = t_1;
} else if (y_46_re <= 4.4e-34) {
tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_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.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
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))) * t_0;
double tmp;
if (y_46_re <= -8.2e-8) {
tmp = t_1;
} else if (y_46_re <= 4.4e-34) {
tmp = t_0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_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.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) 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))) * t_0 tmp = 0 if y_46_re <= -8.2e-8: tmp = t_1 elif y_46_re <= 4.4e-34: tmp = t_0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) t_1 = 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))) * t_0) tmp = 0.0 if (y_46_re <= -8.2e-8) tmp = t_1; elseif (y_46_re <= 4.4e-34) tmp = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_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((log(hypot(x_46_im, x_46_re)) * 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))) * t_0; tmp = 0.0; if (y_46_re <= -8.2e-8) tmp = t_1; elseif (y_46_re <= 4.4e-34) tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -8.2e-8], t$95$1, If[LessEqual[y$46$re, 4.4e-34], N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\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} \cdot t\_0\\
\mathbf{if}\;y.re \leq -8.2 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 4.4 \cdot 10^{-34}:\\
\;\;\;\;t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -8.20000000000000063e-8 or 4.3999999999999998e-34 < y.re Initial program 43.9%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6484.2
Applied rewrites84.2%
if -8.20000000000000063e-8 < y.re < 4.3999999999999998e-34Initial program 35.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.0
Applied rewrites80.0%
Final simplification82.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (cos (* t_0 y.im)))
(t_2 (* (exp (* t_0 y.re)) t_1)))
(if (<= y.re -1.35)
t_2
(if (<= y.re 4.4e-34)
(* t_1 (exp (* (- y.im) (atan2 x.im x.re))))
(if (<= y.re 6.2e+33)
(*
(cos (* (atan2 x.im x.re) y.re))
(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 = log(hypot(x_46_im, x_46_re));
double t_1 = cos((t_0 * y_46_im));
double t_2 = exp((t_0 * y_46_re)) * t_1;
double tmp;
if (y_46_re <= -1.35) {
tmp = t_2;
} else if (y_46_re <= 4.4e-34) {
tmp = t_1 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 6.2e+33) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_1 = Math.cos((t_0 * y_46_im));
double t_2 = Math.exp((t_0 * y_46_re)) * t_1;
double tmp;
if (y_46_re <= -1.35) {
tmp = t_2;
} else if (y_46_re <= 4.4e-34) {
tmp = t_1 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 6.2e+33) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_im, x_46_re)) t_1 = math.cos((t_0 * y_46_im)) t_2 = math.exp((t_0 * y_46_re)) * t_1 tmp = 0 if y_46_re <= -1.35: tmp = t_2 elif y_46_re <= 4.4e-34: tmp = t_1 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 6.2e+33: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (math.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 = log(hypot(x_46_im, x_46_re)) t_1 = cos(Float64(t_0 * y_46_im)) t_2 = Float64(exp(Float64(t_0 * y_46_re)) * t_1) tmp = 0.0 if (y_46_re <= -1.35) tmp = t_2; elseif (y_46_re <= 4.4e-34) tmp = Float64(t_1 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 6.2e+33) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)); t_1 = cos((t_0 * y_46_im)); t_2 = exp((t_0 * y_46_re)) * t_1; tmp = 0.0; if (y_46_re <= -1.35) tmp = t_2; elseif (y_46_re <= 4.4e-34) tmp = t_1 * exp((-y_46_im * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 6.2e+33) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); else tmp = t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(t$95$0 * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -1.35], t$95$2, If[LessEqual[y$46$re, 4.4e-34], N[(t$95$1 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.2e+33], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(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 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \cos \left(t\_0 \cdot y.im\right)\\
t_2 := e^{t\_0 \cdot y.re} \cdot t\_1\\
\mathbf{if}\;y.re \leq -1.35:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 4.4 \cdot 10^{-34}:\\
\;\;\;\;t\_1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{+33}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -1.3500000000000001 or 6.2e33 < y.re Initial program 37.7%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6436.1
Applied rewrites36.1%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.7
Applied rewrites83.7%
if -1.3500000000000001 < y.re < 4.3999999999999998e-34Initial program 36.1%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6479.0
Applied rewrites79.0%
if 4.3999999999999998e-34 < y.re < 6.2e33Initial program 92.7%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6499.9
Applied rewrites99.9%
Final simplification82.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(cos (* (atan2 x.im x.re) y.re))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))))
(if (<= y.re -8.2e-8)
t_0
(if (<= y.re 4.4e-34)
(*
(cos (* (log (hypot x.im x.re)) y.im))
(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 = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -8.2e-8) {
tmp = t_0;
} else if (y_46_re <= 4.4e-34) {
tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_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.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 <= -8.2e-8) {
tmp = t_0;
} else if (y_46_re <= 4.4e-34) {
tmp = Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} 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.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 <= -8.2e-8: tmp = t_0 elif y_46_re <= 4.4e-34: tmp = math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) 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(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 <= -8.2e-8) tmp = t_0; elseif (y_46_re <= 4.4e-34) tmp = Float64(cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = t_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(((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 <= -8.2e-8) tmp = t_0; elseif (y_46_re <= 4.4e-34) tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = t_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[(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, -8.2e-8], t$95$0, If[LessEqual[y$46$re, 4.4e-34], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -8.2 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4.4 \cdot 10^{-34}:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -8.20000000000000063e-8 or 4.3999999999999998e-34 < y.re Initial program 43.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6477.7
Applied rewrites77.7%
if -8.20000000000000063e-8 < y.re < 4.3999999999999998e-34Initial program 35.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.0
Applied rewrites80.0%
Final simplification78.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(pow (pow (hypot x.re x.im) 4.0) (* 0.25 y.re))
(cos (* (atan2 x.im x.re) y.re)))))
(if (<= y.re -9.8e-8)
t_0
(if (<= y.re 1.9)
(*
(cos (* (log (hypot x.im x.re)) y.im))
(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 = pow(pow(hypot(x_46_re, x_46_im), 4.0), (0.25 * y_46_re)) * cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -9.8e-8) {
tmp = t_0;
} else if (y_46_re <= 1.9) {
tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.pow(Math.hypot(x_46_re, x_46_im), 4.0), (0.25 * y_46_re)) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -9.8e-8) {
tmp = t_0;
} else if (y_46_re <= 1.9) {
tmp = Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.pow(math.hypot(x_46_re, x_46_im), 4.0), (0.25 * y_46_re)) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -9.8e-8: tmp = t_0 elif y_46_re <= 1.9: tmp = math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(((hypot(x_46_re, x_46_im) ^ 4.0) ^ Float64(0.25 * y_46_re)) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))) tmp = 0.0 if (y_46_re <= -9.8e-8) tmp = t_0; elseif (y_46_re <= 1.9) tmp = Float64(cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((hypot(x_46_re, x_46_im) ^ 4.0) ^ (0.25 * y_46_re)) * cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -9.8e-8) tmp = t_0; elseif (y_46_re <= 1.9) tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = t_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[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], 4.0], $MachinePrecision], N[(0.25 * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9.8e-8], t$95$0, If[LessEqual[y$46$re, 1.9], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{4}\right)}^{\left(0.25 \cdot y.re\right)} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -9.8 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.9:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -9.8000000000000004e-8 or 1.8999999999999999 < y.re Initial program 40.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6473.4
Applied rewrites73.4%
Applied rewrites73.4%
Applied rewrites74.1%
if -9.8000000000000004e-8 < y.re < 1.8999999999999999Initial program 39.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.7
Applied rewrites80.7%
Final simplification77.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (pow (hypot x.im x.re) y.re) (cos (* (atan2 x.im x.re) y.re)))))
(if (<= y.re -0.55)
t_0
(if (<= y.re 2.8e-5)
(*
(cos (* (log (hypot x.im x.re)) y.im))
(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 = pow(hypot(x_46_im, x_46_re), y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -0.55) {
tmp = t_0;
} else if (y_46_re <= 2.8e-5) {
tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -0.55) {
tmp = t_0;
} else if (y_46_re <= 2.8e-5) {
tmp = Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -0.55: tmp = t_0 elif y_46_re <= 2.8e-5: tmp = math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))) tmp = 0.0 if (y_46_re <= -0.55) tmp = t_0; elseif (y_46_re <= 2.8e-5) tmp = Float64(cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -0.55) tmp = t_0; elseif (y_46_re <= 2.8e-5) tmp = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = t_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[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.55], t$95$0, If[LessEqual[y$46$re, 2.8e-5], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -0.55:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-5}:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.55000000000000004 or 2.79999999999999996e-5 < y.re 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.f6474.3
Applied rewrites74.3%
if -0.55000000000000004 < y.re < 2.79999999999999996e-5Initial program 40.1%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6479.7
Applied rewrites79.7%
Final simplification77.0%
(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
(pow (* (fma (/ (* x.im x.im) x.re) (/ 0.5 x.re) 1.0) x.re) 2.0)
(* 0.5 y.re))
t_0)))
(if (<= y.im -1e+46)
t_1
(if (<= y.im 6.6e+85) (* (pow (hypot x.im x.re) y.re) t_0) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = pow(pow((fma(((x_46_im * x_46_im) / x_46_re), (0.5 / x_46_re), 1.0) * x_46_re), 2.0), (0.5 * y_46_re)) * t_0;
double tmp;
if (y_46_im <= -1e+46) {
tmp = t_1;
} else if (y_46_im <= 6.6e+85) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_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(((Float64(fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), Float64(0.5 / x_46_re), 1.0) * x_46_re) ^ 2.0) ^ Float64(0.5 * y_46_re)) * t_0) tmp = 0.0 if (y_46_im <= -1e+46) tmp = t_1; elseif (y_46_im <= 6.6e+85) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_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[N[Power[N[(N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * N[(0.5 / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], 2.0], $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$im, -1e+46], t$95$1, If[LessEqual[y$46$im, 6.6e+85], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$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 := {\left({\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, \frac{0.5}{x.re}, 1\right) \cdot x.re\right)}^{2}\right)}^{\left(0.5 \cdot y.re\right)} \cdot t\_0\\
\mathbf{if}\;y.im \leq -1 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 6.6 \cdot 10^{+85}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -9.9999999999999999e45 or 6.5999999999999998e85 < y.im Initial program 36.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.f6432.8
Applied rewrites32.8%
Taylor expanded in x.re around inf
Applied rewrites34.1%
Applied rewrites42.1%
if -9.9999999999999999e45 < y.im < 6.5999999999999998e85Initial 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.f6481.6
Applied rewrites81.6%
Final simplification65.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (pow (hypot x.im x.re) y.re) (cos (* (atan2 x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(hypot(x_46_im, x_46_re), y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
Initial program 40.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%
(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 -4.8e-13)
(* (pow (- x.im) y.re) t_0)
(if (<= x.im 1.0)
(* (sqrt (pow (* x.re 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 <= -4.8e-13) {
tmp = pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 1.0) {
tmp = sqrt(pow((x_46_re * 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 <= (-4.8d-13)) then
tmp = (-x_46im ** y_46re) * t_0
else if (x_46im <= 1.0d0) then
tmp = sqrt(((x_46re * 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 <= -4.8e-13) {
tmp = Math.pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 1.0) {
tmp = Math.sqrt(Math.pow((x_46_re * 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 <= -4.8e-13: tmp = math.pow(-x_46_im, y_46_re) * t_0 elif x_46_im <= 1.0: tmp = math.sqrt(math.pow((x_46_re * 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 <= -4.8e-13) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * t_0); elseif (x_46_im <= 1.0) tmp = Float64(sqrt((Float64(x_46_re * 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 <= -4.8e-13) tmp = (-x_46_im ^ y_46_re) * t_0; elseif (x_46_im <= 1.0) tmp = sqrt(((x_46_re * 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, -4.8e-13], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 1.0], N[(N[Sqrt[N[Power[N[(x$46$re * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]], $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 -4.8 \cdot 10^{-13}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.im \leq 1:\\
\;\;\;\;\sqrt{{\left(x.re \cdot x.re\right)}^{y.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -4.7999999999999997e-13Initial program 30.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.f6470.1
Applied rewrites70.1%
Taylor expanded in x.re around inf
Applied rewrites47.4%
Taylor expanded in x.im around -inf
Applied rewrites70.1%
if -4.7999999999999997e-13 < x.im < 1Initial program 51.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.f6460.5
Applied rewrites60.5%
Applied rewrites56.6%
Taylor expanded in x.im around 0
Applied rewrites57.3%
if 1 < x.im Initial program 26.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.f6456.4
Applied rewrites56.4%
Taylor expanded in x.re around 0
Applied rewrites56.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 -9.1e-38)
(* (pow (- x.re) y.re) t_0)
(if (<= x.re 1.22e-238)
(* (sqrt (pow (* x.im 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 <= -9.1e-38) {
tmp = pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= 1.22e-238) {
tmp = sqrt(pow((x_46_im * 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 <= (-9.1d-38)) then
tmp = (-x_46re ** y_46re) * t_0
else if (x_46re <= 1.22d-238) then
tmp = sqrt(((x_46im * 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 <= -9.1e-38) {
tmp = Math.pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= 1.22e-238) {
tmp = Math.sqrt(Math.pow((x_46_im * 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 <= -9.1e-38: tmp = math.pow(-x_46_re, y_46_re) * t_0 elif x_46_re <= 1.22e-238: tmp = math.sqrt(math.pow((x_46_im * 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 <= -9.1e-38) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * t_0); elseif (x_46_re <= 1.22e-238) tmp = Float64(sqrt((Float64(x_46_im * 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 <= -9.1e-38) tmp = (-x_46_re ^ y_46_re) * t_0; elseif (x_46_re <= 1.22e-238) tmp = sqrt(((x_46_im * 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, -9.1e-38], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$re, 1.22e-238], N[(N[Sqrt[N[Power[N[(x$46$im * x$46$im), $MachinePrecision], 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 -9.1 \cdot 10^{-38}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.re \leq 1.22 \cdot 10^{-238}:\\
\;\;\;\;\sqrt{{\left(x.im \cdot x.im\right)}^{y.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < -9.10000000000000012e-38Initial program 26.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.f6457.6
Applied rewrites57.6%
Taylor expanded in x.re around -inf
Applied rewrites57.6%
if -9.10000000000000012e-38 < x.re < 1.22e-238Initial program 50.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.f6465.2
Applied rewrites65.2%
Applied rewrites59.3%
Taylor expanded in x.re around 0
Applied rewrites57.9%
if 1.22e-238 < x.re Initial program 44.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.5
Applied rewrites63.5%
Taylor expanded in x.im around 0
Applied rewrites58.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.re -4.2e-83)
(* (pow (- x.re) y.re) t_0)
(if (<= x.re -1.35e-302)
(* (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 <= -4.2e-83) {
tmp = pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= -1.35e-302) {
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 <= (-4.2d-83)) then
tmp = (-x_46re ** y_46re) * t_0
else if (x_46re <= (-1.35d-302)) 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 <= -4.2e-83) {
tmp = Math.pow(-x_46_re, y_46_re) * t_0;
} else if (x_46_re <= -1.35e-302) {
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 <= -4.2e-83: tmp = math.pow(-x_46_re, y_46_re) * t_0 elif x_46_re <= -1.35e-302: 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 <= -4.2e-83) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * t_0); elseif (x_46_re <= -1.35e-302) tmp = Float64((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 <= -4.2e-83) tmp = (-x_46_re ^ y_46_re) * t_0; elseif (x_46_re <= -1.35e-302) 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, -4.2e-83], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$re, -1.35e-302], 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 -4.2 \cdot 10^{-83}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.re \leq -1.35 \cdot 10^{-302}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < -4.1999999999999998e-83Initial program 29.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6458.9
Applied rewrites58.9%
Taylor expanded in x.re around -inf
Applied rewrites57.9%
if -4.1999999999999998e-83 < x.re < -1.35000000000000003e-302Initial program 54.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.f6463.7
Applied rewrites63.7%
Taylor expanded in x.re around inf
Applied rewrites37.9%
Taylor expanded in x.im around -inf
Applied rewrites52.6%
if -1.35000000000000003e-302 < x.re Initial program 43.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.f6463.8
Applied rewrites63.8%
Taylor expanded in x.im around 0
Applied rewrites58.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.im -2.8e-46)
(* (pow (- x.im) y.re) t_0)
(if (<= x.im 3.9e-163) (* (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 <= -2.8e-46) {
tmp = pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 3.9e-163) {
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 <= (-2.8d-46)) then
tmp = (-x_46im ** y_46re) * t_0
else if (x_46im <= 3.9d-163) 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 <= -2.8e-46) {
tmp = Math.pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 3.9e-163) {
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 <= -2.8e-46: tmp = math.pow(-x_46_im, y_46_re) * t_0 elif x_46_im <= 3.9e-163: 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 <= -2.8e-46) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * t_0); elseif (x_46_im <= 3.9e-163) 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 <= -2.8e-46) tmp = (-x_46_im ^ y_46_re) * t_0; elseif (x_46_im <= 3.9e-163) 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, -2.8e-46], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 3.9e-163], 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 -2.8 \cdot 10^{-46}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.im \leq 3.9 \cdot 10^{-163}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -2.7999999999999998e-46Initial program 36.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.f6467.9
Applied rewrites67.9%
Taylor expanded in x.re around inf
Applied rewrites45.5%
Taylor expanded in x.im around -inf
Applied rewrites66.6%
if -2.7999999999999998e-46 < x.im < 3.9000000000000002e-163Initial program 46.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.f6462.4
Applied rewrites62.4%
Taylor expanded in x.im around 0
Applied rewrites51.4%
if 3.9000000000000002e-163 < x.im Initial program 36.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.4
Applied rewrites56.4%
Taylor expanded in x.re around 0
Applied rewrites52.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.re -0.00052)
(* (pow x.re y.re) t_0)
(if (<= y.re 5.5e-12)
(fma (log (hypot x.im x.re)) y.re 1.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 (y_46_re <= -0.00052) {
tmp = pow(x_46_re, y_46_re) * t_0;
} else if (y_46_re <= 5.5e-12) {
tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0);
} else {
tmp = 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 (y_46_re <= -0.00052) tmp = Float64((x_46_re ^ y_46_re) * t_0); elseif (y_46_re <= 5.5e-12) tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0); else tmp = Float64((x_46_im ^ y_46_re) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.00052], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 5.5e-12], N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + 1.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}\;y.re \leq -0.00052:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 5.5 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -5.19999999999999954e-4Initial program 35.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.f6482.3
Applied rewrites82.3%
Taylor expanded in x.im around 0
Applied rewrites64.8%
if -5.19999999999999954e-4 < y.re < 5.5000000000000004e-12Initial program 37.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.9
Applied rewrites49.9%
Taylor expanded in y.re around 0
Applied rewrites49.9%
if 5.5000000000000004e-12 < y.re Initial program 50.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.f6461.8
Applied rewrites61.8%
Taylor expanded in x.re around 0
Applied rewrites52.1%
(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 -310000000.0)
t_0
(if (<= y.re 5.5e-12) (fma (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 <= -310000000.0) {
tmp = t_0;
} else if (y_46_re <= 5.5e-12) {
tmp = fma(log(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 <= -310000000.0) tmp = t_0; elseif (y_46_re <= 5.5e-12) tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[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, -310000000.0], t$95$0, If[LessEqual[y$46$re, 5.5e-12], N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + 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 -310000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5.5 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -3.1e8 or 5.5000000000000004e-12 < 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.f6473.5
Applied rewrites73.5%
Taylor expanded in x.re around 0
Applied rewrites53.6%
if -3.1e8 < y.re < 5.5000000000000004e-12Initial program 37.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.4
Applied rewrites50.4%
Taylor expanded in y.re around 0
Applied rewrites48.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -4.4e+110)
(+
(fma
(- y.re)
(log (/ -1.0 x.re))
(* (/ (* (* x.im x.im) y.re) x.re) (/ 0.5 x.re)))
1.0)
(if (<= y.im 11000.0)
(fma (log (hypot x.im x.re)) y.re 1.0)
(fma
(fma 0.5 (* (/ x.re x.im) (/ x.re x.im)) (- (log (/ -1.0 x.im))))
y.re
1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -4.4e+110) {
tmp = fma(-y_46_re, log((-1.0 / x_46_re)), ((((x_46_im * x_46_im) * y_46_re) / x_46_re) * (0.5 / x_46_re))) + 1.0;
} else if (y_46_im <= 11000.0) {
tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0);
} else {
tmp = fma(fma(0.5, ((x_46_re / x_46_im) * (x_46_re / x_46_im)), -log((-1.0 / x_46_im))), y_46_re, 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -4.4e+110) tmp = Float64(fma(Float64(-y_46_re), log(Float64(-1.0 / x_46_re)), Float64(Float64(Float64(Float64(x_46_im * x_46_im) * y_46_re) / x_46_re) * Float64(0.5 / x_46_re))) + 1.0); elseif (y_46_im <= 11000.0) tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0); else tmp = fma(fma(0.5, Float64(Float64(x_46_re / x_46_im) * Float64(x_46_re / x_46_im)), Float64(-log(Float64(-1.0 / x_46_im)))), y_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$im, -4.4e+110], N[(N[((-y$46$re) * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] * y$46$re), $MachinePrecision] / x$46$re), $MachinePrecision] * N[(0.5 / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[y$46$im, 11000.0], N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + 1.0), $MachinePrecision], N[(N[(0.5 * N[(N[(x$46$re / x$46$im), $MachinePrecision] * N[(x$46$re / x$46$im), $MachinePrecision]), $MachinePrecision] + (-N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] * y$46$re + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.4 \cdot 10^{+110}:\\
\;\;\;\;\mathsf{fma}\left(-y.re, \log \left(\frac{-1}{x.re}\right), \frac{\left(x.im \cdot x.im\right) \cdot y.re}{x.re} \cdot \frac{0.5}{x.re}\right) + 1\\
\mathbf{elif}\;y.im \leq 11000:\\
\;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.5, \frac{x.re}{x.im} \cdot \frac{x.re}{x.im}, -\log \left(\frac{-1}{x.im}\right)\right), y.re, 1\right)\\
\end{array}
\end{array}
if y.im < -4.39999999999999984e110Initial program 39.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6438.0
Applied rewrites38.0%
Taylor expanded in y.re around 0
Applied rewrites2.5%
Taylor expanded in y.re around 0
Applied rewrites2.4%
Taylor expanded in x.re around -inf
Applied rewrites11.8%
if -4.39999999999999984e110 < y.im < 11000Initial program 39.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.f6481.0
Applied rewrites81.0%
Taylor expanded in y.re around 0
Applied rewrites42.4%
if 11000 < y.im Initial program 42.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.f6431.8
Applied rewrites31.8%
Taylor expanded in y.re around 0
Applied rewrites4.0%
Taylor expanded in y.re around 0
Applied rewrites4.0%
Taylor expanded in x.im around -inf
Applied rewrites18.2%
Final simplification31.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re 3.7e+29)
1.0
(fma
(fma 0.5 (* (/ x.re x.im) (/ x.re x.im)) (- (log (/ -1.0 x.im))))
y.re
1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 3.7e+29) {
tmp = 1.0;
} else {
tmp = fma(fma(0.5, ((x_46_re / x_46_im) * (x_46_re / x_46_im)), -log((-1.0 / x_46_im))), y_46_re, 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 3.7e+29) tmp = 1.0; else tmp = fma(fma(0.5, Float64(Float64(x_46_re / x_46_im) * Float64(x_46_re / x_46_im)), Float64(-log(Float64(-1.0 / x_46_im)))), y_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, 3.7e+29], 1.0, N[(N[(0.5 * N[(N[(x$46$re / x$46$im), $MachinePrecision] * N[(x$46$re / x$46$im), $MachinePrecision]), $MachinePrecision] + (-N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] * y$46$re + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 3.7 \cdot 10^{+29}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.5, \frac{x.re}{x.im} \cdot \frac{x.re}{x.im}, -\log \left(\frac{-1}{x.im}\right)\right), y.re, 1\right)\\
\end{array}
\end{array}
if y.re < 3.69999999999999974e29Initial program 39.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.f6462.1
Applied rewrites62.1%
Taylor expanded in y.re around 0
Applied rewrites31.4%
if 3.69999999999999974e29 < y.re Initial program 42.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.f6461.6
Applied rewrites61.6%
Taylor expanded in y.re around 0
Applied rewrites2.5%
Taylor expanded in y.re around 0
Applied rewrites6.4%
Taylor expanded in x.im around -inf
Applied rewrites19.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re 7.6e+78)
1.0
(fma
(fma 0.5 (* (/ x.im x.re) (/ x.im x.re)) (- (log (/ -1.0 x.re))))
y.re
1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 7.6e+78) {
tmp = 1.0;
} else {
tmp = fma(fma(0.5, ((x_46_im / x_46_re) * (x_46_im / x_46_re)), -log((-1.0 / x_46_re))), y_46_re, 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 7.6e+78) tmp = 1.0; else tmp = fma(fma(0.5, Float64(Float64(x_46_im / x_46_re) * Float64(x_46_im / x_46_re)), Float64(-log(Float64(-1.0 / x_46_re)))), y_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, 7.6e+78], 1.0, N[(N[(0.5 * N[(N[(x$46$im / x$46$re), $MachinePrecision] * N[(x$46$im / x$46$re), $MachinePrecision]), $MachinePrecision] + (-N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] * y$46$re + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 7.6 \cdot 10^{+78}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.5, \frac{x.im}{x.re} \cdot \frac{x.im}{x.re}, -\log \left(\frac{-1}{x.re}\right)\right), y.re, 1\right)\\
\end{array}
\end{array}
if y.re < 7.5999999999999998e78Initial program 39.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.f6461.5
Applied rewrites61.5%
Taylor expanded in y.re around 0
Applied rewrites30.7%
if 7.5999999999999998e78 < y.re Initial program 42.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6463.9
Applied rewrites63.9%
Taylor expanded in y.re around 0
Applied rewrites2.5%
Taylor expanded in y.re around 0
Applied rewrites6.8%
Taylor expanded in x.re around -inf
Applied rewrites13.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 5.5e-12) 1.0 (fma (fma (/ 0.5 x.im) (/ (* x.re x.re) x.im) (log x.im)) y.re 1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 5.5e-12) {
tmp = 1.0;
} else {
tmp = fma(fma((0.5 / x_46_im), ((x_46_re * x_46_re) / x_46_im), log(x_46_im)), y_46_re, 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 5.5e-12) tmp = 1.0; else tmp = fma(fma(Float64(0.5 / x_46_im), Float64(Float64(x_46_re * x_46_re) / x_46_im), log(x_46_im)), y_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, 5.5e-12], 1.0, N[(N[(N[(0.5 / x$46$im), $MachinePrecision] * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] + N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] * y$46$re + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 5.5 \cdot 10^{-12}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, \log x.im\right), y.re, 1\right)\\
\end{array}
\end{array}
if y.re < 5.5000000000000004e-12Initial program 36.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.f6462.0
Applied rewrites62.0%
Taylor expanded in y.re around 0
Applied rewrites32.4%
if 5.5000000000000004e-12 < y.re Initial program 50.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.f6461.8
Applied rewrites61.8%
Taylor expanded in y.re around 0
Applied rewrites3.2%
Taylor expanded in y.re around 0
Applied rewrites7.0%
Taylor expanded in x.re around 0
Applied rewrites10.2%
(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 40.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 y.re around 0
Applied rewrites25.5%
herbie shell --seed 2024332
(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)))))