
(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 16 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
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(t_1 (* (log (hypot x.re x.im)) y.im))
(t_2 (cos t_1))
(t_3 (log (hypot x.im x.re)))
(t_4 (* t_3 y.im))
(t_5 (cos t_4))
(t_6 (sin t_4))
(t_7 (* (atan2 x.im x.re) y.re))
(t_8 (sin t_7))
(t_9 (cos t_7)))
(if (<= y.re -24.0)
(* (fma (- y.re) (* t_6 (atan2 x.im x.re)) t_5) t_0)
(if (<= y.re 0.00092)
(/
(*
(fma
(pow (* (* t_2 t_9) t_2) 1.5)
(pow t_9 1.5)
(- (pow (* t_8 (sin t_1)) 3.0)))
(pow (hypot x.im x.re) y.re))
(*
(fma
(* t_6 t_8)
(cos (fma (- (atan2 x.im x.re)) y.re t_4))
(pow (* t_5 t_9) 2.0))
(pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.re 4.1e+66)
(*
1.0
(pow
(fma
(*
(fma (* -0.125 x.im) (* (pow x.re -3.0) x.im) (/ 0.5 x.re))
x.im)
x.im
x.re)
y.re))
(* (fma (- y.im) (* t_8 t_3) t_9) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_1 = log(hypot(x_46_re, x_46_im)) * y_46_im;
double t_2 = cos(t_1);
double t_3 = log(hypot(x_46_im, x_46_re));
double t_4 = t_3 * y_46_im;
double t_5 = cos(t_4);
double t_6 = sin(t_4);
double t_7 = atan2(x_46_im, x_46_re) * y_46_re;
double t_8 = sin(t_7);
double t_9 = cos(t_7);
double tmp;
if (y_46_re <= -24.0) {
tmp = fma(-y_46_re, (t_6 * atan2(x_46_im, x_46_re)), t_5) * t_0;
} else if (y_46_re <= 0.00092) {
tmp = (fma(pow(((t_2 * t_9) * t_2), 1.5), pow(t_9, 1.5), -pow((t_8 * sin(t_1)), 3.0)) * pow(hypot(x_46_im, x_46_re), y_46_re)) / (fma((t_6 * t_8), cos(fma(-atan2(x_46_im, x_46_re), y_46_re, t_4)), pow((t_5 * t_9), 2.0)) * pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 4.1e+66) {
tmp = 1.0 * pow(fma((fma((-0.125 * x_46_im), (pow(x_46_re, -3.0) * x_46_im), (0.5 / x_46_re)) * x_46_im), x_46_im, x_46_re), y_46_re);
} else {
tmp = fma(-y_46_im, (t_8 * t_3), t_9) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) t_1 = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im) t_2 = cos(t_1) t_3 = log(hypot(x_46_im, x_46_re)) t_4 = Float64(t_3 * y_46_im) t_5 = cos(t_4) t_6 = sin(t_4) t_7 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_8 = sin(t_7) t_9 = cos(t_7) tmp = 0.0 if (y_46_re <= -24.0) tmp = Float64(fma(Float64(-y_46_re), Float64(t_6 * atan(x_46_im, x_46_re)), t_5) * t_0); elseif (y_46_re <= 0.00092) tmp = Float64(Float64(fma((Float64(Float64(t_2 * t_9) * t_2) ^ 1.5), (t_9 ^ 1.5), Float64(-(Float64(t_8 * sin(t_1)) ^ 3.0))) * (hypot(x_46_im, x_46_re) ^ y_46_re)) / Float64(fma(Float64(t_6 * t_8), cos(fma(Float64(-atan(x_46_im, x_46_re)), y_46_re, t_4)), (Float64(t_5 * t_9) ^ 2.0)) * (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); elseif (y_46_re <= 4.1e+66) tmp = Float64(1.0 * (fma(Float64(fma(Float64(-0.125 * x_46_im), Float64((x_46_re ^ -3.0) * x_46_im), Float64(0.5 / x_46_re)) * x_46_im), x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(fma(Float64(-y_46_im), Float64(t_8 * t_3), t_9) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * y$46$im), $MachinePrecision]}, Block[{t$95$5 = N[Cos[t$95$4], $MachinePrecision]}, Block[{t$95$6 = N[Sin[t$95$4], $MachinePrecision]}, Block[{t$95$7 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$8 = N[Sin[t$95$7], $MachinePrecision]}, Block[{t$95$9 = N[Cos[t$95$7], $MachinePrecision]}, If[LessEqual[y$46$re, -24.0], N[(N[((-y$46$re) * N[(t$95$6 * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 0.00092], N[(N[(N[(N[Power[N[(N[(t$95$2 * t$95$9), $MachinePrecision] * t$95$2), $MachinePrecision], 1.5], $MachinePrecision] * N[Power[t$95$9, 1.5], $MachinePrecision] + (-N[Power[N[(t$95$8 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision])), $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(t$95$6 * t$95$8), $MachinePrecision] * N[Cos[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$re + t$95$4), $MachinePrecision]], $MachinePrecision] + N[Power[N[(t$95$5 * t$95$9), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.1e+66], N[(1.0 * N[Power[N[(N[(N[(N[(-0.125 * x$46$im), $MachinePrecision] * N[(N[Power[x$46$re, -3.0], $MachinePrecision] * x$46$im), $MachinePrecision] + N[(0.5 / x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] * x$46$im + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[((-y$46$im) * N[(t$95$8 * t$95$3), $MachinePrecision] + t$95$9), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
t_2 := \cos t\_1\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_4 := t\_3 \cdot y.im\\
t_5 := \cos t\_4\\
t_6 := \sin t\_4\\
t_7 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_8 := \sin t\_7\\
t_9 := \cos t\_7\\
\mathbf{if}\;y.re \leq -24:\\
\;\;\;\;\mathsf{fma}\left(-y.re, t\_6 \cdot \tan^{-1}_* \frac{x.im}{x.re}, t\_5\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 0.00092:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\left(t\_2 \cdot t\_9\right) \cdot t\_2\right)}^{1.5}, {t\_9}^{1.5}, -{\left(t\_8 \cdot \sin t\_1\right)}^{3}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{\mathsf{fma}\left(t\_6 \cdot t\_8, \cos \left(\mathsf{fma}\left(-\tan^{-1}_* \frac{x.im}{x.re}, y.re, t\_4\right)\right), {\left(t\_5 \cdot t\_9\right)}^{2}\right) \cdot {\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.re \leq 4.1 \cdot 10^{+66}:\\
\;\;\;\;1 \cdot {\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.125 \cdot x.im, {x.re}^{-3} \cdot x.im, \frac{0.5}{x.re}\right) \cdot x.im, x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y.im, t\_8 \cdot t\_3, t\_9\right) \cdot t\_0\\
\end{array}
\end{array}
if y.re < -24Initial program 42.2%
Taylor expanded in y.re around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
if -24 < y.re < 9.2000000000000003e-4Initial program 33.2%
Applied rewrites79.7%
Applied rewrites84.4%
if 9.2000000000000003e-4 < y.re < 4.09999999999999994e66Initial program 14.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6428.2
Applied rewrites28.2%
Taylor expanded in y.re around 0
Applied rewrites48.2%
Taylor expanded in x.im around 0
Applied rewrites48.0%
Applied rewrites61.3%
if 4.09999999999999994e66 < y.re Initial program 41.5%
Taylor expanded in y.im around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites75.7%
Final simplification82.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re)))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(t_2 (* (log (hypot x.im x.re)) y.im)))
(if (<= y.re -1.3)
(* (fma (- y.re) (* (sin t_2) (atan2 x.im x.re)) (cos t_2)) t_1)
(if (<= y.re 1.95e-7)
(* t_0 (exp (* (- y.im) (atan2 x.im x.re))))
(* t_0 t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_2 = log(hypot(x_46_im, x_46_re)) * y_46_im;
double tmp;
if (y_46_re <= -1.3) {
tmp = fma(-y_46_re, (sin(t_2) * atan2(x_46_im, x_46_re)), cos(t_2)) * t_1;
} else if (y_46_re <= 1.95e-7) {
tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) t_2 = Float64(log(hypot(x_46_im, x_46_re)) * y_46_im) tmp = 0.0 if (y_46_re <= -1.3) tmp = Float64(fma(Float64(-y_46_re), Float64(sin(t_2) * atan(x_46_im, x_46_re)), cos(t_2)) * t_1); elseif (y_46_re <= 1.95e-7) tmp = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * t_1); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, -1.3], N[(N[((-y$46$re) * N[(N[Sin[t$95$2], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.95e-7], N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\\
\mathbf{if}\;y.re \leq -1.3:\\
\;\;\;\;\mathsf{fma}\left(-y.re, \sin t\_2 \cdot \tan^{-1}_* \frac{x.im}{x.re}, \cos t\_2\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1.95 \cdot 10^{-7}:\\
\;\;\;\;t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\end{array}
\end{array}
if y.re < -1.30000000000000004Initial program 40.9%
Taylor expanded in y.re around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites86.4%
if -1.30000000000000004 < y.re < 1.95000000000000012e-7Initial program 33.2%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6440.6
Applied rewrites40.6%
Taylor expanded in x.im around 0
Applied rewrites20.5%
Taylor expanded in y.re around 0
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6429.5
Applied rewrites29.5%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6483.8
Applied rewrites83.8%
if 1.95000000000000012e-7 < y.re Initial program 35.4%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6465.3
Applied rewrites65.3%
Final simplification80.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.re -0.018)
(* 1.0 (pow (hypot x.im x.re) y.re))
(if (<= y.re 1.95e-7)
(* t_0 (exp (* (- y.im) (atan2 x.im x.re))))
(*
t_0
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -0.018) {
tmp = 1.0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1.95e-7) {
tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -0.018) {
tmp = 1.0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1.95e-7) {
tmp = t_0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -0.018: tmp = 1.0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_re <= 1.95e-7: tmp = t_0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -0.018) tmp = Float64(1.0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 1.95e-7) tmp = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -0.018) tmp = 1.0 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 1.95e-7) tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.018], N[(1.0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.95e-7], N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -0.018:\\
\;\;\;\;1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.95 \cdot 10^{-7}:\\
\;\;\;\;t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.re < -0.0179999999999999986Initial program 40.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6481.9
Applied rewrites81.9%
Taylor expanded in y.re around 0
Applied rewrites83.4%
if -0.0179999999999999986 < y.re < 1.95000000000000012e-7Initial program 33.2%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6440.6
Applied rewrites40.6%
Taylor expanded in x.im around 0
Applied rewrites20.5%
Taylor expanded in y.re around 0
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6429.5
Applied rewrites29.5%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6483.8
Applied rewrites83.8%
if 1.95000000000000012e-7 < y.re Initial program 35.4%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6465.3
Applied rewrites65.3%
Final simplification79.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* 1.0 (pow (hypot x.im x.re) y.re))))
(if (<= y.re -0.018)
t_0
(if (<= y.re 4.5e-38)
(*
(cos (* (atan2 x.im x.re) y.re))
(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 = 1.0 * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -0.018) {
tmp = t_0;
} else if (y_46_re <= 4.5e-38) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -0.018) {
tmp = t_0;
} else if (y_46_re <= 4.5e-38) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = 1.0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -0.018: tmp = t_0 elif y_46_re <= 4.5e-38: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(1.0 * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -0.018) tmp = t_0; elseif (y_46_re <= 4.5e-38) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 1.0 * (hypot(x_46_im, x_46_re) ^ y_46_re); tmp = 0.0; if (y_46_re <= -0.018) tmp = t_0; elseif (y_46_re <= 4.5e-38) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.018], t$95$0, If[LessEqual[y$46$re, 4.5e-38], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -0.018:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4.5 \cdot 10^{-38}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.0179999999999999986 or 4.50000000000000009e-38 < y.re Initial program 37.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6471.4
Applied rewrites71.4%
Taylor expanded in y.re around 0
Applied rewrites73.6%
if -0.0179999999999999986 < y.re < 4.50000000000000009e-38Initial program 33.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6441.2
Applied rewrites41.2%
Taylor expanded in x.im around 0
Applied rewrites21.1%
Taylor expanded in y.re around 0
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6430.3
Applied rewrites30.3%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6485.3
Applied rewrites85.3%
Final simplification79.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5.4e+30)
(*
(pow
(pow
(fma
(fma (* -0.125 x.im) (* (pow x.re -3.0) x.im) (/ 0.5 x.re))
(* x.im x.im)
x.re)
2.0)
(* 0.5 y.re))
1.0)
(* 1.0 (pow (hypot 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 tmp;
if (y_46_im <= -5.4e+30) {
tmp = pow(pow(fma(fma((-0.125 * x_46_im), (pow(x_46_re, -3.0) * x_46_im), (0.5 / x_46_re)), (x_46_im * x_46_im), x_46_re), 2.0), (0.5 * y_46_re)) * 1.0;
} else {
tmp = 1.0 * pow(hypot(x_46_im, 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 (y_46_im <= -5.4e+30) tmp = Float64(((fma(fma(Float64(-0.125 * x_46_im), Float64((x_46_re ^ -3.0) * x_46_im), Float64(0.5 / x_46_re)), Float64(x_46_im * x_46_im), x_46_re) ^ 2.0) ^ Float64(0.5 * y_46_re)) * 1.0); else tmp = Float64(1.0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -5.4e+30], N[(N[Power[N[Power[N[(N[(N[(-0.125 * x$46$im), $MachinePrecision] * N[(N[Power[x$46$re, -3.0], $MachinePrecision] * x$46$im), $MachinePrecision] + N[(0.5 / x$46$re), $MachinePrecision]), $MachinePrecision] * N[(x$46$im * x$46$im), $MachinePrecision] + x$46$re), $MachinePrecision], 2.0], $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], N[(1.0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.4 \cdot 10^{+30}:\\
\;\;\;\;{\left({\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.125 \cdot x.im, {x.re}^{-3} \cdot x.im, \frac{0.5}{x.re}\right), x.im \cdot x.im, x.re\right)\right)}^{2}\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -5.3999999999999997e30Initial program 19.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6430.8
Applied rewrites30.8%
Taylor expanded in y.re around 0
Applied rewrites28.9%
Taylor expanded in x.im around 0
Applied rewrites24.0%
Applied rewrites43.2%
if -5.3999999999999997e30 < y.im Initial program 39.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6473.5
Applied rewrites73.5%
Taylor expanded in y.re around 0
Applied rewrites75.4%
Final simplification68.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.35e+93)
(*
1.0
(pow
(fma
(* (fma (* -0.125 x.im) (* (pow x.re -3.0) x.im) (/ 0.5 x.re)) x.im)
x.im
x.re)
y.re))
(* 1.0 (pow (hypot 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 tmp;
if (y_46_im <= -1.35e+93) {
tmp = 1.0 * pow(fma((fma((-0.125 * x_46_im), (pow(x_46_re, -3.0) * x_46_im), (0.5 / x_46_re)) * x_46_im), x_46_im, x_46_re), y_46_re);
} else {
tmp = 1.0 * pow(hypot(x_46_im, 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 (y_46_im <= -1.35e+93) tmp = Float64(1.0 * (fma(Float64(fma(Float64(-0.125 * x_46_im), Float64((x_46_re ^ -3.0) * x_46_im), Float64(0.5 / x_46_re)) * x_46_im), x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(1.0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -1.35e+93], N[(1.0 * N[Power[N[(N[(N[(N[(-0.125 * x$46$im), $MachinePrecision] * N[(N[Power[x$46$re, -3.0], $MachinePrecision] * x$46$im), $MachinePrecision] + N[(0.5 / x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] * x$46$im + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.35 \cdot 10^{+93}:\\
\;\;\;\;1 \cdot {\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.125 \cdot x.im, {x.re}^{-3} \cdot x.im, \frac{0.5}{x.re}\right) \cdot x.im, x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -1.35e93Initial program 17.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6430.7
Applied rewrites30.7%
Taylor expanded in y.re around 0
Applied rewrites27.8%
Taylor expanded in x.im around 0
Applied rewrites27.0%
Applied rewrites44.3%
if -1.35e93 < y.im Initial program 38.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6470.3
Applied rewrites70.3%
Taylor expanded in y.re around 0
Applied rewrites72.0%
Final simplification68.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -3.6e-10)
(* (pow (fma (/ (* x.re x.re) x.im) 0.5 x.im) y.re) 1.0)
(if (<= y.re 3600000.0)
(fma y.re (log (hypot x.re x.im)) 1.0)
(*
(pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -3.6e-10) {
tmp = pow(fma(((x_46_re * x_46_re) / x_46_im), 0.5, x_46_im), y_46_re) * 1.0;
} else if (y_46_re <= 3600000.0) {
tmp = fma(y_46_re, log(hypot(x_46_re, x_46_im)), 1.0);
} else {
tmp = pow((fma((0.5 / x_46_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -3.6e-10) tmp = Float64((fma(Float64(Float64(x_46_re * x_46_re) / x_46_im), 0.5, x_46_im) ^ y_46_re) * 1.0); elseif (y_46_re <= 3600000.0) tmp = fma(y_46_re, log(hypot(x_46_re, x_46_im)), 1.0); else tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), Float64(Float64(x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re) ^ y_46_re) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -3.6e-10], N[(N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5 + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 3600000.0], N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision], N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.6 \cdot 10^{-10}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 3600000:\\
\;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -3.6e-10Initial program 39.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6481.0
Applied rewrites81.0%
Taylor expanded in y.re around 0
Applied rewrites82.5%
Taylor expanded in x.re around 0
Applied rewrites79.6%
if -3.6e-10 < y.re < 3.6e6Initial program 33.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.6
Applied rewrites57.6%
Taylor expanded in y.re around 0
Applied rewrites57.3%
if 3.6e6 < y.re Initial program 35.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.5
Applied rewrites62.5%
Taylor expanded in y.re around 0
Applied rewrites66.2%
Taylor expanded in x.re around inf
Applied rewrites62.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 1.0 (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 * pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 * (hypot(x_46_im, x_46_re) ^ y_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 * (hypot(x_46_im, x_46_re) ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 35.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.9
Applied rewrites64.9%
Taylor expanded in y.re around 0
Applied rewrites66.0%
Final simplification66.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -3.6e-10)
(* (pow (fma (/ (* x.re x.re) x.im) 0.5 x.im) y.re) 1.0)
(if (<= y.re 3600000.0)
1.0
(*
(pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -3.6e-10) {
tmp = pow(fma(((x_46_re * x_46_re) / x_46_im), 0.5, x_46_im), y_46_re) * 1.0;
} else if (y_46_re <= 3600000.0) {
tmp = 1.0;
} else {
tmp = pow((fma((0.5 / x_46_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -3.6e-10) tmp = Float64((fma(Float64(Float64(x_46_re * x_46_re) / x_46_im), 0.5, x_46_im) ^ y_46_re) * 1.0); elseif (y_46_re <= 3600000.0) tmp = 1.0; else tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), Float64(Float64(x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re) ^ y_46_re) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -3.6e-10], N[(N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5 + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 3600000.0], 1.0, N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.6 \cdot 10^{-10}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 3600000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -3.6e-10Initial program 39.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6481.0
Applied rewrites81.0%
Taylor expanded in y.re around 0
Applied rewrites82.5%
Taylor expanded in x.re around 0
Applied rewrites79.6%
if -3.6e-10 < y.re < 3.6e6Initial program 33.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.6
Applied rewrites57.6%
Taylor expanded in y.re around 0
Applied rewrites56.7%
if 3.6e6 < y.re Initial program 35.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.5
Applied rewrites62.5%
Taylor expanded in y.re around 0
Applied rewrites66.2%
Taylor expanded in x.re around inf
Applied rewrites62.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -3.6e-10)
(* (pow (fma (/ (* x.re x.re) x.im) 0.5 x.im) y.re) 1.0)
(if (<= y.re 3600000.0)
1.0
(* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -3.6e-10) {
tmp = pow(fma(((x_46_re * x_46_re) / x_46_im), 0.5, x_46_im), y_46_re) * 1.0;
} else if (y_46_re <= 3600000.0) {
tmp = 1.0;
} else {
tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -3.6e-10) tmp = Float64((fma(Float64(Float64(x_46_re * x_46_re) / x_46_im), 0.5, x_46_im) ^ y_46_re) * 1.0); elseif (y_46_re <= 3600000.0) tmp = 1.0; else tmp = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -3.6e-10], N[(N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5 + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 3600000.0], 1.0, N[(N[Power[N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5 + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.6 \cdot 10^{-10}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 3600000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -3.6e-10Initial program 39.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6481.0
Applied rewrites81.0%
Taylor expanded in y.re around 0
Applied rewrites82.5%
Taylor expanded in x.re around 0
Applied rewrites79.6%
if -3.6e-10 < y.re < 3.6e6Initial program 33.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.6
Applied rewrites57.6%
Taylor expanded in y.re around 0
Applied rewrites56.7%
if 3.6e6 < y.re Initial program 35.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.5
Applied rewrites62.5%
Taylor expanded in y.re around 0
Applied rewrites66.2%
Taylor expanded in x.im around 0
Applied rewrites62.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) 1.0))) (if (<= y.re -0.0015) t_0 (if (<= y.re 3600000.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 = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * 1.0;
double tmp;
if (y_46_re <= -0.0015) {
tmp = t_0;
} else if (y_46_re <= 3600000.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((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -0.0015) tmp = t_0; elseif (y_46_re <= 3600000.0) tmp = 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[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5 + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -0.0015], t$95$0, If[LessEqual[y$46$re, 3600000.0], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -0.0015:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 3600000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.0015 or 3.6e6 < y.re Initial program 38.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6473.3
Applied rewrites73.3%
Taylor expanded in y.re around 0
Applied rewrites75.8%
Taylor expanded in x.im around 0
Applied rewrites71.7%
if -0.0015 < y.re < 3.6e6Initial program 33.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.6
Applied rewrites57.6%
Taylor expanded in y.re around 0
Applied rewrites56.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -0.0245) (* (pow (- x.re) y.re) 1.0) (if (<= x.re 6.2e-223) (* (pow x.im y.re) 1.0) (* (pow x.re y.re) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -0.0245) {
tmp = pow(-x_46_re, y_46_re) * 1.0;
} else if (x_46_re <= 6.2e-223) {
tmp = pow(x_46_im, y_46_re) * 1.0;
} else {
tmp = pow(x_46_re, y_46_re) * 1.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) :: tmp
if (x_46re <= (-0.0245d0)) then
tmp = (-x_46re ** y_46re) * 1.0d0
else if (x_46re <= 6.2d-223) then
tmp = (x_46im ** y_46re) * 1.0d0
else
tmp = (x_46re ** y_46re) * 1.0d0
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 <= -0.0245) {
tmp = Math.pow(-x_46_re, y_46_re) * 1.0;
} else if (x_46_re <= 6.2e-223) {
tmp = Math.pow(x_46_im, y_46_re) * 1.0;
} else {
tmp = Math.pow(x_46_re, y_46_re) * 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -0.0245: tmp = math.pow(-x_46_re, y_46_re) * 1.0 elif x_46_re <= 6.2e-223: tmp = math.pow(x_46_im, y_46_re) * 1.0 else: tmp = math.pow(x_46_re, y_46_re) * 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -0.0245) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * 1.0); elseif (x_46_re <= 6.2e-223) tmp = Float64((x_46_im ^ y_46_re) * 1.0); else tmp = Float64((x_46_re ^ y_46_re) * 1.0); 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 <= -0.0245) tmp = (-x_46_re ^ y_46_re) * 1.0; elseif (x_46_re <= 6.2e-223) tmp = (x_46_im ^ y_46_re) * 1.0; else tmp = (x_46_re ^ y_46_re) * 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -0.0245], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$re, 6.2e-223], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -0.0245:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.re \leq 6.2 \cdot 10^{-223}:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.re < -0.024500000000000001Initial program 26.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6467.8
Applied rewrites67.8%
Taylor expanded in y.re around 0
Applied rewrites66.2%
Taylor expanded in x.re around -inf
Applied rewrites66.2%
if -0.024500000000000001 < x.re < 6.20000000000000036e-223Initial program 43.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.0
Applied rewrites62.0%
Taylor expanded in y.re around 0
Applied rewrites61.8%
Taylor expanded in x.re around 0
Applied rewrites51.5%
if 6.20000000000000036e-223 < x.re Initial program 35.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6465.1
Applied rewrites65.1%
Taylor expanded in y.re around 0
Applied rewrites68.4%
Taylor expanded in x.im around 0
Applied rewrites67.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -0.98) (* (pow (- x.im) y.re) 1.0) (if (<= x.im 4.6e-38) (* (pow x.re y.re) 1.0) (* (pow x.im y.re) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -0.98) {
tmp = pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 4.6e-38) {
tmp = pow(x_46_re, y_46_re) * 1.0;
} else {
tmp = pow(x_46_im, y_46_re) * 1.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) :: tmp
if (x_46im <= (-0.98d0)) then
tmp = (-x_46im ** y_46re) * 1.0d0
else if (x_46im <= 4.6d-38) then
tmp = (x_46re ** y_46re) * 1.0d0
else
tmp = (x_46im ** y_46re) * 1.0d0
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 <= -0.98) {
tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 4.6e-38) {
tmp = Math.pow(x_46_re, y_46_re) * 1.0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -0.98: tmp = math.pow(-x_46_im, y_46_re) * 1.0 elif x_46_im <= 4.6e-38: tmp = math.pow(x_46_re, y_46_re) * 1.0 else: tmp = math.pow(x_46_im, y_46_re) * 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -0.98) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0); elseif (x_46_im <= 4.6e-38) tmp = Float64((x_46_re ^ y_46_re) * 1.0); else tmp = Float64((x_46_im ^ y_46_re) * 1.0); 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 <= -0.98) tmp = (-x_46_im ^ y_46_re) * 1.0; elseif (x_46_im <= 4.6e-38) tmp = (x_46_re ^ y_46_re) * 1.0; else tmp = (x_46_im ^ y_46_re) * 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -0.98], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 4.6e-38], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -0.98:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.im \leq 4.6 \cdot 10^{-38}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.im < -0.97999999999999998Initial program 35.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.2
Applied rewrites62.2%
Taylor expanded in y.re around 0
Applied rewrites67.3%
Taylor expanded in x.im around -inf
Applied rewrites67.3%
if -0.97999999999999998 < x.im < 4.60000000000000003e-38Initial program 41.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6463.4
Applied rewrites63.4%
Taylor expanded in y.re around 0
Applied rewrites64.1%
Taylor expanded in x.im around 0
Applied rewrites53.0%
if 4.60000000000000003e-38 < x.im Initial program 27.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6468.8
Applied rewrites68.8%
Taylor expanded in y.re around 0
Applied rewrites67.6%
Taylor expanded in x.re around 0
Applied rewrites67.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -200000.0) (* (pow x.re y.re) 1.0) (if (<= y.re 3.6e+27) 1.0 (* (pow x.im y.re) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -200000.0) {
tmp = pow(x_46_re, y_46_re) * 1.0;
} else if (y_46_re <= 3.6e+27) {
tmp = 1.0;
} else {
tmp = pow(x_46_im, y_46_re) * 1.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) :: tmp
if (y_46re <= (-200000.0d0)) then
tmp = (x_46re ** y_46re) * 1.0d0
else if (y_46re <= 3.6d+27) then
tmp = 1.0d0
else
tmp = (x_46im ** y_46re) * 1.0d0
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 <= -200000.0) {
tmp = Math.pow(x_46_re, y_46_re) * 1.0;
} else if (y_46_re <= 3.6e+27) {
tmp = 1.0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -200000.0: tmp = math.pow(x_46_re, y_46_re) * 1.0 elif y_46_re <= 3.6e+27: tmp = 1.0 else: tmp = math.pow(x_46_im, y_46_re) * 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -200000.0) tmp = Float64((x_46_re ^ y_46_re) * 1.0); elseif (y_46_re <= 3.6e+27) tmp = 1.0; else tmp = Float64((x_46_im ^ y_46_re) * 1.0); 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 <= -200000.0) tmp = (x_46_re ^ y_46_re) * 1.0; elseif (y_46_re <= 3.6e+27) tmp = 1.0; else tmp = (x_46_im ^ y_46_re) * 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -200000.0], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 3.6e+27], 1.0, N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -200000:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{+27}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -2e5Initial program 42.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6482.6
Applied rewrites82.6%
Taylor expanded in y.re around 0
Applied rewrites84.2%
Taylor expanded in x.im around 0
Applied rewrites65.4%
if -2e5 < y.re < 3.59999999999999983e27Initial program 31.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6458.7
Applied rewrites58.7%
Taylor expanded in y.re around 0
Applied rewrites54.0%
if 3.59999999999999983e27 < y.re Initial program 38.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6460.2
Applied rewrites60.2%
Taylor expanded in y.re around 0
Applied rewrites66.2%
Taylor expanded in x.re around 0
Applied rewrites58.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow x.im y.re) 1.0))) (if (<= y.re -3.6e-10) t_0 (if (<= y.re 3.6e+27) 1.0 t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(x_46_im, y_46_re) * 1.0;
double tmp;
if (y_46_re <= -3.6e-10) {
tmp = t_0;
} else if (y_46_re <= 3.6e+27) {
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 = (x_46im ** y_46re) * 1.0d0
if (y_46re <= (-3.6d-10)) then
tmp = t_0
else if (y_46re <= 3.6d+27) 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 = Math.pow(x_46_im, y_46_re) * 1.0;
double tmp;
if (y_46_re <= -3.6e-10) {
tmp = t_0;
} else if (y_46_re <= 3.6e+27) {
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 = math.pow(x_46_im, y_46_re) * 1.0 tmp = 0 if y_46_re <= -3.6e-10: tmp = t_0 elif y_46_re <= 3.6e+27: 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((x_46_im ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -3.6e-10) tmp = t_0; elseif (y_46_re <= 3.6e+27) 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 = (x_46_im ^ y_46_re) * 1.0; tmp = 0.0; if (y_46_re <= -3.6e-10) tmp = t_0; elseif (y_46_re <= 3.6e+27) 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[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -3.6e-10], t$95$0, If[LessEqual[y$46$re, 3.6e+27], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x.im}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -3.6 \cdot 10^{-10}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{+27}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -3.6e-10 or 3.59999999999999983e27 < y.re Initial program 39.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6472.2
Applied rewrites72.2%
Taylor expanded in y.re around 0
Applied rewrites75.6%
Taylor expanded in x.re around 0
Applied rewrites58.9%
if -3.6e-10 < y.re < 3.59999999999999983e27Initial program 32.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6458.6
Applied rewrites58.6%
Taylor expanded in y.re around 0
Applied rewrites55.5%
(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 35.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.9
Applied rewrites64.9%
Taylor expanded in y.re around 0
Applied rewrites31.3%
herbie shell --seed 2024283
(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)))))