
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (* (- y.re) (fma y.im (/ (atan2 x.im x.re) y.re) (- t_0))))))
(if (<= y.im -9e+262)
(* (cos (* (atan2 x.im x.re) y.re)) t_1)
(* (cos (* t_0 y.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(hypot(x_46_re, x_46_im));
double t_1 = exp((-y_46_re * fma(y_46_im, (atan2(x_46_im, x_46_re) / y_46_re), -t_0)));
double tmp;
if (y_46_im <= -9e+262) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_1;
} else {
tmp = cos((t_0 * y_46_im)) * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(Float64(Float64(-y_46_re) * fma(y_46_im, Float64(atan(x_46_im, x_46_re) / y_46_re), Float64(-t_0)))) tmp = 0.0 if (y_46_im <= -9e+262) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * t_1); else tmp = Float64(cos(Float64(t_0 * y_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[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[((-y$46$re) * N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision] + (-t$95$0)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -9e+262], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Cos[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{\left(-y.re\right) \cdot \mathsf{fma}\left(y.im, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}, -t\_0\right)}\\
\mathbf{if}\;y.im \leq -9 \cdot 10^{+262}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\cos \left(t\_0 \cdot y.im\right) \cdot t\_1\\
\end{array}
\end{array}
if y.im < -8.99999999999999945e262Initial program 41.7%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6450.1
Applied rewrites50.1%
Taylor expanded in y.re around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6450.0
Applied rewrites50.0%
Taylor expanded in y.im around 0
Applied rewrites91.7%
if -8.99999999999999945e262 < y.im Initial program 39.5%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6454.4
Applied rewrites54.4%
Taylor expanded in y.re around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6470.8
Applied rewrites70.8%
Taylor expanded in y.im around inf
Applied rewrites82.8%
Final simplification83.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)) (t_1 (log (hypot x.re x.im))))
(if (<= y.re -4.2e+132)
(* 1.0 t_0)
(if (<= y.re 6.2e+60)
(*
(cos (* (atan2 x.im x.re) y.re))
(exp (* (- y.re) (fma y.im (/ (atan2 x.im x.re) y.re) (- t_1)))))
(* t_0 (cos (* t_1 y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -4.2e+132) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 6.2e+60) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp((-y_46_re * fma(y_46_im, (atan2(x_46_im, x_46_re) / y_46_re), -t_1)));
} else {
tmp = t_0 * cos((t_1 * y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -4.2e+132) tmp = Float64(1.0 * t_0); elseif (y_46_re <= 6.2e+60) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(Float64(-y_46_re) * fma(y_46_im, Float64(atan(x_46_im, x_46_re) / y_46_re), Float64(-t_1))))); else tmp = Float64(t_0 * cos(Float64(t_1 * y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -4.2e+132], N[(1.0 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 6.2e+60], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$re) * N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision] + (-t$95$1)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -4.2 \cdot 10^{+132}:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{+60}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\left(-y.re\right) \cdot \mathsf{fma}\left(y.im, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}, -t\_1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(t\_1 \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -4.19999999999999987e132Initial program 36.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6465.9
Applied rewrites65.9%
Taylor expanded in y.re around 0
Applied rewrites81.7%
if -4.19999999999999987e132 < y.re < 6.2000000000000001e60Initial program 42.3%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6454.6
Applied rewrites54.6%
Taylor expanded in y.re around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.1
Applied rewrites80.1%
Taylor expanded in y.im around 0
Applied rewrites81.3%
if 6.2000000000000001e60 < y.re Initial program 34.4%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6457.4
Applied rewrites57.4%
Taylor expanded in y.re around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6457.4
Applied rewrites57.4%
Taylor expanded in y.im around inf
Applied rewrites86.9%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6486.9
Applied rewrites86.9%
Final simplification82.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (log (hypot x.re x.im)) y.im)))
(t_1 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -4.2e+132)
(* 1.0 t_1)
(if (<= y.re -2.3e-9)
(*
(cos (* (atan2 x.im x.re) y.re))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
(if (<= y.re 4.3e-23)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_0)
(* t_1 t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((log(hypot(x_46_re, x_46_im)) * y_46_im));
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -4.2e+132) {
tmp = 1.0 * t_1;
} else if (y_46_re <= -2.3e-9) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 4.3e-23) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = t_1 * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
double t_1 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -4.2e+132) {
tmp = 1.0 * t_1;
} else if (y_46_re <= -2.3e-9) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 4.3e-23) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = t_1 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) t_1 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -4.2e+132: tmp = 1.0 * t_1 elif y_46_re <= -2.3e-9: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) elif y_46_re <= 4.3e-23: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * t_0 else: tmp = t_1 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) t_1 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -4.2e+132) tmp = Float64(1.0 * t_1); elseif (y_46_re <= -2.3e-9) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_re <= 4.3e-23) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * t_0); else tmp = Float64(t_1 * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((log(hypot(x_46_re, x_46_im)) * y_46_im)); t_1 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -4.2e+132) tmp = 1.0 * t_1; elseif (y_46_re <= -2.3e-9) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); elseif (y_46_re <= 4.3e-23) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_0; else tmp = t_1 * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -4.2e+132], N[(1.0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, -2.3e-9], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-23], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -4.2 \cdot 10^{+132}:\\
\;\;\;\;1 \cdot t\_1\\
\mathbf{elif}\;y.re \leq -2.3 \cdot 10^{-9}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-23}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -4.19999999999999987e132Initial program 36.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6465.9
Applied rewrites65.9%
Taylor expanded in y.re around 0
Applied rewrites81.7%
if -4.19999999999999987e132 < y.re < -2.2999999999999999e-9Initial program 49.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6480.1
Applied rewrites80.1%
if -2.2999999999999999e-9 < y.re < 4.30000000000000002e-23Initial program 41.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6445.5
Applied rewrites45.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6479.9
Applied rewrites79.9%
if 4.30000000000000002e-23 < y.re Initial program 33.8%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6458.3
Applied rewrites58.3%
Taylor expanded in y.re around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6462.0
Applied rewrites62.0%
Taylor expanded in y.im around inf
Applied rewrites83.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.2
Applied rewrites83.2%
Final simplification81.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (log (hypot x.re x.im)) y.im)))
(t_1 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -1e+157)
(* 1.0 t_1)
(if (<= y.re -3.4e-18)
(* (fma (* (* y.re y.re) -0.5) (pow (atan2 x.im x.re) 2.0) 1.0) t_1)
(if (<= y.re 4.3e-23)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_0)
(* t_1 t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((log(hypot(x_46_re, x_46_im)) * y_46_im));
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1e+157) {
tmp = 1.0 * t_1;
} else if (y_46_re <= -3.4e-18) {
tmp = fma(((y_46_re * y_46_re) * -0.5), pow(atan2(x_46_im, x_46_re), 2.0), 1.0) * t_1;
} else if (y_46_re <= 4.3e-23) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = t_1 * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) t_1 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -1e+157) tmp = Float64(1.0 * t_1); elseif (y_46_re <= -3.4e-18) tmp = Float64(fma(Float64(Float64(y_46_re * y_46_re) * -0.5), (atan(x_46_im, x_46_re) ^ 2.0), 1.0) * t_1); elseif (y_46_re <= 4.3e-23) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * t_0); else tmp = Float64(t_1 * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1e+157], N[(1.0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, -3.4e-18], N[(N[(N[(N[(y$46$re * y$46$re), $MachinePrecision] * -0.5), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-23], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{+157}:\\
\;\;\;\;1 \cdot t\_1\\
\mathbf{elif}\;y.re \leq -3.4 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(\left(y.re \cdot y.re\right) \cdot -0.5, {\tan^{-1}_* \frac{x.im}{x.re}}^{2}, 1\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-23}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -9.99999999999999983e156Initial program 41.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6467.7
Applied rewrites67.7%
Taylor expanded in y.re around 0
Applied rewrites82.4%
if -9.99999999999999983e156 < y.re < -3.40000000000000001e-18Initial program 40.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6470.5
Applied rewrites70.5%
Taylor expanded in y.re around 0
Applied rewrites78.6%
if -3.40000000000000001e-18 < y.re < 4.30000000000000002e-23Initial program 42.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6444.0
Applied rewrites44.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.0
Applied rewrites80.0%
if 4.30000000000000002e-23 < y.re Initial program 33.8%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6458.3
Applied rewrites58.3%
Taylor expanded in y.re around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6462.0
Applied rewrites62.0%
Taylor expanded in y.im around inf
Applied rewrites83.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.2
Applied rewrites83.2%
Final simplification81.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -105000000000.0) (* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) 1.0) (* (pow (hypot x.re x.im) y.re) (cos (* (log (hypot x.re x.im)) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -105000000000.0) {
tmp = pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * 1.0;
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * cos((log(hypot(x_46_re, x_46_im)) * y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -105000000000.0) tmp = Float64((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * 1.0); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -105000000000.0], N[(N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -105000000000:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.im < -1.05e11Initial program 38.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6429.0
Applied rewrites29.0%
Taylor expanded in x.im around inf
Applied rewrites31.5%
Taylor expanded in y.re around 0
Applied rewrites31.5%
Taylor expanded in x.im around 0
Applied rewrites41.0%
if -1.05e11 < y.im Initial program 39.9%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6451.0
Applied rewrites51.0%
Taylor expanded in y.re around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6470.3
Applied rewrites70.3%
Taylor expanded in y.im around inf
Applied rewrites84.9%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6472.2
Applied rewrites72.2%
Final simplification65.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.im 1e+230)
(* 1.0 (pow (hypot x.re x.im) y.re))
(*
(cos (* (atan2 x.im x.re) y.re))
(pow
(* (fma 0.5 (* (/ (- x.re) -1.0) (/ x.re (* x.im x.im))) 1.0) 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 <= 1e+230) {
tmp = 1.0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow((fma(0.5, ((-x_46_re / -1.0) * (x_46_re / (x_46_im * x_46_im))), 1.0) * 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 <= 1e+230) tmp = Float64(1.0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (Float64(fma(0.5, Float64(Float64(Float64(-x_46_re) / -1.0) * Float64(x_46_re / Float64(x_46_im * x_46_im))), 1.0) * x_46_im) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, 1e+230], N[(1.0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[N[(N[(0.5 * N[(N[((-x$46$re) / -1.0), $MachinePrecision] * N[(x$46$re / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 10^{+230}:\\
\;\;\;\;1 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{fma}\left(0.5, \frac{-x.re}{-1} \cdot \frac{x.re}{x.im \cdot x.im}, 1\right) \cdot x.im\right)}^{y.re}\\
\end{array}
\end{array}
if x.im < 1.0000000000000001e230Initial program 43.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.7
Applied rewrites57.7%
Taylor expanded in y.re around 0
Applied rewrites63.7%
if 1.0000000000000001e230 < x.im Initial program 0.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6477.3
Applied rewrites77.3%
Taylor expanded in x.im around inf
Applied rewrites54.6%
Applied rewrites77.3%
Final simplification64.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im 5e+209) (* 1.0 (pow (hypot x.re x.im) y.re)) (* (pow x.im y.re) (cos (* (atan2 x.im x.re) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= 5e+209) {
tmp = 1.0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = pow(x_46_im, y_46_re) * cos((atan2(x_46_im, x_46_re) * y_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 tmp;
if (x_46_im <= 5e+209) {
tmp = 1.0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = Math.pow(x_46_im, y_46_re) * Math.cos((Math.atan2(x_46_im, 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_im <= 5e+209: tmp = 1.0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) else: tmp = math.pow(x_46_im, y_46_re) * math.cos((math.atan2(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 (x_46_im <= 5e+209) tmp = Float64(1.0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64((x_46_im ^ y_46_re) * cos(Float64(atan(x_46_im, 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_im <= 5e+209) tmp = 1.0 * (hypot(x_46_re, x_46_im) ^ y_46_re); else tmp = (x_46_im ^ y_46_re) * cos((atan2(x_46_im, 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$im, 5e+209], N[(1.0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 5 \cdot 10^{+209}:\\
\;\;\;\;1 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\end{array}
\end{array}
if x.im < 4.99999999999999964e209Initial program 43.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.7
Applied rewrites57.7%
Taylor expanded in y.re around 0
Applied rewrites63.8%
if 4.99999999999999964e209 < x.im Initial program 0.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6475.1
Applied rewrites75.1%
Taylor expanded in x.re around 0
Applied rewrites75.1%
Final simplification64.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -6.2e-5)
(*
(pow
(* (fma 0.5 (* (/ (- x.re) -1.0) (/ x.re (* x.im x.im))) 1.0) x.im)
y.re)
1.0)
(if (<= y.re 0.0028)
(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 <= -6.2e-5) {
tmp = pow((fma(0.5, ((-x_46_re / -1.0) * (x_46_re / (x_46_im * x_46_im))), 1.0) * x_46_im), y_46_re) * 1.0;
} else if (y_46_re <= 0.0028) {
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 <= -6.2e-5) tmp = Float64((Float64(fma(0.5, Float64(Float64(Float64(-x_46_re) / -1.0) * Float64(x_46_re / Float64(x_46_im * x_46_im))), 1.0) * x_46_im) ^ y_46_re) * 1.0); elseif (y_46_re <= 0.0028) 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, -6.2e-5], N[(N[Power[N[(N[(0.5 * N[(N[((-x$46$re) / -1.0), $MachinePrecision] * N[(x$46$re / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 0.0028], 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 -6.2 \cdot 10^{-5}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{-x.re}{-1} \cdot \frac{x.re}{x.im \cdot x.im}, 1\right) \cdot x.im\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 0.0028:\\
\;\;\;\;\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 < -6.20000000000000027e-5Initial program 41.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6467.3
Applied rewrites67.3%
Taylor expanded in x.im around inf
Applied rewrites64.4%
Taylor expanded in y.re around 0
Applied rewrites65.3%
Applied rewrites68.4%
if -6.20000000000000027e-5 < y.re < 0.00279999999999999997Initial program 41.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6447.3
Applied rewrites47.3%
Taylor expanded in y.re around 0
Applied rewrites46.4%
if 0.00279999999999999997 < y.re Initial program 33.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6471.8
Applied rewrites71.8%
Taylor expanded in x.im around inf
Applied rewrites42.5%
Taylor expanded in y.re around 0
Applied rewrites54.0%
Taylor expanded in x.re around inf
Applied rewrites73.5%
Final simplification59.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -19000.0) (* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) 1.0) (* 1.0 (pow (hypot x.re x.im) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -19000.0) {
tmp = pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * 1.0;
} else {
tmp = 1.0 * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -19000.0) tmp = Float64((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * 1.0); else tmp = Float64(1.0 * (hypot(x_46_re, x_46_im) ^ 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, -19000.0], N[(N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(1.0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -19000:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -19000Initial program 38.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6429.0
Applied rewrites29.0%
Taylor expanded in x.im around inf
Applied rewrites31.5%
Taylor expanded in y.re around 0
Applied rewrites31.5%
Taylor expanded in x.im around 0
Applied rewrites41.0%
if -19000 < y.im Initial program 39.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6467.7
Applied rewrites67.7%
Taylor expanded in y.re around 0
Applied rewrites71.3%
Final simplification64.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
1.0)))
(if (<= y.re -8.5e-58) t_0 (if (<= y.re 0.0028) 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((0.5 / x_46_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * 1.0;
double tmp;
if (y_46_re <= -8.5e-58) {
tmp = t_0;
} else if (y_46_re <= 0.0028) {
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((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) tmp = 0.0 if (y_46_re <= -8.5e-58) tmp = t_0; elseif (y_46_re <= 0.0028) 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[(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]}, If[LessEqual[y$46$re, -8.5e-58], t$95$0, If[LessEqual[y$46$re, 0.0028], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\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\\
\mathbf{if}\;y.re \leq -8.5 \cdot 10^{-58}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.0028:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -8.5000000000000004e-58 or 0.00279999999999999997 < y.re Initial program 38.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6467.3
Applied rewrites67.3%
Taylor expanded in x.im around inf
Applied rewrites50.3%
Taylor expanded in y.re around 0
Applied rewrites56.1%
Taylor expanded in x.re around inf
Applied rewrites68.1%
if -8.5000000000000004e-58 < y.re < 0.00279999999999999997Initial program 41.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6447.7
Applied rewrites47.7%
Taylor expanded in y.re around 0
Applied rewrites46.4%
Final simplification59.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) 1.0))) (if (<= y.re -7.6e-11) t_0 (if (<= y.re 0.0028) 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(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * 1.0;
double tmp;
if (y_46_re <= -7.6e-11) {
tmp = t_0;
} else if (y_46_re <= 0.0028) {
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(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -7.6e-11) tmp = t_0; elseif (y_46_re <= 0.0028) 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[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -7.6e-11], t$95$0, If[LessEqual[y$46$re, 0.0028], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -7.6 \cdot 10^{-11}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.0028:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -7.5999999999999996e-11 or 0.00279999999999999997 < y.re Initial program 38.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.9
Applied rewrites69.9%
Taylor expanded in x.im around inf
Applied rewrites52.7%
Taylor expanded in y.re around 0
Applied rewrites59.1%
Taylor expanded in x.im around 0
Applied rewrites70.2%
if -7.5999999999999996e-11 < y.re < 0.00279999999999999997Initial program 41.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6446.9
Applied rewrites46.9%
Taylor expanded in y.re around 0
Applied rewrites45.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (pow x.im y.re) 1.0)))
(if (<= y.re -1.02e+102)
t_0
(if (<= y.re -1.15e-9)
(* (pow x.re y.re) 1.0)
(if (<= y.re 0.23) 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 <= -1.02e+102) {
tmp = t_0;
} else if (y_46_re <= -1.15e-9) {
tmp = pow(x_46_re, y_46_re) * 1.0;
} else if (y_46_re <= 0.23) {
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 <= (-1.02d+102)) then
tmp = t_0
else if (y_46re <= (-1.15d-9)) then
tmp = (x_46re ** y_46re) * 1.0d0
else if (y_46re <= 0.23d0) 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 <= -1.02e+102) {
tmp = t_0;
} else if (y_46_re <= -1.15e-9) {
tmp = Math.pow(x_46_re, y_46_re) * 1.0;
} else if (y_46_re <= 0.23) {
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 <= -1.02e+102: tmp = t_0 elif y_46_re <= -1.15e-9: tmp = math.pow(x_46_re, y_46_re) * 1.0 elif y_46_re <= 0.23: 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 <= -1.02e+102) tmp = t_0; elseif (y_46_re <= -1.15e-9) tmp = Float64((x_46_re ^ y_46_re) * 1.0); elseif (y_46_re <= 0.23) 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 <= -1.02e+102) tmp = t_0; elseif (y_46_re <= -1.15e-9) tmp = (x_46_re ^ y_46_re) * 1.0; elseif (y_46_re <= 0.23) 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, -1.02e+102], t$95$0, If[LessEqual[y$46$re, -1.15e-9], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 0.23], 1.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x.im}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -1.02 \cdot 10^{+102}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -1.15 \cdot 10^{-9}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 0.23:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.01999999999999999e102 or 0.23000000000000001 < y.re Initial program 35.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.9
Applied rewrites69.9%
Taylor expanded in x.im around inf
Applied rewrites51.0%
Taylor expanded in y.re around 0
Applied rewrites59.8%
Taylor expanded in x.re around 0
Applied rewrites63.4%
if -1.01999999999999999e102 < y.re < -1.15e-9Initial program 52.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.9
Applied rewrites69.9%
Taylor expanded in x.im around inf
Applied rewrites61.3%
Taylor expanded in y.re around 0
Applied rewrites55.3%
Taylor expanded in x.im around 0
Applied rewrites62.3%
if -1.15e-9 < y.re < 0.23000000000000001Initial program 41.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6446.9
Applied rewrites46.9%
Taylor expanded in y.re around 0
Applied rewrites45.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -1.2e-105) (* (pow (- x.im) y.re) 1.0) (if (<= x.im 2.5e-26) (* (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 <= -1.2e-105) {
tmp = pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 2.5e-26) {
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 <= (-1.2d-105)) then
tmp = (-x_46im ** y_46re) * 1.0d0
else if (x_46im <= 2.5d-26) 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 <= -1.2e-105) {
tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 2.5e-26) {
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 <= -1.2e-105: tmp = math.pow(-x_46_im, y_46_re) * 1.0 elif x_46_im <= 2.5e-26: 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 <= -1.2e-105) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0); elseif (x_46_im <= 2.5e-26) 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 <= -1.2e-105) tmp = (-x_46_im ^ y_46_re) * 1.0; elseif (x_46_im <= 2.5e-26) 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, -1.2e-105], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 2.5e-26], 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 -1.2 \cdot 10^{-105}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.im \leq 2.5 \cdot 10^{-26}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.im < -1.20000000000000007e-105Initial program 39.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6451.5
Applied rewrites51.5%
Taylor expanded in x.im around inf
Applied rewrites25.0%
Taylor expanded in y.re around 0
Applied rewrites36.7%
Taylor expanded in x.im around -inf
Applied rewrites61.2%
if -1.20000000000000007e-105 < x.im < 2.5000000000000001e-26Initial program 44.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.3
Applied rewrites64.3%
Taylor expanded in x.im around inf
Applied rewrites37.4%
Taylor expanded in y.re around 0
Applied rewrites37.1%
Taylor expanded in x.im around 0
Applied rewrites55.4%
if 2.5000000000000001e-26 < x.im Initial program 33.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6460.5
Applied rewrites60.5%
Taylor expanded in x.im around inf
Applied rewrites49.4%
Taylor expanded in y.re around 0
Applied rewrites49.7%
Taylor expanded in x.re around 0
Applied rewrites56.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow x.im y.re) 1.0))) (if (<= y.re -6.9e-12) t_0 (if (<= y.re 0.23) 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 <= -6.9e-12) {
tmp = t_0;
} else if (y_46_re <= 0.23) {
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 <= (-6.9d-12)) then
tmp = t_0
else if (y_46re <= 0.23d0) 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 <= -6.9e-12) {
tmp = t_0;
} else if (y_46_re <= 0.23) {
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 <= -6.9e-12: tmp = t_0 elif y_46_re <= 0.23: 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 <= -6.9e-12) tmp = t_0; elseif (y_46_re <= 0.23) 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 <= -6.9e-12) tmp = t_0; elseif (y_46_re <= 0.23) 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, -6.9e-12], t$95$0, If[LessEqual[y$46$re, 0.23], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x.im}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -6.9 \cdot 10^{-12}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.23:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -6.9000000000000001e-12 or 0.23000000000000001 < y.re Initial program 37.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6470.1
Applied rewrites70.1%
Taylor expanded in x.im around inf
Applied rewrites53.1%
Taylor expanded in y.re around 0
Applied rewrites59.4%
Taylor expanded in x.re around 0
Applied rewrites57.7%
if -6.9000000000000001e-12 < y.re < 0.23000000000000001Initial program 41.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6446.4
Applied rewrites46.4%
Taylor expanded in y.re around 0
Applied rewrites45.0%
(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 39.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.4
Applied rewrites59.4%
Taylor expanded in y.re around 0
Applied rewrites22.4%
herbie shell --seed 2024249
(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)))))