
(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 13 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(Float64(-0.5 * 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[(N[(-0.5 * N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $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 \cdot \left(y.re \cdot y.re\right), {\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
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
(*
(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 3.9e-7) (* 1.0 (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 <= 3.9e-7) {
tmp = 1.0 * 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 <= 3.9e-7) tmp = Float64(1.0 * 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, 3.9e-7], N[(1.0 * 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(\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 3.9 \cdot 10^{-7}:\\
\;\;\;\;1 \cdot 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 3.90000000000000025e-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 < 3.90000000000000025e-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.2e-7)
(* 1.0 (exp (- (* y.im (atan2 x.im x.re)))))
(* (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 <= -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.2e-7) {
tmp = 1.0 * exp(-(y_46_im * atan2(x_46_im, x_46_re)));
} 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 <= -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.2e-7) tmp = Float64(1.0 * exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re))))); 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, -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.2e-7], N[(1.0 * N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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 -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.2 \cdot 10^{-7}:\\
\;\;\;\;1 \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\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 < -5.39999999999999971e31Initial program 41.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.f6445.2
Applied rewrites45.2%
Taylor expanded in y.im around 0
Applied rewrites68.9%
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%
Taylor expanded in y.re around 0
Applied rewrites65.1%
Applied rewrites65.1%
(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.2e-7)
(* 1.0 (exp (- (* y.im (atan2 x.im x.re)))))
(* (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 <= -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.2e-7) {
tmp = 1.0 * exp(-(y_46_im * atan2(x_46_im, x_46_re)));
} 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 <= -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.2e-7) tmp = Float64(1.0 * exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re))))); 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, -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.2e-7], N[(1.0 * N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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 -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.2 \cdot 10^{-7}:\\
\;\;\;\;1 \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\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 < -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
Applied rewrites65.0%
if -5.60000000000000034e31 < 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%
Taylor expanded in y.re around 0
Applied rewrites65.1%
Applied rewrites65.1%
(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 -0.00035)
t_0
(if (<= y.re 6.2e-7) (* 1.0 (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(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 <= -0.00035) {
tmp = t_0;
} else if (y_46_re <= 6.2e-7) {
tmp = 1.0 * 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((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 <= -0.00035) tmp = t_0; elseif (y_46_re <= 6.2e-7) tmp = Float64(1.0 * 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[(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, -0.00035], t$95$0, If[LessEqual[y$46$re, 6.2e-7], N[(1.0 * 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{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 -0.00035:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-7}:\\
\;\;\;\;1 \cdot 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.1999999999999999e-7 < y.re Initial program 47.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-*.f6470.6
Applied rewrites70.6%
Taylor expanded in y.re around 0
Applied rewrites64.3%
Applied rewrites64.3%
if -3.49999999999999996e-4 < y.re < 6.1999999999999999e-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%
(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 -1.9e-98)
t_0
(if (<= y.re 2.1e-50) (/ 1.0 (fma y.im (atan2 x.im x.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(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 <= -1.9e-98) {
tmp = t_0;
} else if (y_46_re <= 2.1e-50) {
tmp = 1.0 / fma(y_46_im, atan2(x_46_im, x_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((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 <= -1.9e-98) tmp = t_0; elseif (y_46_re <= 2.1e-50) tmp = Float64(1.0 / fma(y_46_im, atan(x_46_im, x_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[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, -1.9e-98], t$95$0, If[LessEqual[y$46$re, 2.1e-50], N[(1.0 / N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + 1.0), $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 -1.9 \cdot 10^{-98}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-50}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}, 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.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.0
Applied rewrites67.0%
Taylor expanded in y.re around 0
Applied rewrites61.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%
Applied rewrites42.0%
Taylor expanded in y.im around 0
Applied rewrites52.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re -2.6e-165)
(* 1.0 (pow (- x.re) y.re))
(if (<= x.re 0.13)
(* 1.0 (pow (* x.im x.im) (* y.re 0.5)))
(* 1.0 (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 = 1.0 * pow(-x_46_re, y_46_re);
} else if (x_46_re <= 0.13) {
tmp = 1.0 * pow((x_46_im * x_46_im), (y_46_re * 0.5));
} else {
tmp = 1.0 * 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 = 1.0d0 * (-x_46re ** y_46re)
else if (x_46re <= 0.13d0) then
tmp = 1.0d0 * ((x_46im * x_46im) ** (y_46re * 0.5d0))
else
tmp = 1.0d0 * (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 = 1.0 * Math.pow(-x_46_re, y_46_re);
} else if (x_46_re <= 0.13) {
tmp = 1.0 * Math.pow((x_46_im * x_46_im), (y_46_re * 0.5));
} else {
tmp = 1.0 * 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 = 1.0 * math.pow(-x_46_re, y_46_re) elif x_46_re <= 0.13: tmp = 1.0 * math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) else: tmp = 1.0 * 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(1.0 * (Float64(-x_46_re) ^ y_46_re)); elseif (x_46_re <= 0.13) tmp = Float64(1.0 * (Float64(x_46_im * x_46_im) ^ Float64(y_46_re * 0.5))); else tmp = Float64(1.0 * (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 = 1.0 * (-x_46_re ^ y_46_re); elseif (x_46_re <= 0.13) tmp = 1.0 * ((x_46_im * x_46_im) ^ (y_46_re * 0.5)); else tmp = 1.0 * (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[(1.0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 0.13], N[(1.0 * N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2.6 \cdot 10^{-165}:\\
\;\;\;\;1 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 0.13:\\
\;\;\;\;1 \cdot {\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -2.60000000000000007e-165Initial program 44.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-*.f6450.7
Applied rewrites50.7%
Taylor expanded in y.re around 0
Applied rewrites55.2%
Taylor expanded in x.re around -inf
Applied rewrites62.1%
if -2.60000000000000007e-165 < x.re < 0.13Initial program 46.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.9
Applied rewrites54.9%
Taylor expanded in y.re around 0
Applied rewrites45.2%
Applied rewrites45.2%
Taylor expanded in x.re around 0
Applied rewrites42.8%
if 0.13 < x.re Initial program 36.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-*.f6459.8
Applied rewrites59.8%
Taylor expanded in y.re around 0
Applied rewrites52.6%
Taylor expanded in x.im around 0
Applied rewrites56.5%
Final simplification53.7%
(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.9e-6)
t_0
(if (<= y.re 32000000000.0)
1.0
(if (<= y.re 3e+233) (* 1.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 = 1.0 * pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.9e-6) {
tmp = t_0;
} else if (y_46_re <= 32000000000.0) {
tmp = 1.0;
} else if (y_46_re <= 3e+233) {
tmp = 1.0 * pow(x_46_re, y_46_re);
} 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.9d-6)) then
tmp = t_0
else if (y_46re <= 32000000000.0d0) then
tmp = 1.0d0
else if (y_46re <= 3d+233) then
tmp = 1.0d0 * (x_46re ** y_46re)
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.9e-6) {
tmp = t_0;
} else if (y_46_re <= 32000000000.0) {
tmp = 1.0;
} else if (y_46_re <= 3e+233) {
tmp = 1.0 * Math.pow(x_46_re, y_46_re);
} 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.9e-6: tmp = t_0 elif y_46_re <= 32000000000.0: tmp = 1.0 elif y_46_re <= 3e+233: tmp = 1.0 * math.pow(x_46_re, y_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(1.0 * (x_46_im ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.9e-6) tmp = t_0; elseif (y_46_re <= 32000000000.0) tmp = 1.0; elseif (y_46_re <= 3e+233) tmp = Float64(1.0 * (x_46_re ^ y_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 = 1.0 * (x_46_im ^ y_46_re); tmp = 0.0; if (y_46_re <= -1.9e-6) tmp = t_0; elseif (y_46_re <= 32000000000.0) tmp = 1.0; elseif (y_46_re <= 3e+233) tmp = 1.0 * (x_46_re ^ y_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[(1.0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.9e-6], t$95$0, If[LessEqual[y$46$re, 32000000000.0], 1.0, If[LessEqual[y$46$re, 3e+233], N[(1.0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 \cdot {x.im}^{y.re}\\
\mathbf{if}\;y.re \leq -1.9 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 32000000000:\\
\;\;\;\;1\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{+233}:\\
\;\;\;\;1 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.9e-6 or 3.00000000000000014e233 < y.re Initial program 41.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%
Taylor expanded in y.re around 0
Applied rewrites64.6%
Taylor expanded in x.re around 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.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-*.f6469.8
Applied rewrites69.8%
Taylor expanded in y.re around 0
Applied rewrites65.5%
Taylor expanded in x.im around 0
Applied rewrites65.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -4.6e-281) (* 1.0 (pow (- x.im) y.re)) (if (<= x.im 1.35e-244) (* 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 <= -4.6e-281) {
tmp = 1.0 * pow(-x_46_im, y_46_re);
} else if (x_46_im <= 1.35e-244) {
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 <= (-4.6d-281)) then
tmp = 1.0d0 * (-x_46im ** y_46re)
else if (x_46im <= 1.35d-244) 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 <= -4.6e-281) {
tmp = 1.0 * Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 1.35e-244) {
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 <= -4.6e-281: tmp = 1.0 * math.pow(-x_46_im, y_46_re) elif x_46_im <= 1.35e-244: 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 <= -4.6e-281) tmp = Float64(1.0 * (Float64(-x_46_im) ^ y_46_re)); elseif (x_46_im <= 1.35e-244) 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 <= -4.6e-281) tmp = 1.0 * (-x_46_im ^ y_46_re); elseif (x_46_im <= 1.35e-244) 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, -4.6e-281], N[(1.0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.35e-244], 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 -4.6 \cdot 10^{-281}:\\
\;\;\;\;1 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 1.35 \cdot 10^{-244}:\\
\;\;\;\;1 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -4.59999999999999978e-281Initial program 42.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-*.f6456.0
Applied rewrites56.0%
Taylor expanded in x.im around -inf
Applied rewrites51.3%
Taylor expanded in y.re around 0
Applied rewrites53.0%
if -4.59999999999999978e-281 < x.im < 1.35e-244Initial program 44.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-*.f6467.0
Applied rewrites67.0%
Taylor expanded in y.re around 0
Applied rewrites63.0%
Taylor expanded in x.im around 0
Applied rewrites55.2%
if 1.35e-244 < x.im Initial program 44.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-*.f6449.3
Applied rewrites49.3%
Taylor expanded in y.re around 0
Applied rewrites40.7%
Taylor expanded in x.re around 0
Applied rewrites48.2%
(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.9e-6) t_0 (if (<= y.re 9.5e+15) 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.9e-6) {
tmp = t_0;
} else if (y_46_re <= 9.5e+15) {
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.9d-6)) then
tmp = t_0
else if (y_46re <= 9.5d+15) 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.9e-6) {
tmp = t_0;
} else if (y_46_re <= 9.5e+15) {
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.9e-6: tmp = t_0 elif y_46_re <= 9.5e+15: 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.9e-6) tmp = t_0; elseif (y_46_re <= 9.5e+15) 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.9e-6) tmp = t_0; elseif (y_46_re <= 9.5e+15) 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.9e-6], t$95$0, If[LessEqual[y$46$re, 9.5e+15], 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.9 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 9.5 \cdot 10^{+15}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.9e-6 or 9.5e15 < y.re Initial program 48.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-*.f6470.6
Applied rewrites70.6%
Taylor expanded in y.re around 0
Applied rewrites64.6%
Taylor expanded in x.re around 0
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) (* 1.0 (pow (- x.re) y.re)) (* 1.0 (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 = 1.0 * pow(-x_46_re, y_46_re);
} else {
tmp = 1.0 * 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 = 1.0d0 * (-x_46re ** y_46re)
else
tmp = 1.0d0 * (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 = 1.0 * Math.pow(-x_46_re, y_46_re);
} else {
tmp = 1.0 * 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 = 1.0 * math.pow(-x_46_re, y_46_re) else: tmp = 1.0 * 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(1.0 * (Float64(-x_46_re) ^ y_46_re)); else tmp = Float64(1.0 * (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 = 1.0 * (-x_46_re ^ y_46_re); else tmp = 1.0 * (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[(1.0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -5 \cdot 10^{-303}:\\
\;\;\;\;1 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -4.9999999999999998e-303Initial program 43.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-*.f6450.7
Applied rewrites50.7%
Taylor expanded in y.re around 0
Applied rewrites52.4%
Taylor expanded in x.re around -inf
Applied rewrites54.0%
if -4.9999999999999998e-303 < x.re Initial program 43.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-*.f6458.2
Applied rewrites58.2%
Taylor expanded in y.re around 0
Applied rewrites49.2%
Taylor expanded in x.im around 0
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)))))