
(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 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(cos (* y.re (atan2 x.im x.re))))))
(if (<= y.re -1.1) t_1 (if (<= y.re 0.9) (* 1.0 (exp (- 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.1) {
tmp = t_1;
} else if (y_46_re <= 0.9) {
tmp = 1.0 * exp(-t_0);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - t_0)) * cos((y_46re * atan2(x_46im, x_46re)))
if (y_46re <= (-1.1d0)) then
tmp = t_1
else if (y_46re <= 0.9d0) then
tmp = 1.0d0 * exp(-t_0)
else
tmp = t_1
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.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.1) {
tmp = t_1;
} else if (y_46_re <= 0.9) {
tmp = 1.0 * Math.exp(-t_0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -1.1: tmp = t_1 elif y_46_re <= 0.9: tmp = 1.0 * math.exp(-t_0) else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -1.1) tmp = t_1; elseif (y_46_re <= 0.9) tmp = Float64(1.0 * exp(Float64(-t_0))); 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 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -1.1) tmp = t_1; elseif (y_46_re <= 0.9) tmp = 1.0 * exp(-t_0); 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.1], t$95$1, If[LessEqual[y$46$re, 0.9], N[(1.0 * N[Exp[(-t$95$0)], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -1.1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 0.9:\\
\;\;\;\;1 \cdot e^{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.1000000000000001 or 0.900000000000000022 < y.re Initial program 40.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6479.6
Applied rewrites79.6%
if -1.1000000000000001 < y.re < 0.900000000000000022Initial program 41.4%
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.f6441.3
Applied rewrites41.3%
Taylor expanded in y.im around 0
Applied rewrites82.6%
Final simplification81.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -20.0)
(*
(cos (* y.re (atan2 x.im x.re)))
(pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))
(if (<= y.re 1.82)
(* 1.0 (exp (- (* (atan2 x.im x.re) y.im))))
(* (pow (fma x.re x.re (* x.im x.im)) (* y.re 0.5)) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -20.0) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
} else if (y_46_re <= 1.82) {
tmp = 1.0 * exp(-(atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (y_46_re * 0.5)) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -20.0) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)); elseif (y_46_re <= 1.82) tmp = Float64(1.0 * exp(Float64(-Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64((fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(y_46_re * 0.5)) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -20.0], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $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], If[LessEqual[y$46$re, 1.82], N[(1.0 * N[Exp[(-N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -20:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.82:\\
\;\;\;\;1 \cdot e^{-\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1\\
\end{array}
\end{array}
if y.re < -20Initial program 41.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-*.f6487.8
Applied rewrites87.8%
if -20 < y.re < 1.82000000000000006Initial program 41.4%
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.f6441.3
Applied rewrites41.3%
Taylor expanded in y.im around 0
Applied rewrites82.6%
if 1.82000000000000006 < y.re Initial program 38.7%
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-*.f6459.9
Applied rewrites59.9%
Taylor expanded in y.re around 0
Applied rewrites64.7%
Applied rewrites64.7%
Final simplification79.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (pow (fma x.re x.re (* x.im x.im)) (* y.re 0.5)) 1.0)))
(if (<= y.re -13000000000.0)
t_0
(if (<= y.re 1.82) (* 1.0 (exp (- (* (atan2 x.im x.re) y.im)))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (y_46_re * 0.5)) * 1.0;
double tmp;
if (y_46_re <= -13000000000.0) {
tmp = t_0;
} else if (y_46_re <= 1.82) {
tmp = 1.0 * exp(-(atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(y_46_re * 0.5)) * 1.0) tmp = 0.0 if (y_46_re <= -13000000000.0) tmp = t_0; elseif (y_46_re <= 1.82) tmp = Float64(1.0 * exp(Float64(-Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -13000000000.0], t$95$0, If[LessEqual[y$46$re, 1.82], N[(1.0 * N[Exp[(-N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1\\
\mathbf{if}\;y.re \leq -13000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.82:\\
\;\;\;\;1 \cdot e^{-\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.3e10 or 1.82000000000000006 < y.re Initial program 40.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-*.f6474.0
Applied rewrites74.0%
Taylor expanded in y.re around 0
Applied rewrites75.6%
Applied rewrites75.6%
if -1.3e10 < y.re < 1.82000000000000006Initial program 41.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.f6441.0
Applied rewrites41.0%
Taylor expanded in y.im around 0
Applied rewrites81.9%
Final simplification78.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (pow (fma x.re x.re (* x.im x.im)) (* y.re 0.5)) 1.0)))
(if (<= y.re -13000000000.0)
t_0
(if (<= y.re 5.8e-89)
(fma (atan2 x.im x.re) (- (/ (* y.im y.im) 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(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (y_46_re * 0.5)) * 1.0;
double tmp;
if (y_46_re <= -13000000000.0) {
tmp = t_0;
} else if (y_46_re <= 5.8e-89) {
tmp = fma(atan2(x_46_im, x_46_re), -((y_46_im * y_46_im) / 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 = Float64((fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(y_46_re * 0.5)) * 1.0) tmp = 0.0 if (y_46_re <= -13000000000.0) tmp = t_0; elseif (y_46_re <= 5.8e-89) tmp = fma(atan(x_46_im, x_46_re), Float64(-Float64(Float64(y_46_im * y_46_im) / 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[(N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -13000000000.0], t$95$0, If[LessEqual[y$46$re, 5.8e-89], N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-N[(N[(y$46$im * y$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]) + 1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1\\
\mathbf{if}\;y.re \leq -13000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5.8 \cdot 10^{-89}:\\
\;\;\;\;\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, -\frac{y.im \cdot y.im}{y.im}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.3e10 or 5.79999999999999984e-89 < y.re Initial program 41.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-*.f6472.2
Applied rewrites72.2%
Taylor expanded in y.re around 0
Applied rewrites73.6%
Applied rewrites73.6%
if -1.3e10 < y.re < 5.79999999999999984e-89Initial program 40.5%
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.f6440.4
Applied rewrites40.4%
Taylor expanded in y.im around 0
Applied rewrites60.4%
Applied rewrites65.7%
Final simplification70.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (pow (fma x.re x.re (* x.im x.im)) (* y.re 0.5)) 1.0)))
(if (<= y.re -8.6e-22)
t_0
(if (<= y.re 5.8e-89) (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(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (y_46_re * 0.5)) * 1.0;
double tmp;
if (y_46_re <= -8.6e-22) {
tmp = t_0;
} else if (y_46_re <= 5.8e-89) {
tmp = 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 = Float64((fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(y_46_re * 0.5)) * 1.0) tmp = 0.0 if (y_46_re <= -8.6e-22) tmp = t_0; elseif (y_46_re <= 5.8e-89) tmp = fma(atan(x_46_im, x_46_re), Float64(-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[(N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -8.6e-22], t$95$0, If[LessEqual[y$46$re, 5.8e-89], N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im) + 1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1\\
\mathbf{if}\;y.re \leq -8.6 \cdot 10^{-22}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5.8 \cdot 10^{-89}:\\
\;\;\;\;\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 < -8.60000000000000075e-22 or 5.79999999999999984e-89 < y.re Initial program 41.1%
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.1
Applied rewrites71.1%
Taylor expanded in y.re around 0
Applied rewrites71.8%
Applied rewrites71.8%
if -8.60000000000000075e-22 < y.re < 5.79999999999999984e-89Initial program 40.4%
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.f6440.4
Applied rewrites40.4%
Taylor expanded in y.im around 0
Applied rewrites62.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -5.3e-79) (* 1.0 (pow (- x.im) y.re)) (if (<= x.im 0.035) (* 1.0 (pow (- x.re) y.re)) (* 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 (x_46_im <= -5.3e-79) {
tmp = 1.0 * pow(-x_46_im, y_46_re);
} else if (x_46_im <= 0.035) {
tmp = 1.0 * pow(-x_46_re, y_46_re);
} else {
tmp = 1.0 * 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 <= (-5.3d-79)) then
tmp = 1.0d0 * (-x_46im ** y_46re)
else if (x_46im <= 0.035d0) then
tmp = 1.0d0 * (-x_46re ** y_46re)
else
tmp = 1.0d0 * (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 <= -5.3e-79) {
tmp = 1.0 * Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 0.035) {
tmp = 1.0 * Math.pow(-x_46_re, y_46_re);
} else {
tmp = 1.0 * 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 <= -5.3e-79: tmp = 1.0 * math.pow(-x_46_im, y_46_re) elif x_46_im <= 0.035: tmp = 1.0 * math.pow(-x_46_re, y_46_re) else: tmp = 1.0 * 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 <= -5.3e-79) tmp = Float64(1.0 * (Float64(-x_46_im) ^ y_46_re)); elseif (x_46_im <= 0.035) tmp = Float64(1.0 * (Float64(-x_46_re) ^ y_46_re)); else tmp = Float64(1.0 * (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 <= -5.3e-79) tmp = 1.0 * (-x_46_im ^ y_46_re); elseif (x_46_im <= 0.035) tmp = 1.0 * (-x_46_re ^ y_46_re); else tmp = 1.0 * (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, -5.3e-79], N[(1.0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 0.035], N[(1.0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -5.3 \cdot 10^{-79}:\\
\;\;\;\;1 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 0.035:\\
\;\;\;\;1 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -5.2999999999999998e-79Initial program 38.8%
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-*.f6451.7
Applied rewrites51.7%
Taylor expanded in y.re around 0
Applied rewrites53.2%
Taylor expanded in x.im around -inf
Applied rewrites61.1%
if -5.2999999999999998e-79 < x.im < 0.035000000000000003Initial program 48.6%
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-*.f6460.4
Applied rewrites60.4%
Taylor expanded in y.re around 0
Applied rewrites60.4%
Taylor expanded in x.re around -inf
Applied rewrites59.8%
if 0.035000000000000003 < x.im Initial program 31.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-*.f6446.5
Applied rewrites46.5%
Taylor expanded in y.re around 0
Applied rewrites46.5%
Taylor expanded in x.re around 0
Applied rewrites65.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -3.7e-298) (* 1.0 (pow (- x.im) y.re)) (if (<= x.im 7e-45) (* 1.0 (pow x.re y.re)) (* 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 (x_46_im <= -3.7e-298) {
tmp = 1.0 * pow(-x_46_im, y_46_re);
} else if (x_46_im <= 7e-45) {
tmp = 1.0 * pow(x_46_re, y_46_re);
} else {
tmp = 1.0 * 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 <= (-3.7d-298)) then
tmp = 1.0d0 * (-x_46im ** y_46re)
else if (x_46im <= 7d-45) then
tmp = 1.0d0 * (x_46re ** y_46re)
else
tmp = 1.0d0 * (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 <= -3.7e-298) {
tmp = 1.0 * Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 7e-45) {
tmp = 1.0 * Math.pow(x_46_re, y_46_re);
} else {
tmp = 1.0 * 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 <= -3.7e-298: tmp = 1.0 * math.pow(-x_46_im, y_46_re) elif x_46_im <= 7e-45: tmp = 1.0 * math.pow(x_46_re, y_46_re) else: tmp = 1.0 * 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 <= -3.7e-298) tmp = Float64(1.0 * (Float64(-x_46_im) ^ y_46_re)); elseif (x_46_im <= 7e-45) tmp = Float64(1.0 * (x_46_re ^ y_46_re)); else tmp = Float64(1.0 * (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 <= -3.7e-298) tmp = 1.0 * (-x_46_im ^ y_46_re); elseif (x_46_im <= 7e-45) tmp = 1.0 * (x_46_re ^ y_46_re); else tmp = 1.0 * (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, -3.7e-298], N[(1.0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 7e-45], N[(1.0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -3.7 \cdot 10^{-298}:\\
\;\;\;\;1 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 7 \cdot 10^{-45}:\\
\;\;\;\;1 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -3.6999999999999998e-298Initial program 39.7%
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-*.f6451.7
Applied rewrites51.7%
Taylor expanded in y.re around 0
Applied rewrites52.5%
Taylor expanded in x.im around -inf
Applied rewrites54.5%
if -3.6999999999999998e-298 < x.im < 7e-45Initial program 53.7%
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-*.f6467.3
Applied rewrites67.3%
Taylor expanded in y.re around 0
Applied rewrites67.3%
Taylor expanded in x.im around 0
Applied rewrites62.1%
if 7e-45 < x.im Initial program 32.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-*.f6447.4
Applied rewrites47.4%
Taylor expanded in y.re around 0
Applied rewrites47.4%
Taylor expanded in x.re around 0
Applied rewrites63.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* 1.0 (pow x.re y.re)))) (if (<= y.re -6e+14) t_0 (if (<= y.re 0.9) 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 = 1.0 * pow(x_46_re, y_46_re);
double tmp;
if (y_46_re <= -6e+14) {
tmp = t_0;
} else if (y_46_re <= 0.9) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 * (x_46re ** y_46re)
if (y_46re <= (-6d+14)) then
tmp = t_0
else if (y_46re <= 0.9d0) then
tmp = 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 * Math.pow(x_46_re, y_46_re);
double tmp;
if (y_46_re <= -6e+14) {
tmp = t_0;
} else if (y_46_re <= 0.9) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = 1.0 * math.pow(x_46_re, y_46_re) tmp = 0 if y_46_re <= -6e+14: tmp = t_0 elif y_46_re <= 0.9: tmp = 1.0 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(1.0 * (x_46_re ^ y_46_re)) tmp = 0.0 if (y_46_re <= -6e+14) tmp = t_0; elseif (y_46_re <= 0.9) tmp = 1.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 1.0 * (x_46_re ^ y_46_re); tmp = 0.0; if (y_46_re <= -6e+14) tmp = t_0; elseif (y_46_re <= 0.9) tmp = 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -6e+14], t$95$0, If[LessEqual[y$46$re, 0.9], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 \cdot {x.re}^{y.re}\\
\mathbf{if}\;y.re \leq -6 \cdot 10^{+14}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.9:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -6e14 or 0.900000000000000022 < y.re Initial program 41.1%
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-*.f6473.6
Applied rewrites73.6%
Taylor expanded in y.re around 0
Applied rewrites76.0%
Taylor expanded in x.im around 0
Applied rewrites60.2%
if -6e14 < y.re < 0.900000000000000022Initial program 40.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-*.f6435.5
Applied rewrites35.5%
Taylor expanded in y.re around 0
Applied rewrites57.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* 1.0 (pow x.im y.re)))) (if (<= y.re -1.95e+16) t_0 (if (<= y.re 270000.0) 1.0 t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 * pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.95e+16) {
tmp = t_0;
} else if (y_46_re <= 270000.0) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 * (x_46im ** y_46re)
if (y_46re <= (-1.95d+16)) then
tmp = t_0
else if (y_46re <= 270000.0d0) then
tmp = 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 * Math.pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.95e+16) {
tmp = t_0;
} else if (y_46_re <= 270000.0) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = 1.0 * math.pow(x_46_im, y_46_re) tmp = 0 if y_46_re <= -1.95e+16: tmp = t_0 elif y_46_re <= 270000.0: tmp = 1.0 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(1.0 * (x_46_im ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.95e+16) tmp = t_0; elseif (y_46_re <= 270000.0) tmp = 1.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 1.0 * (x_46_im ^ y_46_re); tmp = 0.0; if (y_46_re <= -1.95e+16) tmp = t_0; elseif (y_46_re <= 270000.0) tmp = 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.95e+16], t$95$0, If[LessEqual[y$46$re, 270000.0], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 \cdot {x.im}^{y.re}\\
\mathbf{if}\;y.re \leq -1.95 \cdot 10^{+16}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 270000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.95e16 or 2.7e5 < y.re Initial program 41.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-*.f6473.1
Applied rewrites73.1%
Taylor expanded in y.re around 0
Applied rewrites75.6%
Taylor expanded in x.re around 0
Applied rewrites54.6%
if -1.95e16 < y.re < 2.7e5Initial program 40.6%
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-*.f6436.5
Applied rewrites36.5%
Taylor expanded in y.re around 0
Applied rewrites57.1%
(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.8%
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.0
Applied rewrites54.0%
Taylor expanded in y.re around 0
Applied rewrites31.2%
herbie shell --seed 2024221
(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)))))