
(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 (* (atan2 x.im x.re) y.re))
(t_1 (exp (* (- y.im) (atan2 x.im x.re))))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -9e+20)
(* (cos t_0) t_2)
(if (<= y.re 6.2e-167)
(* t_1 (cos (* (log (sqrt (pow (hypot x.im x.re) 0.25))) y.im)))
(if (<= y.re 5600.0)
(*
t_1
(cos (+ t_0 (* (log (pow (exp 0.5) (log (hypot x.re x.im)))) y.im))))
(* (cos (* (log (sqrt (hypot x.re x.im))) y.im)) t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
double t_2 = 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)));
double tmp;
if (y_46_re <= -9e+20) {
tmp = cos(t_0) * t_2;
} else if (y_46_re <= 6.2e-167) {
tmp = t_1 * cos((log(sqrt(pow(hypot(x_46_im, x_46_re), 0.25))) * y_46_im));
} else if (y_46_re <= 5600.0) {
tmp = t_1 * cos((t_0 + (log(pow(exp(0.5), log(hypot(x_46_re, x_46_im)))) * y_46_im)));
} else {
tmp = cos((log(sqrt(hypot(x_46_re, x_46_im))) * y_46_im)) * t_2;
}
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.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
double t_2 = 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)));
double tmp;
if (y_46_re <= -9e+20) {
tmp = Math.cos(t_0) * t_2;
} else if (y_46_re <= 6.2e-167) {
tmp = t_1 * Math.cos((Math.log(Math.sqrt(Math.pow(Math.hypot(x_46_im, x_46_re), 0.25))) * y_46_im));
} else if (y_46_re <= 5600.0) {
tmp = t_1 * Math.cos((t_0 + (Math.log(Math.pow(Math.exp(0.5), Math.log(Math.hypot(x_46_re, x_46_im)))) * y_46_im)));
} else {
tmp = Math.cos((Math.log(Math.sqrt(Math.hypot(x_46_re, x_46_im))) * y_46_im)) * t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re t_1 = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) t_2 = 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))) tmp = 0 if y_46_re <= -9e+20: tmp = math.cos(t_0) * t_2 elif y_46_re <= 6.2e-167: tmp = t_1 * math.cos((math.log(math.sqrt(math.pow(math.hypot(x_46_im, x_46_re), 0.25))) * y_46_im)) elif y_46_re <= 5600.0: tmp = t_1 * math.cos((t_0 + (math.log(math.pow(math.exp(0.5), math.log(math.hypot(x_46_re, x_46_im)))) * y_46_im))) else: tmp = math.cos((math.log(math.sqrt(math.hypot(x_46_re, x_46_im))) * y_46_im)) * t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) t_2 = 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))) tmp = 0.0 if (y_46_re <= -9e+20) tmp = Float64(cos(t_0) * t_2); elseif (y_46_re <= 6.2e-167) tmp = Float64(t_1 * cos(Float64(log(sqrt((hypot(x_46_im, x_46_re) ^ 0.25))) * y_46_im))); elseif (y_46_re <= 5600.0) tmp = Float64(t_1 * cos(Float64(t_0 + Float64(log((exp(0.5) ^ log(hypot(x_46_re, x_46_im)))) * y_46_im)))); else tmp = Float64(cos(Float64(log(sqrt(hypot(x_46_re, x_46_im))) * y_46_im)) * t_2); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = exp((-y_46_im * atan2(x_46_im, x_46_re))); t_2 = 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))); tmp = 0.0; if (y_46_re <= -9e+20) tmp = cos(t_0) * t_2; elseif (y_46_re <= 6.2e-167) tmp = t_1 * cos((log(sqrt((hypot(x_46_im, x_46_re) ^ 0.25))) * y_46_im)); elseif (y_46_re <= 5600.0) tmp = t_1 * cos((t_0 + (log((exp(0.5) ^ log(hypot(x_46_re, x_46_im)))) * y_46_im))); else tmp = cos((log(sqrt(hypot(x_46_re, x_46_im))) * y_46_im)) * t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[y$46$re, -9e+20], N[(N[Cos[t$95$0], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 6.2e-167], N[(t$95$1 * N[Cos[N[(N[Log[N[Sqrt[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], 0.25], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5600.0], N[(t$95$1 * N[Cos[N[(t$95$0 + N[(N[Log[N[Power[N[Exp[0.5], $MachinePrecision], N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[Log[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_2 := 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{if}\;y.re \leq -9 \cdot 10^{+20}:\\
\;\;\;\;\cos t\_0 \cdot t\_2\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-167}:\\
\;\;\;\;t\_1 \cdot \cos \left(\log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 5600:\\
\;\;\;\;t\_1 \cdot \cos \left(t\_0 + \log \left({\left(e^{0.5}\right)}^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) \cdot t\_2\\
\end{array}
\end{array}
if y.re < -9e20Initial program 42.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6484.7
Applied rewrites84.7%
if -9e20 < y.re < 6.2e-167Initial program 46.8%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites79.2%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.1
Applied rewrites80.1%
Applied rewrites86.7%
if 6.2e-167 < y.re < 5600Initial program 37.4%
Taylor expanded in y.re around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6437.4
Applied rewrites37.4%
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f64N/A
pow1/2N/A
pow-to-expN/A
rem-log-expN/A
pow-to-expN/A
log-powN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-log.f6483.8
Applied rewrites83.8%
Taylor expanded in y.im around inf
Applied rewrites83.8%
if 5600 < y.re Initial program 29.8%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6482.5
Applied rewrites82.5%
Final simplification85.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (hypot x.re x.im)))) (t_1 (* (atan2 x.im x.re) y.im)))
(if (<= y.re 8.5e+93)
(*
(cos
(+
(* (atan2 x.im x.re) y.re)
(* (log (pow (exp 0.5) (log (hypot x.re x.im)))) y.im)))
(exp (* (- t_0 (/ t_1 y.re)) y.re)))
(*
(cos (* t_0 y.im))
(exp (- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(hypot(x_46_re, x_46_im)));
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (y_46_re <= 8.5e+93) {
tmp = cos(((atan2(x_46_im, x_46_re) * y_46_re) + (log(pow(exp(0.5), log(hypot(x_46_re, x_46_im)))) * y_46_im))) * exp(((t_0 - (t_1 / y_46_re)) * y_46_re));
} else {
tmp = cos((t_0 * y_46_im)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_1));
}
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.log(Math.sqrt(Math.hypot(x_46_re, x_46_im)));
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (y_46_re <= 8.5e+93) {
tmp = Math.cos(((Math.atan2(x_46_im, x_46_re) * y_46_re) + (Math.log(Math.pow(Math.exp(0.5), Math.log(Math.hypot(x_46_re, x_46_im)))) * y_46_im))) * Math.exp(((t_0 - (t_1 / y_46_re)) * y_46_re));
} else {
tmp = Math.cos((t_0 * y_46_im)) * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_1));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(math.hypot(x_46_re, x_46_im))) t_1 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if y_46_re <= 8.5e+93: tmp = math.cos(((math.atan2(x_46_im, x_46_re) * y_46_re) + (math.log(math.pow(math.exp(0.5), math.log(math.hypot(x_46_re, x_46_im)))) * y_46_im))) * math.exp(((t_0 - (t_1 / y_46_re)) * y_46_re)) else: tmp = math.cos((t_0 * y_46_im)) * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_1)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(hypot(x_46_re, x_46_im))) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (y_46_re <= 8.5e+93) tmp = Float64(cos(Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) + Float64(log((exp(0.5) ^ log(hypot(x_46_re, x_46_im)))) * y_46_im))) * exp(Float64(Float64(t_0 - Float64(t_1 / y_46_re)) * y_46_re))); else tmp = Float64(cos(Float64(t_0 * y_46_im)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_1))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(hypot(x_46_re, x_46_im))); t_1 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (y_46_re <= 8.5e+93) tmp = cos(((atan2(x_46_im, x_46_re) * y_46_re) + (log((exp(0.5) ^ log(hypot(x_46_re, x_46_im)))) * y_46_im))) * exp(((t_0 - (t_1 / y_46_re)) * y_46_re)); else tmp = cos((t_0 * y_46_im)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_1)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, 8.5e+93], N[(N[Cos[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] + N[(N[Log[N[Power[N[Exp[0.5], $MachinePrecision], N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(t$95$0 - N[(t$95$1 / y$46$re), $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(t$95$0 * y$46$im), $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] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.re \leq 8.5 \cdot 10^{+93}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \log \left({\left(e^{0.5}\right)}^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right) \cdot y.im\right) \cdot e^{\left(t\_0 - \frac{t\_1}{y.re}\right) \cdot y.re}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(t\_0 \cdot y.im\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_1}\\
\end{array}
\end{array}
if y.re < 8.5000000000000005e93Initial program 42.9%
Taylor expanded in y.re around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6442.6
Applied rewrites42.6%
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f64N/A
pow1/2N/A
pow-to-expN/A
rem-log-expN/A
pow-to-expN/A
log-powN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-log.f6483.9
Applied rewrites83.9%
if 8.5000000000000005e93 < y.re Initial program 31.1%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6482.2
Applied rewrites82.2%
Final simplification83.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (log (sqrt (hypot x.re x.im))) y.im)))
(t_1 (exp (* (- y.im) (atan2 x.im x.re))))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -9e+20)
(* (cos (* (atan2 x.im x.re) y.re)) t_2)
(if (<= y.re 6.2e-167)
(* t_1 (cos (* (log (sqrt (pow (hypot x.im x.re) 0.25))) y.im)))
(if (<= y.re 5600.0) (* t_0 t_1) (* t_0 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((log(sqrt(hypot(x_46_re, x_46_im))) * y_46_im));
double t_1 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
double t_2 = 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)));
double tmp;
if (y_46_re <= -9e+20) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_2;
} else if (y_46_re <= 6.2e-167) {
tmp = t_1 * cos((log(sqrt(pow(hypot(x_46_im, x_46_re), 0.25))) * y_46_im));
} else if (y_46_re <= 5600.0) {
tmp = t_0 * t_1;
} else {
tmp = t_0 * t_2;
}
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.sqrt(Math.hypot(x_46_re, x_46_im))) * y_46_im));
double t_1 = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
double t_2 = 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)));
double tmp;
if (y_46_re <= -9e+20) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * t_2;
} else if (y_46_re <= 6.2e-167) {
tmp = t_1 * Math.cos((Math.log(Math.sqrt(Math.pow(Math.hypot(x_46_im, x_46_re), 0.25))) * y_46_im));
} else if (y_46_re <= 5600.0) {
tmp = t_0 * t_1;
} else {
tmp = t_0 * t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.log(math.sqrt(math.hypot(x_46_re, x_46_im))) * y_46_im)) t_1 = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) t_2 = 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))) tmp = 0 if y_46_re <= -9e+20: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_2 elif y_46_re <= 6.2e-167: tmp = t_1 * math.cos((math.log(math.sqrt(math.pow(math.hypot(x_46_im, x_46_re), 0.25))) * y_46_im)) elif y_46_re <= 5600.0: tmp = t_0 * t_1 else: tmp = t_0 * t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(log(sqrt(hypot(x_46_re, x_46_im))) * y_46_im)) t_1 = exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) t_2 = 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))) tmp = 0.0 if (y_46_re <= -9e+20) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * t_2); elseif (y_46_re <= 6.2e-167) tmp = Float64(t_1 * cos(Float64(log(sqrt((hypot(x_46_im, x_46_re) ^ 0.25))) * y_46_im))); elseif (y_46_re <= 5600.0) tmp = Float64(t_0 * t_1); else tmp = Float64(t_0 * t_2); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((log(sqrt(hypot(x_46_re, x_46_im))) * y_46_im)); t_1 = exp((-y_46_im * atan2(x_46_im, x_46_re))); t_2 = 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))); tmp = 0.0; if (y_46_re <= -9e+20) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_2; elseif (y_46_re <= 6.2e-167) tmp = t_1 * cos((log(sqrt((hypot(x_46_im, x_46_re) ^ 0.25))) * y_46_im)); elseif (y_46_re <= 5600.0) tmp = t_0 * t_1; else tmp = t_0 * t_2; 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[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[y$46$re, -9e+20], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 6.2e-167], N[(t$95$1 * N[Cos[N[(N[Log[N[Sqrt[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], 0.25], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5600.0], N[(t$95$0 * t$95$1), $MachinePrecision], N[(t$95$0 * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right)\\
t_1 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_2 := 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{if}\;y.re \leq -9 \cdot 10^{+20}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_2\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-167}:\\
\;\;\;\;t\_1 \cdot \cos \left(\log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 5600:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_2\\
\end{array}
\end{array}
if y.re < -9e20Initial program 42.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6484.7
Applied rewrites84.7%
if -9e20 < y.re < 6.2e-167Initial program 46.8%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites79.2%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.1
Applied rewrites80.1%
Applied rewrites86.7%
if 6.2e-167 < y.re < 5600Initial program 37.4%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.3%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6483.8
Applied rewrites83.8%
if 5600 < y.re Initial program 29.8%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6482.5
Applied rewrites82.5%
Final simplification85.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (- y.im) (atan2 x.im x.re))))
(t_1 (sqrt (hypot x.re x.im))))
(if (<= y.re -9e+20)
(*
(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 6.2e-167)
(* t_0 (cos (* (log (sqrt (pow (hypot x.im x.re) 0.25))) y.im)))
(if (<= y.re 1.6e-23)
(* (cos (* (log t_1) y.im)) t_0)
(* 1.0 (pow t_1 y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
double t_1 = sqrt(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -9e+20) {
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 <= 6.2e-167) {
tmp = t_0 * cos((log(sqrt(pow(hypot(x_46_im, x_46_re), 0.25))) * y_46_im));
} else if (y_46_re <= 1.6e-23) {
tmp = cos((log(t_1) * y_46_im)) * t_0;
} else {
tmp = 1.0 * pow(t_1, 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 t_0 = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.sqrt(Math.hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -9e+20) {
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 <= 6.2e-167) {
tmp = t_0 * Math.cos((Math.log(Math.sqrt(Math.pow(Math.hypot(x_46_im, x_46_re), 0.25))) * y_46_im));
} else if (y_46_re <= 1.6e-23) {
tmp = Math.cos((Math.log(t_1) * y_46_im)) * t_0;
} else {
tmp = 1.0 * Math.pow(t_1, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) t_1 = math.sqrt(math.hypot(x_46_re, x_46_im)) tmp = 0 if y_46_re <= -9e+20: 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 <= 6.2e-167: tmp = t_0 * math.cos((math.log(math.sqrt(math.pow(math.hypot(x_46_im, x_46_re), 0.25))) * y_46_im)) elif y_46_re <= 1.6e-23: tmp = math.cos((math.log(t_1) * y_46_im)) * t_0 else: tmp = 1.0 * math.pow(t_1, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) t_1 = sqrt(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -9e+20) 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 <= 6.2e-167) tmp = Float64(t_0 * cos(Float64(log(sqrt((hypot(x_46_im, x_46_re) ^ 0.25))) * y_46_im))); elseif (y_46_re <= 1.6e-23) tmp = Float64(cos(Float64(log(t_1) * y_46_im)) * t_0); else tmp = Float64(1.0 * (t_1 ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((-y_46_im * atan2(x_46_im, x_46_re))); t_1 = sqrt(hypot(x_46_re, x_46_im)); tmp = 0.0; if (y_46_re <= -9e+20) 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 <= 6.2e-167) tmp = t_0 * cos((log(sqrt((hypot(x_46_im, x_46_re) ^ 0.25))) * y_46_im)); elseif (y_46_re <= 1.6e-23) tmp = cos((log(t_1) * y_46_im)) * t_0; else tmp = 1.0 * (t_1 ^ y_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[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -9e+20], 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, 6.2e-167], N[(t$95$0 * N[Cos[N[(N[Log[N[Sqrt[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], 0.25], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-23], N[(N[Cos[N[(N[Log[t$95$1], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(1.0 * N[Power[t$95$1, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_1 := \sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\
\;\;\;\;\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 6.2 \cdot 10^{-167}:\\
\;\;\;\;t\_0 \cdot \cos \left(\log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\
\;\;\;\;\cos \left(\log t\_1 \cdot y.im\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {t\_1}^{y.re}\\
\end{array}
\end{array}
if y.re < -9e20Initial program 42.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6484.7
Applied rewrites84.7%
if -9e20 < y.re < 6.2e-167Initial program 46.8%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites79.2%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.1
Applied rewrites80.1%
Applied rewrites86.7%
if 6.2e-167 < y.re < 1.59999999999999988e-23Initial program 39.0%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6485.2
Applied rewrites85.2%
if 1.59999999999999988e-23 < y.re Initial program 29.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6467.2
Applied rewrites67.2%
Taylor expanded in y.re around 0
Applied rewrites72.1%
Final simplification82.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (- y.im) (atan2 x.im x.re))))
(t_1 (sqrt (hypot x.re x.im))))
(if (<= y.re -3.1e-15)
(*
(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 2.1e-167)
(* (cos (* (log (sqrt (sqrt (hypot x.im x.re)))) y.im)) t_0)
(if (<= y.re 1.6e-23)
(* (cos (* (log t_1) y.im)) t_0)
(* 1.0 (pow t_1 y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
double t_1 = sqrt(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -3.1e-15) {
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 <= 2.1e-167) {
tmp = cos((log(sqrt(sqrt(hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0;
} else if (y_46_re <= 1.6e-23) {
tmp = cos((log(t_1) * y_46_im)) * t_0;
} else {
tmp = 1.0 * pow(t_1, 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 t_0 = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.sqrt(Math.hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -3.1e-15) {
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 <= 2.1e-167) {
tmp = Math.cos((Math.log(Math.sqrt(Math.sqrt(Math.hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0;
} else if (y_46_re <= 1.6e-23) {
tmp = Math.cos((Math.log(t_1) * y_46_im)) * t_0;
} else {
tmp = 1.0 * Math.pow(t_1, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) t_1 = math.sqrt(math.hypot(x_46_re, x_46_im)) tmp = 0 if y_46_re <= -3.1e-15: 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 <= 2.1e-167: tmp = math.cos((math.log(math.sqrt(math.sqrt(math.hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0 elif y_46_re <= 1.6e-23: tmp = math.cos((math.log(t_1) * y_46_im)) * t_0 else: tmp = 1.0 * math.pow(t_1, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) t_1 = sqrt(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -3.1e-15) 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 <= 2.1e-167) tmp = Float64(cos(Float64(log(sqrt(sqrt(hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0); elseif (y_46_re <= 1.6e-23) tmp = Float64(cos(Float64(log(t_1) * y_46_im)) * t_0); else tmp = Float64(1.0 * (t_1 ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((-y_46_im * atan2(x_46_im, x_46_re))); t_1 = sqrt(hypot(x_46_re, x_46_im)); tmp = 0.0; if (y_46_re <= -3.1e-15) 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 <= 2.1e-167) tmp = cos((log(sqrt(sqrt(hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0; elseif (y_46_re <= 1.6e-23) tmp = cos((log(t_1) * y_46_im)) * t_0; else tmp = 1.0 * (t_1 ^ y_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[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.1e-15], 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, 2.1e-167], N[(N[Cos[N[(N[Log[N[Sqrt[N[Sqrt[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-23], N[(N[Cos[N[(N[Log[t$95$1], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(1.0 * N[Power[t$95$1, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_1 := \sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\\
\mathbf{if}\;y.re \leq -3.1 \cdot 10^{-15}:\\
\;\;\;\;\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 2.1 \cdot 10^{-167}:\\
\;\;\;\;\cos \left(\log \left(\sqrt{\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}}\right) \cdot y.im\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\
\;\;\;\;\cos \left(\log t\_1 \cdot y.im\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {t\_1}^{y.re}\\
\end{array}
\end{array}
if y.re < -3.0999999999999999e-15Initial program 43.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6482.4
Applied rewrites82.4%
if -3.0999999999999999e-15 < y.re < 2.10000000000000017e-167Initial program 46.5%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites81.1%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6482.1
Applied rewrites82.1%
Applied rewrites87.4%
if 2.10000000000000017e-167 < y.re < 1.59999999999999988e-23Initial program 39.0%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6485.2
Applied rewrites85.2%
if 1.59999999999999988e-23 < y.re Initial program 29.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6467.2
Applied rewrites67.2%
Taylor expanded in y.re around 0
Applied rewrites72.1%
Final simplification82.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (- y.im) (atan2 x.im x.re))))
(t_1 (sqrt (hypot x.re x.im)))
(t_2 (pow t_1 y.re)))
(if (<= y.re -3.5e+22)
(* (cos (* (atan2 x.im x.re) y.re)) t_2)
(if (<= y.re 2.1e-167)
(* (cos (* (log (sqrt (sqrt (hypot x.im x.re)))) y.im)) t_0)
(if (<= y.re 1.6e-23) (* (cos (* (log t_1) y.im)) t_0) (* 1.0 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
double t_1 = sqrt(hypot(x_46_re, x_46_im));
double t_2 = pow(t_1, y_46_re);
double tmp;
if (y_46_re <= -3.5e+22) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_2;
} else if (y_46_re <= 2.1e-167) {
tmp = cos((log(sqrt(sqrt(hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0;
} else if (y_46_re <= 1.6e-23) {
tmp = cos((log(t_1) * y_46_im)) * t_0;
} else {
tmp = 1.0 * t_2;
}
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.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.sqrt(Math.hypot(x_46_re, x_46_im));
double t_2 = Math.pow(t_1, y_46_re);
double tmp;
if (y_46_re <= -3.5e+22) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * t_2;
} else if (y_46_re <= 2.1e-167) {
tmp = Math.cos((Math.log(Math.sqrt(Math.sqrt(Math.hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0;
} else if (y_46_re <= 1.6e-23) {
tmp = Math.cos((Math.log(t_1) * y_46_im)) * t_0;
} else {
tmp = 1.0 * t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) t_1 = math.sqrt(math.hypot(x_46_re, x_46_im)) t_2 = math.pow(t_1, y_46_re) tmp = 0 if y_46_re <= -3.5e+22: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_2 elif y_46_re <= 2.1e-167: tmp = math.cos((math.log(math.sqrt(math.sqrt(math.hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0 elif y_46_re <= 1.6e-23: tmp = math.cos((math.log(t_1) * y_46_im)) * t_0 else: tmp = 1.0 * t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) t_1 = sqrt(hypot(x_46_re, x_46_im)) t_2 = t_1 ^ y_46_re tmp = 0.0 if (y_46_re <= -3.5e+22) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * t_2); elseif (y_46_re <= 2.1e-167) tmp = Float64(cos(Float64(log(sqrt(sqrt(hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0); elseif (y_46_re <= 1.6e-23) tmp = Float64(cos(Float64(log(t_1) * y_46_im)) * t_0); else tmp = Float64(1.0 * t_2); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((-y_46_im * atan2(x_46_im, x_46_re))); t_1 = sqrt(hypot(x_46_re, x_46_im)); t_2 = t_1 ^ y_46_re; tmp = 0.0; if (y_46_re <= -3.5e+22) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_2; elseif (y_46_re <= 2.1e-167) tmp = cos((log(sqrt(sqrt(hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0; elseif (y_46_re <= 1.6e-23) tmp = cos((log(t_1) * y_46_im)) * t_0; else tmp = 1.0 * t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[t$95$1, y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -3.5e+22], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 2.1e-167], N[(N[Cos[N[(N[Log[N[Sqrt[N[Sqrt[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-23], N[(N[Cos[N[(N[Log[t$95$1], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(1.0 * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_1 := \sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\\
t_2 := {t\_1}^{y.re}\\
\mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_2\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-167}:\\
\;\;\;\;\cos \left(\log \left(\sqrt{\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}}\right) \cdot y.im\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\
\;\;\;\;\cos \left(\log t\_1 \cdot y.im\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;1 \cdot t\_2\\
\end{array}
\end{array}
if y.re < -3.5e22Initial program 43.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6480.5
Applied rewrites80.5%
if -3.5e22 < y.re < 2.10000000000000017e-167Initial program 46.4%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6479.4
Applied rewrites79.4%
Applied rewrites85.2%
if 2.10000000000000017e-167 < y.re < 1.59999999999999988e-23Initial program 39.0%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6485.2
Applied rewrites85.2%
if 1.59999999999999988e-23 < y.re Initial program 29.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6467.2
Applied rewrites67.2%
Taylor expanded in y.re around 0
Applied rewrites72.1%
Final simplification81.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (sqrt (hypot x.re x.im)) y.re)))
(if (<= y.re -3.5e+22)
(* (cos (* (atan2 x.im x.re) y.re)) t_0)
(if (<= y.re 1.6e-23)
(* 1.0 (exp (* (- y.im) (atan2 x.im x.re))))
(* 1.0 t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(sqrt(hypot(x_46_re, x_46_im)), y_46_re);
double tmp;
if (y_46_re <= -3.5e+22) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_0;
} else if (y_46_re <= 1.6e-23) {
tmp = 1.0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 1.0 * 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.pow(Math.sqrt(Math.hypot(x_46_re, x_46_im)), y_46_re);
double tmp;
if (y_46_re <= -3.5e+22) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * t_0;
} else if (y_46_re <= 1.6e-23) {
tmp = 1.0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = 1.0 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.sqrt(math.hypot(x_46_re, x_46_im)), y_46_re) tmp = 0 if y_46_re <= -3.5e+22: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_0 elif y_46_re <= 1.6e-23: tmp = 1.0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = 1.0 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re tmp = 0.0 if (y_46_re <= -3.5e+22) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * t_0); elseif (y_46_re <= 1.6e-23) tmp = Float64(1.0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(1.0 * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re; tmp = 0.0; if (y_46_re <= -3.5e+22) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_0; elseif (y_46_re <= 1.6e-23) tmp = 1.0 * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = 1.0 * 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[Power[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -3.5e+22], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-23], N[(1.0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\
\;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -3.5e22Initial program 43.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6480.5
Applied rewrites80.5%
if -3.5e22 < y.re < 1.59999999999999988e-23Initial program 44.8%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.6
Applied rewrites80.6%
Taylor expanded in y.im around 0
Applied rewrites81.4%
if 1.59999999999999988e-23 < y.re Initial program 29.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6467.2
Applied rewrites67.2%
Taylor expanded in y.re around 0
Applied rewrites72.1%
Final simplification79.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -3.5e+22)
(*
(pow (fma 0.5 (/ (* x.re x.re) x.im) x.im) y.re)
(cos (* (atan2 x.im x.re) y.re)))
(if (<= y.re 1.6e-23)
(* 1.0 (exp (* (- y.im) (atan2 x.im x.re))))
(* 1.0 (pow (sqrt (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_re <= -3.5e+22) {
tmp = pow(fma(0.5, ((x_46_re * x_46_re) / x_46_im), x_46_im), y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 1.6e-23) {
tmp = 1.0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 1.0 * pow(sqrt(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_re <= -3.5e+22) tmp = Float64((fma(0.5, Float64(Float64(x_46_re * x_46_re) / x_46_im), x_46_im) ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 1.6e-23) tmp = Float64(1.0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(1.0 * (sqrt(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$re, -3.5e+22], N[(N[Power[N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-23], N[(1.0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.re \cdot x.re}{x.im}, x.im\right)\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\
\;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -3.5e22Initial program 43.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6480.5
Applied rewrites80.5%
Taylor expanded in x.re around 0
Applied rewrites76.7%
if -3.5e22 < y.re < 1.59999999999999988e-23Initial program 44.8%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.6
Applied rewrites80.6%
Taylor expanded in y.im around 0
Applied rewrites81.4%
if 1.59999999999999988e-23 < y.re Initial program 29.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6467.2
Applied rewrites67.2%
Taylor expanded in y.re around 0
Applied rewrites72.1%
Final simplification78.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* 1.0 (pow (sqrt (hypot x.re x.im)) y.re))))
(if (<= y.re -3.5e+22)
t_0
(if (<= y.re 1.6e-23) (* 1.0 (exp (* (- y.im) (atan2 x.im x.re)))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 * pow(sqrt(hypot(x_46_re, x_46_im)), y_46_re);
double tmp;
if (y_46_re <= -3.5e+22) {
tmp = t_0;
} else if (y_46_re <= 1.6e-23) {
tmp = 1.0 * 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.sqrt(Math.hypot(x_46_re, x_46_im)), y_46_re);
double tmp;
if (y_46_re <= -3.5e+22) {
tmp = t_0;
} else if (y_46_re <= 1.6e-23) {
tmp = 1.0 * 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.sqrt(math.hypot(x_46_re, x_46_im)), y_46_re) tmp = 0 if y_46_re <= -3.5e+22: tmp = t_0 elif y_46_re <= 1.6e-23: tmp = 1.0 * 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 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -3.5e+22) tmp = t_0; elseif (y_46_re <= 1.6e-23) tmp = Float64(1.0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re); tmp = 0.0; if (y_46_re <= -3.5e+22) tmp = t_0; elseif (y_46_re <= 1.6e-23) tmp = 1.0 * 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[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.5e+22], t$95$0, If[LessEqual[y$46$re, 1.6e-23], N[(1.0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\
\;\;\;\;1 \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 < -3.5e22 or 1.59999999999999988e-23 < y.re Initial program 35.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/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 rewrites74.1%
if -3.5e22 < y.re < 1.59999999999999988e-23Initial program 44.8%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.6
Applied rewrites80.6%
Taylor expanded in y.im around 0
Applied rewrites81.4%
Final simplification78.2%
(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 -3.5e+22)
t_0
(if (<= y.re 6.0) (* 1.0 (exp (* (- y.im) (atan2 x.im x.re)))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(fma(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 <= -3.5e+22) {
tmp = t_0;
} else if (y_46_re <= 6.0) {
tmp = 1.0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((fma(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 <= -3.5e+22) tmp = t_0; elseif (y_46_re <= 6.0) tmp = Float64(1.0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[(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, -3.5e+22], t$95$0, If[LessEqual[y$46$re, 6.0], N[(1.0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 6:\\
\;\;\;\;1 \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 < -3.5e22 or 6 < y.re Initial program 36.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6472.6
Applied rewrites72.6%
Taylor expanded in x.im around 0
Applied rewrites68.1%
Taylor expanded in y.re around 0
Applied rewrites69.9%
if -3.5e22 < y.re < 6Initial program 43.9%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites79.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
neg-mul-1N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6481.0
Applied rewrites81.0%
Taylor expanded in y.im around 0
Applied rewrites81.7%
(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 -4e-8) t_0 (if (<= y.re 0.00205) 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 <= -4e-8) {
tmp = t_0;
} else if (y_46_re <= 0.00205) {
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 <= -4e-8) tmp = t_0; elseif (y_46_re <= 0.00205) 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, -4e-8], t$95$0, If[LessEqual[y$46$re, 0.00205], 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 -4 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.00205:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -4.0000000000000001e-8 or 0.00205000000000000017 < y.re Initial program 36.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.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 0
Applied rewrites66.0%
Taylor expanded in y.re around 0
Applied rewrites67.8%
if -4.0000000000000001e-8 < y.re < 0.00205000000000000017Initial program 44.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.4
Applied rewrites55.4%
Taylor expanded in y.re around 0
Applied rewrites55.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re -1.2e-136)
(* (pow (- x.re) y.re) 1.0)
(if (<= x.re 2.4e-250)
(* (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 <= -1.2e-136) {
tmp = pow(-x_46_re, y_46_re) * 1.0;
} else if (x_46_re <= 2.4e-250) {
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 <= (-1.2d-136)) then
tmp = (-x_46re ** y_46re) * 1.0d0
else if (x_46re <= 2.4d-250) 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 <= -1.2e-136) {
tmp = Math.pow(-x_46_re, y_46_re) * 1.0;
} else if (x_46_re <= 2.4e-250) {
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 <= -1.2e-136: tmp = math.pow(-x_46_re, y_46_re) * 1.0 elif x_46_re <= 2.4e-250: 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 <= -1.2e-136) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * 1.0); elseif (x_46_re <= 2.4e-250) tmp = Float64((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 <= -1.2e-136) tmp = (-x_46_re ^ y_46_re) * 1.0; elseif (x_46_re <= 2.4e-250) 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, -1.2e-136], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$re, 2.4e-250], 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 -1.2 \cdot 10^{-136}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.re \leq 2.4 \cdot 10^{-250}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.re < -1.1999999999999999e-136Initial program 47.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6470.6
Applied rewrites70.6%
Taylor expanded in x.im around 0
Applied rewrites37.3%
Taylor expanded in y.re around 0
Applied rewrites35.3%
Taylor expanded in x.re around -inf
Applied rewrites64.8%
if -1.1999999999999999e-136 < x.re < 2.3999999999999999e-250Initial program 47.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.2
Applied rewrites55.2%
Taylor expanded in x.im around 0
Applied rewrites37.6%
Taylor expanded in y.re around 0
Applied rewrites48.5%
Taylor expanded in x.im around -inf
Applied rewrites61.3%
if 2.3999999999999999e-250 < x.re Initial program 32.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.2
Applied rewrites57.2%
Taylor expanded in x.im around 0
Applied rewrites56.0%
Taylor expanded in y.re around 0
Applied rewrites55.1%
Taylor expanded in x.im around 0
Applied rewrites56.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -1.12e-221) (* (pow (- x.im) y.re) 1.0) (if (<= x.im 7.8e-74) (* (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.12e-221) {
tmp = pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 7.8e-74) {
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.12d-221)) then
tmp = (-x_46im ** y_46re) * 1.0d0
else if (x_46im <= 7.8d-74) 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.12e-221) {
tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 7.8e-74) {
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.12e-221: tmp = math.pow(-x_46_im, y_46_re) * 1.0 elif x_46_im <= 7.8e-74: 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.12e-221) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0); elseif (x_46_im <= 7.8e-74) 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.12e-221) tmp = (-x_46_im ^ y_46_re) * 1.0; elseif (x_46_im <= 7.8e-74) 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.12e-221], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 7.8e-74], 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.12 \cdot 10^{-221}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.im \leq 7.8 \cdot 10^{-74}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.im < -1.12000000000000003e-221Initial program 46.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.8
Applied rewrites62.8%
Taylor expanded in x.im around 0
Applied rewrites36.8%
Taylor expanded in y.re around 0
Applied rewrites36.8%
Taylor expanded in x.im around -inf
Applied rewrites56.3%
if -1.12000000000000003e-221 < x.im < 7.8000000000000003e-74Initial program 44.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6471.9
Applied rewrites71.9%
Taylor expanded in x.im around 0
Applied rewrites59.2%
Taylor expanded in y.re around 0
Applied rewrites60.8%
Taylor expanded in x.im around 0
Applied rewrites64.0%
if 7.8000000000000003e-74 < x.im Initial program 29.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6453.2
Applied rewrites53.2%
Taylor expanded in x.im around 0
Applied rewrites47.2%
Taylor expanded in y.re around 0
Applied rewrites48.5%
Taylor expanded in x.re around 0
Applied rewrites54.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow x.re y.re) 1.0))) (if (<= y.re -0.0015) t_0 (if (<= y.re 1.68e-18) 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_re, y_46_re) * 1.0;
double tmp;
if (y_46_re <= -0.0015) {
tmp = t_0;
} else if (y_46_re <= 1.68e-18) {
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_46re ** y_46re) * 1.0d0
if (y_46re <= (-0.0015d0)) then
tmp = t_0
else if (y_46re <= 1.68d-18) 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_re, y_46_re) * 1.0;
double tmp;
if (y_46_re <= -0.0015) {
tmp = t_0;
} else if (y_46_re <= 1.68e-18) {
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_re, y_46_re) * 1.0 tmp = 0 if y_46_re <= -0.0015: tmp = t_0 elif y_46_re <= 1.68e-18: 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_re ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -0.0015) tmp = t_0; elseif (y_46_re <= 1.68e-18) 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_re ^ y_46_re) * 1.0; tmp = 0.0; if (y_46_re <= -0.0015) tmp = t_0; elseif (y_46_re <= 1.68e-18) 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$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -0.0015], t$95$0, If[LessEqual[y$46$re, 1.68e-18], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x.re}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -0.0015:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.68 \cdot 10^{-18}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.0015 or 1.6799999999999999e-18 < y.re Initial program 35.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6471.1
Applied rewrites71.1%
Taylor expanded in x.im around 0
Applied rewrites64.7%
Taylor expanded in y.re around 0
Applied rewrites66.4%
Taylor expanded in x.im around 0
Applied rewrites61.3%
if -0.0015 < y.re < 1.6799999999999999e-18Initial program 45.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6454.4
Applied rewrites54.4%
Taylor expanded in y.re around 0
Applied rewrites54.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.9) t_0 (if (<= y.re 1.68e-18) 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.9) {
tmp = t_0;
} else if (y_46_re <= 1.68e-18) {
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.9d0)) then
tmp = t_0
else if (y_46re <= 1.68d-18) 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.9) {
tmp = t_0;
} else if (y_46_re <= 1.68e-18) {
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.9: tmp = t_0 elif y_46_re <= 1.68e-18: 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.9) tmp = t_0; elseif (y_46_re <= 1.68e-18) 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.9) tmp = t_0; elseif (y_46_re <= 1.68e-18) 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.9], t$95$0, If[LessEqual[y$46$re, 1.68e-18], 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.9:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.68 \cdot 10^{-18}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -3.89999999999999991 or 1.6799999999999999e-18 < y.re Initial program 35.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6471.6
Applied rewrites71.6%
Taylor expanded in x.im around 0
Applied rewrites64.9%
Taylor expanded in y.re around 0
Applied rewrites66.6%
Taylor expanded in x.re around 0
Applied rewrites54.8%
if -3.89999999999999991 < y.re < 1.6799999999999999e-18Initial program 45.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6454.1
Applied rewrites54.1%
Taylor expanded in y.re around 0
Applied rewrites54.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 40.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.1
Applied rewrites62.1%
Taylor expanded in y.re around 0
Applied rewrites31.5%
herbie shell --seed 2024250
(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)))))