
(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 15 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 (/ -1.0 x.im))) (t_1 (* y.im (atan2 x.im x.re))))
(if (<= x.im -6.8e-289)
(*
(cos (fma y.re (atan2 x.im x.re) (* (- y.im) t_0)))
(exp (- (fma y.re t_0 t_1))))
(if (<= x.im 1.35e-256)
(*
(fma -0.5 (* (* y.re y.re) (pow (atan2 x.im x.re) 2.0)) 1.0)
(pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))
(*
(cos (fma y.im (log x.im) (* y.re (atan2 x.im x.re))))
(exp (- (* y.re (log x.im)) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log((-1.0 / x_46_im));
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -6.8e-289) {
tmp = cos(fma(y_46_re, atan2(x_46_im, x_46_re), (-y_46_im * t_0))) * exp(-fma(y_46_re, t_0, t_1));
} else if (x_46_im <= 1.35e-256) {
tmp = fma(-0.5, ((y_46_re * y_46_re) * pow(atan2(x_46_im, x_46_re), 2.0)), 1.0) * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
} else {
tmp = cos(fma(y_46_im, log(x_46_im), (y_46_re * atan2(x_46_im, x_46_re)))) * exp(((y_46_re * log(x_46_im)) - t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(Float64(-1.0 / x_46_im)) t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -6.8e-289) tmp = Float64(cos(fma(y_46_re, atan(x_46_im, x_46_re), Float64(Float64(-y_46_im) * t_0))) * exp(Float64(-fma(y_46_re, t_0, t_1)))); elseif (x_46_im <= 1.35e-256) tmp = Float64(fma(-0.5, Float64(Float64(y_46_re * y_46_re) * (atan(x_46_im, x_46_re) ^ 2.0)), 1.0) * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)); else tmp = Float64(cos(fma(y_46_im, log(x_46_im), Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -6.8e-289], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[((-y$46$im) * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[(-N[(y$46$re * t$95$0 + t$95$1), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.35e-256], N[(N[(-0.5 * N[(N[(y$46$re * y$46$re), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.im}\right)\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -6.8 \cdot 10^{-289}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \left(-y.im\right) \cdot t\_0\right)\right) \cdot e^{-\mathsf{fma}\left(y.re, t\_0, t\_1\right)}\\
\mathbf{elif}\;x.im \leq 1.35 \cdot 10^{-256}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}, 1\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(y.im, \log x.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{y.re \cdot \log x.im - t\_1}\\
\end{array}
\end{array}
if x.im < -6.80000000000000036e-289Initial program 43.8%
Taylor expanded in x.im around -inf
lower-*.f64N/A
lower-cos.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-atan2.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-exp.f64N/A
Applied rewrites73.6%
if -6.80000000000000036e-289 < x.im < 1.3500000000000001e-256Initial program 40.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6463.8
Applied rewrites63.8%
Taylor expanded in y.re around 0
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-atan2.f6469.3
Applied rewrites69.3%
if 1.3500000000000001e-256 < x.im Initial program 43.7%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6479.8
Applied rewrites79.8%
Final simplification76.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* y.im (atan2 x.im x.re)))
(t_2 (log (/ -1.0 x.re))))
(if (<= x.re -2e-308)
(* (cos (fma t_2 (- y.im) t_0)) (exp (- (fma y.re t_2 t_1))))
(* (cos (fma y.im (log x.re) t_0)) (exp (- (* y.re (log 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double t_2 = log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -2e-308) {
tmp = cos(fma(t_2, -y_46_im, t_0)) * exp(-fma(y_46_re, t_2, t_1));
} else {
tmp = cos(fma(y_46_im, log(x_46_re), t_0)) * exp(((y_46_re * log(x_46_re)) - t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_2 = log(Float64(-1.0 / x_46_re)) tmp = 0.0 if (x_46_re <= -2e-308) tmp = Float64(cos(fma(t_2, Float64(-y_46_im), t_0)) * exp(Float64(-fma(y_46_re, t_2, t_1)))); else tmp = Float64(cos(fma(y_46_im, log(x_46_re), t_0)) * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -2e-308], N[(N[Cos[N[(t$95$2 * (-y$46$im) + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[(-N[(y$46$re * t$95$2 + t$95$1), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\frac{-1}{x.re}\right)\\
\mathbf{if}\;x.re \leq -2 \cdot 10^{-308}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t\_2, -y.im, t\_0\right)\right) \cdot e^{-\mathsf{fma}\left(y.re, t\_2, t\_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(y.im, \log x.re, t\_0\right)\right) \cdot e^{y.re \cdot \log x.re - t\_1}\\
\end{array}
\end{array}
if x.re < -1.9999999999999998e-308Initial program 42.9%
Taylor expanded in x.re around -inf
lower-*.f64N/A
lower-cos.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
Applied rewrites74.4%
if -1.9999999999999998e-308 < x.re Initial program 44.2%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6477.2
Applied rewrites77.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -5.4e+31)
(* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) t_0)
(if (<= y.re 6.2e-7)
(exp (- (* y.im (atan2 x.im x.re))))
(*
t_0
(pow
(sqrt (fma x.im x.im (sqrt (* x.re (* x.re (* x.re 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 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -5.4e+31) {
tmp = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * t_0;
} else if (y_46_re <= 6.2e-7) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * pow(sqrt(fma(x_46_im, x_46_im, sqrt((x_46_re * (x_46_re * (x_46_re * x_46_re)))))), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -5.4e+31) tmp = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * t_0); elseif (y_46_re <= 6.2e-7) tmp = exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * (sqrt(fma(x_46_im, x_46_im, sqrt(Float64(x_46_re * Float64(x_46_re * Float64(x_46_re * x_46_re)))))) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -5.4e+31], N[(N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 6.2e-7], N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[Sqrt[N[(x$46$re * N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -5.4 \cdot 10^{+31}:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-7}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \sqrt{x.re \cdot \left(x.re \cdot \left(x.re \cdot x.re\right)\right)}\right)}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -5.39999999999999971e31Initial program 41.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6478.6
Applied rewrites78.6%
if -5.39999999999999971e31 < y.re < 6.1999999999999999e-7Initial program 40.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6439.5
Applied rewrites39.5%
Taylor expanded in y.im around 0
Applied rewrites75.9%
if 6.1999999999999999e-7 < y.re Initial program 49.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6466.4
Applied rewrites66.4%
lift-*.f6466.4
rem-square-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
cube-unmultN/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f6466.4
Applied rewrites66.4%
Final simplification73.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)
(cos (* y.re (atan2 x.im x.re))))))
(if (<= y.re -5.4e+31)
t_0
(if (<= y.re 4.3e-7) (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(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -5.4e+31) {
tmp = t_0;
} else if (y_46_re <= 4.3e-7) {
tmp = exp(-(y_46_im * 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((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -5.4e+31) tmp = t_0; elseif (y_46_re <= 4.3e-7) tmp = exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5.4e+31], t$95$0, If[LessEqual[y$46$re, 4.3e-7], N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -5.4 \cdot 10^{+31}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-7}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -5.39999999999999971e31 or 4.3000000000000001e-7 < y.re Initial program 46.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6471.4
Applied rewrites71.4%
if -5.39999999999999971e31 < y.re < 4.3000000000000001e-7Initial program 40.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6439.5
Applied rewrites39.5%
Taylor expanded in y.im around 0
Applied rewrites75.9%
Final simplification73.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -5.4e+31)
(* (cos (* y.re (atan2 x.im x.re))) (pow x.re y.re))
(if (<= y.re 6.1e-7)
(exp (- (* y.im (atan2 x.im x.re))))
(pow (pow (fma x.im x.im (* x.re x.re)) (* 0.5 (* y.re 0.25))) 4.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.4e+31) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_re, y_46_re);
} else if (y_46_re <= 6.1e-7) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(pow(fma(x_46_im, x_46_im, (x_46_re * x_46_re)), (0.5 * (y_46_re * 0.25))), 4.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.4e+31) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_re ^ y_46_re)); elseif (y_46_re <= 6.1e-7) tmp = exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = (fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) ^ Float64(0.5 * Float64(y_46_re * 0.25))) ^ 4.0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -5.4e+31], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.1e-7], N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision], N[Power[N[Power[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y$46$re * 0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 4.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5.4 \cdot 10^{+31}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re}\\
\mathbf{elif}\;y.re \leq 6.1 \cdot 10^{-7}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(0.5 \cdot \left(y.re \cdot 0.25\right)\right)}\right)}^{4}\\
\end{array}
\end{array}
if y.re < -5.39999999999999971e31Initial program 41.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6478.6
Applied rewrites78.6%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f6468.9
Applied rewrites68.9%
if -5.39999999999999971e31 < y.re < 6.09999999999999983e-7Initial program 40.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6439.5
Applied rewrites39.5%
Taylor expanded in y.im around 0
Applied rewrites75.9%
if 6.09999999999999983e-7 < y.re Initial program 49.9%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites44.7%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6465.1
Applied rewrites65.1%
lift-*.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
sqr-powN/A
pow2N/A
sqr-powN/A
pow2N/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
Applied rewrites65.1%
Final simplification71.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -5.6e+31)
(* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re))
(if (<= y.re 6.1e-7)
(exp (- (* y.im (atan2 x.im x.re))))
(pow (pow (fma x.im x.im (* x.re x.re)) (* 0.5 (* y.re 0.25))) 4.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.6e+31) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else if (y_46_re <= 6.1e-7) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(pow(fma(x_46_im, x_46_im, (x_46_re * x_46_re)), (0.5 * (y_46_re * 0.25))), 4.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.6e+31) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); elseif (y_46_re <= 6.1e-7) tmp = exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = (fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) ^ Float64(0.5 * Float64(y_46_re * 0.25))) ^ 4.0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -5.6e+31], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.1e-7], N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision], N[Power[N[Power[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y$46$re * 0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 4.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5.6 \cdot 10^{+31}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 6.1 \cdot 10^{-7}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(0.5 \cdot \left(y.re \cdot 0.25\right)\right)}\right)}^{4}\\
\end{array}
\end{array}
if y.re < -5.60000000000000034e31Initial program 41.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6478.6
Applied rewrites78.6%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f6465.0
Applied rewrites65.0%
if -5.60000000000000034e31 < y.re < 6.09999999999999983e-7Initial program 40.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6439.5
Applied rewrites39.5%
Taylor expanded in y.im around 0
Applied rewrites75.9%
if 6.09999999999999983e-7 < y.re Initial program 49.9%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites44.7%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6465.1
Applied rewrites65.1%
lift-*.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
sqr-powN/A
pow2N/A
sqr-powN/A
pow2N/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
Applied rewrites65.1%
Final simplification70.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (fma x.im x.im (* x.re x.re))))
(if (<= y.re -0.00035)
(pow (sqrt t_0) y.re)
(if (<= y.re 6.1e-7)
(exp (- (* y.im (atan2 x.im x.re))))
(pow (pow t_0 (* 0.5 (* y.re 0.25))) 4.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(x_46_im, x_46_im, (x_46_re * x_46_re));
double tmp;
if (y_46_re <= -0.00035) {
tmp = pow(sqrt(t_0), y_46_re);
} else if (y_46_re <= 6.1e-7) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(pow(t_0, (0.5 * (y_46_re * 0.25))), 4.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) tmp = 0.0 if (y_46_re <= -0.00035) tmp = sqrt(t_0) ^ y_46_re; elseif (y_46_re <= 6.1e-7) tmp = exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = (t_0 ^ Float64(0.5 * Float64(y_46_re * 0.25))) ^ 4.0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.00035], N[Power[N[Sqrt[t$95$0], $MachinePrecision], y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 6.1e-7], N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision], N[Power[N[Power[t$95$0, N[(0.5 * N[(y$46$re * 0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 4.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\\
\mathbf{if}\;y.re \leq -0.00035:\\
\;\;\;\;{\left(\sqrt{t\_0}\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 6.1 \cdot 10^{-7}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;{\left({t\_0}^{\left(0.5 \cdot \left(y.re \cdot 0.25\right)\right)}\right)}^{4}\\
\end{array}
\end{array}
if y.re < -3.49999999999999996e-4Initial program 44.8%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites44.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6463.2
Applied rewrites63.2%
if -3.49999999999999996e-4 < y.re < 6.09999999999999983e-7Initial program 39.1%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6439.1
Applied rewrites39.1%
Taylor expanded in y.im around 0
Applied rewrites76.8%
if 6.09999999999999983e-7 < y.re Initial program 49.9%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites44.7%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6465.1
Applied rewrites65.1%
lift-*.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
sqr-powN/A
pow2N/A
sqr-powN/A
pow2N/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
Applied rewrites65.1%
Final simplification70.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)))
(if (<= y.re -0.00035)
t_0
(if (<= y.re 6.1e-7) (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(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double tmp;
if (y_46_re <= -0.00035) {
tmp = t_0;
} else if (y_46_re <= 6.1e-7) {
tmp = exp(-(y_46_im * 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 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re tmp = 0.0 if (y_46_re <= -0.00035) tmp = t_0; elseif (y_46_re <= 6.1e-7) tmp = exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))); 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[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -0.00035], t$95$0, If[LessEqual[y$46$re, 6.1e-7], N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -0.00035:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 6.1 \cdot 10^{-7}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -3.49999999999999996e-4 or 6.09999999999999983e-7 < y.re Initial program 47.7%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites44.4%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6464.3
Applied rewrites64.3%
if -3.49999999999999996e-4 < y.re < 6.09999999999999983e-7Initial program 39.1%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6439.1
Applied rewrites39.1%
Taylor expanded in y.im around 0
Applied rewrites76.8%
Final simplification70.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)))
(if (<= y.re -1.9e-98)
t_0
(if (<= y.re 2.1e-50) (/ 1.0 (fma (atan2 x.im x.re) y.im 1.0)) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double tmp;
if (y_46_re <= -1.9e-98) {
tmp = t_0;
} else if (y_46_re <= 2.1e-50) {
tmp = 1.0 / fma(atan2(x_46_im, x_46_re), y_46_im, 1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.9e-98) tmp = t_0; elseif (y_46_re <= 2.1e-50) tmp = Float64(1.0 / fma(atan(x_46_im, x_46_re), y_46_im, 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[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.9e-98], t$95$0, If[LessEqual[y$46$re, 2.1e-50], N[(1.0 / N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.9 \cdot 10^{-98}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-50}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.9000000000000002e-98 or 2.1000000000000001e-50 < y.re Initial program 44.5%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites41.7%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6461.5
Applied rewrites61.5%
if -1.9000000000000002e-98 < y.re < 2.1000000000000001e-50Initial program 42.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6442.0
Applied rewrites42.0%
lift-*.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan2.f64N/A
*-commutativeN/A
lift-*.f64N/A
rec-expN/A
un-div-invN/A
clear-numN/A
lower-/.f64N/A
Applied rewrites42.0%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-atan2.f6452.1
Applied rewrites52.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -2.6e-165) (pow (- x.re) y.re) (if (<= x.re 0.13) (pow (* x.im x.im) (* y.re 0.5)) (pow x.re y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -2.6e-165) {
tmp = pow(-x_46_re, y_46_re);
} else if (x_46_re <= 0.13) {
tmp = pow((x_46_im * x_46_im), (y_46_re * 0.5));
} else {
tmp = pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46re <= (-2.6d-165)) then
tmp = -x_46re ** y_46re
else if (x_46re <= 0.13d0) then
tmp = (x_46im * x_46im) ** (y_46re * 0.5d0)
else
tmp = x_46re ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -2.6e-165) {
tmp = Math.pow(-x_46_re, y_46_re);
} else if (x_46_re <= 0.13) {
tmp = Math.pow((x_46_im * x_46_im), (y_46_re * 0.5));
} else {
tmp = Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -2.6e-165: tmp = math.pow(-x_46_re, y_46_re) elif x_46_re <= 0.13: tmp = math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) else: tmp = math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -2.6e-165) tmp = Float64(-x_46_re) ^ y_46_re; elseif (x_46_re <= 0.13) tmp = Float64(x_46_im * x_46_im) ^ Float64(y_46_re * 0.5); else tmp = x_46_re ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_re <= -2.6e-165) tmp = -x_46_re ^ y_46_re; elseif (x_46_re <= 0.13) tmp = (x_46_im * x_46_im) ^ (y_46_re * 0.5); else tmp = x_46_re ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -2.6e-165], N[Power[(-x$46$re), y$46$re], $MachinePrecision], If[LessEqual[x$46$re, 0.13], N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision], N[Power[x$46$re, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2.6 \cdot 10^{-165}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 0.13:\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -2.60000000000000007e-165Initial program 44.3%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites42.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6455.2
Applied rewrites55.2%
Taylor expanded in x.re around -inf
neg-mul-1N/A
lower-neg.f6462.1
Applied rewrites62.1%
if -2.60000000000000007e-165 < x.re < 0.13Initial program 46.8%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites45.6%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6445.2
Applied rewrites45.2%
Taylor expanded in x.im around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
exp-to-powN/A
lower-pow.f6431.4
Applied rewrites31.4%
sqr-powN/A
pow-prod-downN/A
lift-*.f64N/A
lower-pow.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6442.8
Applied rewrites42.8%
if 0.13 < x.re Initial program 36.2%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites34.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6452.6
Applied rewrites52.6%
Taylor expanded in x.im around 0
lower-pow.f6456.5
Applied rewrites56.5%
Final simplification53.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.9e-6)
(pow x.im y.re)
(if (<= y.re 32000000000.0)
1.0
(if (<= y.re 3e+233) (pow x.re y.re) (pow x.im y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.9e-6) {
tmp = pow(x_46_im, y_46_re);
} else if (y_46_re <= 32000000000.0) {
tmp = 1.0;
} else if (y_46_re <= 3e+233) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= (-1.9d-6)) then
tmp = x_46im ** y_46re
else if (y_46re <= 32000000000.0d0) then
tmp = 1.0d0
else if (y_46re <= 3d+233) then
tmp = x_46re ** y_46re
else
tmp = x_46im ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.9e-6) {
tmp = Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 32000000000.0) {
tmp = 1.0;
} else if (y_46_re <= 3e+233) {
tmp = Math.pow(x_46_re, y_46_re);
} else {
tmp = Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -1.9e-6: tmp = math.pow(x_46_im, y_46_re) elif y_46_re <= 32000000000.0: tmp = 1.0 elif y_46_re <= 3e+233: tmp = math.pow(x_46_re, y_46_re) else: tmp = math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -1.9e-6) tmp = x_46_im ^ y_46_re; elseif (y_46_re <= 32000000000.0) tmp = 1.0; elseif (y_46_re <= 3e+233) tmp = x_46_re ^ y_46_re; else tmp = x_46_im ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -1.9e-6) tmp = x_46_im ^ y_46_re; elseif (y_46_re <= 32000000000.0) tmp = 1.0; elseif (y_46_re <= 3e+233) tmp = x_46_re ^ y_46_re; else tmp = x_46_im ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.9e-6], N[Power[x$46$im, y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 32000000000.0], 1.0, If[LessEqual[y$46$re, 3e+233], N[Power[x$46$re, y$46$re], $MachinePrecision], N[Power[x$46$im, y$46$re], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.9 \cdot 10^{-6}:\\
\;\;\;\;{x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 32000000000:\\
\;\;\;\;1\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{+233}:\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.9e-6 or 3.00000000000000014e233 < y.re Initial program 41.3%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites40.7%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6464.6
Applied rewrites64.6%
Taylor expanded in x.im around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
exp-to-powN/A
lower-pow.f6456.0
Applied rewrites56.0%
if -1.9e-6 < y.re < 3.2e10Initial program 39.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6438.1
Applied rewrites38.1%
Taylor expanded in y.re around 0
Applied rewrites42.7%
if 3.2e10 < y.re < 3.00000000000000014e233Initial program 58.7%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites52.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6465.5
Applied rewrites65.5%
Taylor expanded in x.im around 0
lower-pow.f6465.5
Applied rewrites65.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -4.6e-281) (pow (- x.im) y.re) (if (<= x.im 1.35e-244) (pow x.re y.re) (pow x.im y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -4.6e-281) {
tmp = pow(-x_46_im, y_46_re);
} else if (x_46_im <= 1.35e-244) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46im <= (-4.6d-281)) then
tmp = -x_46im ** y_46re
else if (x_46im <= 1.35d-244) then
tmp = x_46re ** y_46re
else
tmp = x_46im ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -4.6e-281) {
tmp = Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 1.35e-244) {
tmp = Math.pow(x_46_re, y_46_re);
} else {
tmp = Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -4.6e-281: tmp = math.pow(-x_46_im, y_46_re) elif x_46_im <= 1.35e-244: tmp = math.pow(x_46_re, y_46_re) else: tmp = math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -4.6e-281) tmp = Float64(-x_46_im) ^ y_46_re; elseif (x_46_im <= 1.35e-244) tmp = x_46_re ^ y_46_re; else tmp = x_46_im ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_im <= -4.6e-281) tmp = -x_46_im ^ y_46_re; elseif (x_46_im <= 1.35e-244) tmp = x_46_re ^ y_46_re; else tmp = x_46_im ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -4.6e-281], N[Power[(-x$46$im), y$46$re], $MachinePrecision], If[LessEqual[x$46$im, 1.35e-244], N[Power[x$46$re, y$46$re], $MachinePrecision], N[Power[x$46$im, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -4.6 \cdot 10^{-281}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 1.35 \cdot 10^{-244}:\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -4.59999999999999978e-281Initial program 42.8%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites42.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6457.7
Applied rewrites57.7%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6453.0
Applied rewrites53.0%
if -4.59999999999999978e-281 < x.im < 1.35e-244Initial program 44.8%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites44.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6463.0
Applied rewrites63.0%
Taylor expanded in x.im around 0
lower-pow.f6455.2
Applied rewrites55.2%
if 1.35e-244 < x.im Initial program 44.0%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites40.9%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6440.7
Applied rewrites40.7%
Taylor expanded in x.im around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
exp-to-powN/A
lower-pow.f6448.2
Applied rewrites48.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -1.9e-6) (pow x.im y.re) (if (<= y.re 9.5e+15) 1.0 (pow x.im y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.9e-6) {
tmp = pow(x_46_im, y_46_re);
} else if (y_46_re <= 9.5e+15) {
tmp = 1.0;
} else {
tmp = pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= (-1.9d-6)) then
tmp = x_46im ** y_46re
else if (y_46re <= 9.5d+15) then
tmp = 1.0d0
else
tmp = x_46im ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.9e-6) {
tmp = Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 9.5e+15) {
tmp = 1.0;
} else {
tmp = Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -1.9e-6: tmp = math.pow(x_46_im, y_46_re) elif y_46_re <= 9.5e+15: tmp = 1.0 else: tmp = math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -1.9e-6) tmp = x_46_im ^ y_46_re; elseif (y_46_re <= 9.5e+15) tmp = 1.0; else tmp = x_46_im ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -1.9e-6) tmp = x_46_im ^ y_46_re; elseif (y_46_re <= 9.5e+15) tmp = 1.0; else tmp = x_46_im ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.9e-6], N[Power[x$46$im, y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 9.5e+15], 1.0, N[Power[x$46$im, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.9 \cdot 10^{-6}:\\
\;\;\;\;{x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 9.5 \cdot 10^{+15}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.9e-6 or 9.5e15 < y.re Initial program 48.0%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites45.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6464.6
Applied rewrites64.6%
Taylor expanded in x.im around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
exp-to-powN/A
lower-pow.f6454.4
Applied rewrites54.4%
if -1.9e-6 < y.re < 9.5e15Initial program 39.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6438.6
Applied rewrites38.6%
Taylor expanded in y.re around 0
Applied rewrites42.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -5e-303) (pow (- x.re) y.re) (pow x.re y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -5e-303) {
tmp = pow(-x_46_re, y_46_re);
} else {
tmp = pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46re <= (-5d-303)) then
tmp = -x_46re ** y_46re
else
tmp = x_46re ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -5e-303) {
tmp = Math.pow(-x_46_re, y_46_re);
} else {
tmp = Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -5e-303: tmp = math.pow(-x_46_re, y_46_re) else: tmp = math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -5e-303) tmp = Float64(-x_46_re) ^ y_46_re; else tmp = x_46_re ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_re <= -5e-303) tmp = -x_46_re ^ y_46_re; else tmp = x_46_re ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -5e-303], N[Power[(-x$46$re), y$46$re], $MachinePrecision], N[Power[x$46$re, y$46$re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -5 \cdot 10^{-303}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -4.9999999999999998e-303Initial program 43.2%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites43.5%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6452.4
Applied rewrites52.4%
Taylor expanded in x.re around -inf
neg-mul-1N/A
lower-neg.f6454.0
Applied rewrites54.0%
if -4.9999999999999998e-303 < x.re Initial program 43.9%
Taylor expanded in y.re around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites39.9%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6449.2
Applied rewrites49.2%
Taylor expanded in x.im around 0
lower-pow.f6445.8
Applied rewrites45.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 43.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6454.2
Applied rewrites54.2%
Taylor expanded in y.re around 0
Applied rewrites23.0%
herbie shell --seed 2024219
(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)))))