
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (log (hypot x.im x.re)) y.im))
(t_1 (- (atan2 x.im x.re)))
(t_2 (* (atan2 x.im x.re) y.re))
(t_3
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(t_4 (* (sin t_0) (sin t_2)))
(t_5 (cos t_2))
(t_6 (* t_5 (cos t_0))))
(if (<= y.re -0.034)
(* t_5 t_3)
(if (<= y.re 0.00033)
(*
(*
(pow (fma t_4 (cos (fma t_1 y.re t_0)) (pow t_6 2.0)) -1.0)
(- (pow t_6 3.0) (pow t_4 3.0)))
(exp (* t_1 y.im)))
(* (cos (* (log (hypot x.re x.im)) y.im)) t_3)))))
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_im, x_46_re)) * y_46_im;
double t_1 = -atan2(x_46_im, x_46_re);
double t_2 = atan2(x_46_im, x_46_re) * y_46_re;
double t_3 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_4 = sin(t_0) * sin(t_2);
double t_5 = cos(t_2);
double t_6 = t_5 * cos(t_0);
double tmp;
if (y_46_re <= -0.034) {
tmp = t_5 * t_3;
} else if (y_46_re <= 0.00033) {
tmp = (pow(fma(t_4, cos(fma(t_1, y_46_re, t_0)), pow(t_6, 2.0)), -1.0) * (pow(t_6, 3.0) - pow(t_4, 3.0))) * exp((t_1 * y_46_im));
} else {
tmp = cos((log(hypot(x_46_re, x_46_im)) * y_46_im)) * t_3;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(log(hypot(x_46_im, x_46_re)) * y_46_im) t_1 = Float64(-atan(x_46_im, x_46_re)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_3 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) t_4 = Float64(sin(t_0) * sin(t_2)) t_5 = cos(t_2) t_6 = Float64(t_5 * cos(t_0)) tmp = 0.0 if (y_46_re <= -0.034) tmp = Float64(t_5 * t_3); elseif (y_46_re <= 0.00033) tmp = Float64(Float64((fma(t_4, cos(fma(t_1, y_46_re, t_0)), (t_6 ^ 2.0)) ^ -1.0) * Float64((t_6 ^ 3.0) - (t_4 ^ 3.0))) * exp(Float64(t_1 * y_46_im))); else tmp = Float64(cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * t_3); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Sin[t$95$0], $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Cos[t$95$2], $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.034], N[(t$95$5 * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 0.00033], N[(N[(N[Power[N[(t$95$4 * N[Cos[N[(t$95$1 * y$46$re + t$95$0), $MachinePrecision]], $MachinePrecision] + N[Power[t$95$6, 2.0], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * N[(N[Power[t$95$6, 3.0], $MachinePrecision] - N[Power[t$95$4, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\\
t_1 := -\tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_3 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_4 := \sin t\_0 \cdot \sin t\_2\\
t_5 := \cos t\_2\\
t_6 := t\_5 \cdot \cos t\_0\\
\mathbf{if}\;y.re \leq -0.034:\\
\;\;\;\;t\_5 \cdot t\_3\\
\mathbf{elif}\;y.re \leq 0.00033:\\
\;\;\;\;\left({\left(\mathsf{fma}\left(t\_4, \cos \left(\mathsf{fma}\left(t\_1, y.re, t\_0\right)\right), {t\_6}^{2}\right)\right)}^{-1} \cdot \left({t\_6}^{3} - {t\_4}^{3}\right)\right) \cdot e^{t\_1 \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot t\_3\\
\end{array}
\end{array}
if y.re < -0.034000000000000002Initial program 40.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6480.4
Applied rewrites80.4%
if -0.034000000000000002 < y.re < 3.3e-4Initial program 48.7%
Applied rewrites57.5%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6484.7
Applied rewrites84.7%
if 3.3e-4 < y.re Initial program 39.0%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6473.4
Applied rewrites73.4%
Final simplification80.9%
(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
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re))))))
(if (<= y.re -0.034)
(* (cos (* (atan2 x.im x.re) y.re)) t_1)
(if (<= y.re 0.00033)
(* t_0 (exp (* (- (atan2 x.im x.re)) y.im)))
(* t_0 t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((log(hypot(x_46_re, x_46_im)) * y_46_im));
double t_1 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -0.034) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_1;
} else if (y_46_re <= 0.00033) {
tmp = t_0 * exp((-atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = t_0 * 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.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
double t_1 = Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -0.034) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * t_1;
} else if (y_46_re <= 0.00033) {
tmp = t_0 * Math.exp((-Math.atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = t_0 * t_1;
}
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.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -0.034: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_1 elif y_46_re <= 0.00033: tmp = t_0 * math.exp((-math.atan2(x_46_im, x_46_re) * y_46_im)) else: tmp = t_0 * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -0.034) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * t_1); elseif (y_46_re <= 0.00033) tmp = Float64(t_0 * exp(Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(t_0 * t_1); 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 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -0.034) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_1; elseif (y_46_re <= 0.00033) tmp = t_0 * exp((-atan2(x_46_im, x_46_re) * y_46_im)); else tmp = t_0 * 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[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[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.034], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 0.00033], N[(t$95$0 * N[Exp[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$1), $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 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -0.034:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 0.00033:\\
\;\;\;\;t\_0 \cdot e^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\end{array}
\end{array}
if y.re < -0.034000000000000002Initial program 40.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6480.4
Applied rewrites80.4%
if -0.034000000000000002 < y.re < 3.3e-4Initial program 48.7%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6457.5
Applied rewrites57.5%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6484.7
Applied rewrites84.7%
if 3.3e-4 < y.re Initial program 39.0%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6473.4
Applied rewrites73.4%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(cos (* (atan2 x.im x.re) y.re))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))))
(if (<= y.re -0.034)
t_0
(if (<= y.re 0.00032)
(*
(cos (* (log (hypot x.re x.im)) y.im))
(exp (* (- (atan2 x.im x.re)) y.im)))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -0.034) {
tmp = t_0;
} else if (y_46_re <= 0.00032) {
tmp = cos((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im));
} 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 = 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) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -0.034) {
tmp = t_0;
} else if (y_46_re <= 0.00032) {
tmp = Math.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im)) * Math.exp((-Math.atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -0.034: tmp = t_0 elif y_46_re <= 0.00032: tmp = math.cos((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) * math.exp((-math.atan2(x_46_im, x_46_re) * y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(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(y_46_im * atan(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_re <= -0.034) tmp = t_0; elseif (y_46_re <= 0.00032) tmp = Float64(cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp(Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))); 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 = 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) - (y_46_im * atan2(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -0.034) tmp = t_0; elseif (y_46_re <= 0.00032) tmp = cos((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im)); 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[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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.034], t$95$0, If[LessEqual[y$46$re, 0.00032], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -0.034:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.00032:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot e^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.034000000000000002 or 3.20000000000000026e-4 < y.re Initial program 40.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6474.7
Applied rewrites74.7%
if -0.034000000000000002 < y.re < 3.20000000000000026e-4Initial program 48.7%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6457.5
Applied rewrites57.5%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6484.7
Applied rewrites84.7%
Final simplification79.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (+ (* (/ (* x.re x.re) x.im) 0.5) x.im) y.re)))
(if (<= y.re -125.0)
(* 1.0 t_0)
(if (<= y.re 0.044)
(*
(cos (* (log (hypot x.re x.im)) y.im))
(exp (* (- (atan2 x.im x.re)) y.im)))
(if (<= y.re 6.5e+195)
(* (pow (- x.re) y.re) 1.0)
(* (cos (* (atan2 x.im x.re) y.re)) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im), y_46_re);
double tmp;
if (y_46_re <= -125.0) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 0.044) {
tmp = cos((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im));
} else if (y_46_re <= 6.5e+195) {
tmp = pow(-x_46_re, y_46_re) * 1.0;
} else {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * 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(((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im), y_46_re);
double tmp;
if (y_46_re <= -125.0) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 0.044) {
tmp = Math.cos((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im)) * Math.exp((-Math.atan2(x_46_im, x_46_re) * y_46_im));
} else if (y_46_re <= 6.5e+195) {
tmp = Math.pow(-x_46_re, y_46_re) * 1.0;
} else {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * 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 * x_46_re) / x_46_im) * 0.5) + x_46_im), y_46_re) tmp = 0 if y_46_re <= -125.0: tmp = 1.0 * t_0 elif y_46_re <= 0.044: tmp = math.cos((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) * math.exp((-math.atan2(x_46_im, x_46_re) * y_46_im)) elif y_46_re <= 6.5e+195: tmp = math.pow(-x_46_re, y_46_re) * 1.0 else: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(Float64(x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -125.0) tmp = Float64(1.0 * t_0); elseif (y_46_re <= 0.044) tmp = Float64(cos(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp(Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))); elseif (y_46_re <= 6.5e+195) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * 1.0); else tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * 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 * x_46_re) / x_46_im) * 0.5) + x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -125.0) tmp = 1.0 * t_0; elseif (y_46_re <= 0.044) tmp = cos((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im)); elseif (y_46_re <= 6.5e+195) tmp = (-x_46_re ^ y_46_re) * 1.0; else tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * 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[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5), $MachinePrecision] + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -125.0], N[(1.0 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 0.044], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.5e+195], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{x.re \cdot x.re}{x.im} \cdot 0.5 + x.im\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -125:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{elif}\;y.re \leq 0.044:\\
\;\;\;\;\cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot e^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im}\\
\mathbf{elif}\;y.re \leq 6.5 \cdot 10^{+195}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_0\\
\end{array}
\end{array}
if y.re < -125Initial program 40.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.f6472.1
Applied rewrites72.1%
Taylor expanded in x.re around -inf
Applied rewrites65.2%
Taylor expanded in y.re around 0
Applied rewrites65.2%
Taylor expanded in x.re around 0
Applied rewrites74.9%
if -125 < y.re < 0.043999999999999997Initial program 48.7%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6457.5
Applied rewrites57.5%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6484.7
Applied rewrites84.7%
if 0.043999999999999997 < y.re < 6.5000000000000003e195Initial program 47.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.f6455.9
Applied rewrites55.9%
Taylor expanded in x.re around -inf
Applied rewrites44.8%
Taylor expanded in y.re around 0
Applied rewrites51.1%
Taylor expanded in x.re around -inf
Applied rewrites73.2%
if 6.5000000000000003e195 < y.re Initial program 26.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.f6461.0
Applied rewrites61.0%
Taylor expanded in x.re around 0
Applied rewrites61.0%
Final simplification78.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -9.5e+178)
(* (cos (* (log (- x.im)) y.im)) (exp (* (- (atan2 x.im x.re)) y.im)))
(if (<= y.im 2e+49)
(* (pow (hypot x.re x.im) y.re) 1.0)
(*
(pow (* (/ (* x.re x.re) x.im) 0.5) 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 (y_46_im <= -9.5e+178) {
tmp = cos((log(-x_46_im) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im));
} else if (y_46_im <= 2e+49) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * 1.0;
} else {
tmp = pow((((x_46_re * x_46_re) / x_46_im) * 0.5), 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 (y_46_im <= -9.5e+178) {
tmp = Math.cos((Math.log(-x_46_im) * y_46_im)) * Math.exp((-Math.atan2(x_46_im, x_46_re) * y_46_im));
} else if (y_46_im <= 2e+49) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * 1.0;
} else {
tmp = Math.pow((((x_46_re * x_46_re) / x_46_im) * 0.5), 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 y_46_im <= -9.5e+178: tmp = math.cos((math.log(-x_46_im) * y_46_im)) * math.exp((-math.atan2(x_46_im, x_46_re) * y_46_im)) elif y_46_im <= 2e+49: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * 1.0 else: tmp = math.pow((((x_46_re * x_46_re) / x_46_im) * 0.5), 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 (y_46_im <= -9.5e+178) tmp = Float64(cos(Float64(log(Float64(-x_46_im)) * y_46_im)) * exp(Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))); elseif (y_46_im <= 2e+49) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * 1.0); else tmp = Float64((Float64(Float64(Float64(x_46_re * x_46_re) / x_46_im) * 0.5) ^ 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 (y_46_im <= -9.5e+178) tmp = cos((log(-x_46_im) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im)); elseif (y_46_im <= 2e+49) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * 1.0; else tmp = ((((x_46_re * x_46_re) / x_46_im) * 0.5) ^ 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[y$46$im, -9.5e+178], N[(N[Cos[N[(N[Log[(-x$46$im)], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2e+49], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5), $MachinePrecision], 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}\;y.im \leq -9.5 \cdot 10^{+178}:\\
\;\;\;\;\cos \left(\log \left(-x.im\right) \cdot y.im\right) \cdot e^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im}\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{+49}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{x.re \cdot x.re}{x.im} \cdot 0.5\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\end{array}
\end{array}
if y.im < -9.5e178Initial program 50.0%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.9
Applied rewrites61.9%
Taylor expanded in x.im around -inf
Applied rewrites38.7%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6450.2
Applied rewrites50.2%
if -9.5e178 < y.im < 1.99999999999999989e49Initial program 46.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 y.re around 0
Applied rewrites76.5%
if 1.99999999999999989e49 < y.im Initial program 36.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.f6427.8
Applied rewrites27.8%
Taylor expanded in x.im around inf
Applied rewrites30.2%
Taylor expanded in x.im around 0
Applied rewrites44.1%
Final simplification66.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.im -4.1e+179)
(* (pow (* (* (/ (* x.re x.re) (* x.im x.im)) 0.5) x.im) y.re) t_0)
(if (<= y.im 2e+49)
(* (pow (hypot x.re x.im) y.re) 1.0)
(* (pow (* (/ (* x.re x.re) x.im) 0.5) y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= -4.1e+179) {
tmp = pow(((((x_46_re * x_46_re) / (x_46_im * x_46_im)) * 0.5) * x_46_im), y_46_re) * t_0;
} else if (y_46_im <= 2e+49) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * 1.0;
} else {
tmp = pow((((x_46_re * x_46_re) / x_46_im) * 0.5), y_46_re) * 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.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= -4.1e+179) {
tmp = Math.pow(((((x_46_re * x_46_re) / (x_46_im * x_46_im)) * 0.5) * x_46_im), y_46_re) * t_0;
} else if (y_46_im <= 2e+49) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * 1.0;
} else {
tmp = Math.pow((((x_46_re * x_46_re) / x_46_im) * 0.5), y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_im <= -4.1e+179: tmp = math.pow(((((x_46_re * x_46_re) / (x_46_im * x_46_im)) * 0.5) * x_46_im), y_46_re) * t_0 elif y_46_im <= 2e+49: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * 1.0 else: tmp = math.pow((((x_46_re * x_46_re) / x_46_im) * 0.5), y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_im <= -4.1e+179) tmp = Float64((Float64(Float64(Float64(Float64(x_46_re * x_46_re) / Float64(x_46_im * x_46_im)) * 0.5) * x_46_im) ^ y_46_re) * t_0); elseif (y_46_im <= 2e+49) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * 1.0); else tmp = Float64((Float64(Float64(Float64(x_46_re * x_46_re) / x_46_im) * 0.5) ^ y_46_re) * 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((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_im <= -4.1e+179) tmp = (((((x_46_re * x_46_re) / (x_46_im * x_46_im)) * 0.5) * x_46_im) ^ y_46_re) * t_0; elseif (y_46_im <= 2e+49) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * 1.0; else tmp = ((((x_46_re * x_46_re) / x_46_im) * 0.5) ^ y_46_re) * 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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -4.1e+179], N[(N[Power[N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 2e+49], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.im \leq -4.1 \cdot 10^{+179}:\\
\;\;\;\;{\left(\left(\frac{x.re \cdot x.re}{x.im \cdot x.im} \cdot 0.5\right) \cdot x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{+49}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{x.re \cdot x.re}{x.im} \cdot 0.5\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.im < -4.10000000000000011e179Initial program 50.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.f649.2
Applied rewrites9.2%
Taylor expanded in x.im around inf
Applied rewrites12.4%
Taylor expanded in x.im around 0
Applied rewrites35.2%
if -4.10000000000000011e179 < y.im < 1.99999999999999989e49Initial program 46.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 y.re around 0
Applied rewrites76.5%
if 1.99999999999999989e49 < y.im Initial program 36.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.f6427.8
Applied rewrites27.8%
Taylor expanded in x.im around inf
Applied rewrites30.2%
Taylor expanded in x.im around 0
Applied rewrites44.1%
Final simplification64.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(pow (* (/ (* x.re x.re) x.im) 0.5) y.re)
(cos (* (atan2 x.im x.re) y.re)))))
(if (<= y.im -2.4e+179)
t_0
(if (<= y.im 2e+49) (* (pow (hypot x.re x.im) y.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((((x_46_re * x_46_re) / x_46_im) * 0.5), y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= -2.4e+179) {
tmp = t_0;
} else if (y_46_im <= 2e+49) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * 1.0;
} 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 = Math.pow((((x_46_re * x_46_re) / x_46_im) * 0.5), y_46_re) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= -2.4e+179) {
tmp = t_0;
} else if (y_46_im <= 2e+49) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * 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 * x_46_re) / x_46_im) * 0.5), y_46_re) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_im <= -2.4e+179: tmp = t_0 elif y_46_im <= 2e+49: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * 1.0 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((Float64(Float64(Float64(x_46_re * x_46_re) / x_46_im) * 0.5) ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))) tmp = 0.0 if (y_46_im <= -2.4e+179) tmp = t_0; elseif (y_46_im <= 2e+49) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * 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 * x_46_re) / x_46_im) * 0.5) ^ y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_im <= -2.4e+179) tmp = t_0; elseif (y_46_im <= 2e+49) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * 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[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5), $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$im, -2.4e+179], t$95$0, If[LessEqual[y$46$im, 2e+49], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{x.re \cdot x.re}{x.im} \cdot 0.5\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.im \leq -2.4 \cdot 10^{+179}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{+49}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -2.40000000000000013e179 or 1.99999999999999989e49 < y.im Initial program 40.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.f6422.0
Applied rewrites22.0%
Taylor expanded in x.im around inf
Applied rewrites24.7%
Taylor expanded in x.im around 0
Applied rewrites40.2%
if -2.40000000000000013e179 < y.im < 1.99999999999999989e49Initial program 46.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 y.re around 0
Applied rewrites76.5%
Final simplification64.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im 2e+23)
(* (pow (hypot x.re x.im) y.re) 1.0)
(*
(pow
(+
(*
(fma -0.125 (/ (* x.re x.re) (pow x.im 3.0)) (* (/ 1.0 x.im) 0.5))
(* x.re x.re))
x.im)
y.re)
1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 2e+23) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * 1.0;
} else {
tmp = pow(((fma(-0.125, ((x_46_re * x_46_re) / pow(x_46_im, 3.0)), ((1.0 / x_46_im) * 0.5)) * (x_46_re * x_46_re)) + x_46_im), y_46_re) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= 2e+23) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * 1.0); else tmp = Float64((Float64(Float64(fma(-0.125, Float64(Float64(x_46_re * x_46_re) / (x_46_im ^ 3.0)), Float64(Float64(1.0 / x_46_im) * 0.5)) * Float64(x_46_re * x_46_re)) + x_46_im) ^ 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$im, 2e+23], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[N[(N[(N[(-0.125 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x$46$im), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 2 \cdot 10^{+23}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(-0.125, \frac{x.re \cdot x.re}{{x.im}^{3}}, \frac{1}{x.im} \cdot 0.5\right) \cdot \left(x.re \cdot x.re\right) + x.im\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.im < 1.9999999999999998e23Initial program 46.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.f6467.5
Applied rewrites67.5%
Taylor expanded in y.re around 0
Applied rewrites69.2%
if 1.9999999999999998e23 < y.im 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.f6428.4
Applied rewrites28.4%
Taylor expanded in x.re around -inf
Applied rewrites30.5%
Taylor expanded in y.re around 0
Applied rewrites27.4%
Taylor expanded in x.re around 0
Applied rewrites32.0%
Final simplification59.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (pow (hypot x.re x.im) y.re) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(hypot(x_46_re, x_46_im), y_46_re) * 1.0;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * 1.0) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot 1
\end{array}
Initial 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.f6457.7
Applied rewrites57.7%
Taylor expanded in y.re around 0
Applied rewrites58.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -0.003) (* 1.0 (pow (+ (* (/ (* x.re x.re) x.im) 0.5) x.im) y.re)) (if (<= y.re 0.044) 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 (y_46_re <= -0.003) {
tmp = 1.0 * pow(((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im), y_46_re);
} else if (y_46_re <= 0.044) {
tmp = 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 (y_46re <= (-0.003d0)) then
tmp = 1.0d0 * (((((x_46re * x_46re) / x_46im) * 0.5d0) + x_46im) ** y_46re)
else if (y_46re <= 0.044d0) then
tmp = 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 (y_46_re <= -0.003) {
tmp = 1.0 * Math.pow(((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im), y_46_re);
} else if (y_46_re <= 0.044) {
tmp = 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 y_46_re <= -0.003: tmp = 1.0 * math.pow(((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im), y_46_re) elif y_46_re <= 0.044: tmp = 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 (y_46_re <= -0.003) tmp = Float64(1.0 * (Float64(Float64(Float64(Float64(x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im) ^ y_46_re)); elseif (y_46_re <= 0.044) tmp = 1.0; else tmp = Float64((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 (y_46_re <= -0.003) tmp = 1.0 * (((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im) ^ y_46_re); elseif (y_46_re <= 0.044) tmp = 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[y$46$re, -0.003], N[(1.0 * N[Power[N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5), $MachinePrecision] + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.044], 1.0, N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.003:\\
\;\;\;\;1 \cdot {\left(\frac{x.re \cdot x.re}{x.im} \cdot 0.5 + x.im\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 0.044:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -0.0030000000000000001Initial program 39.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.f6470.2
Applied rewrites70.2%
Taylor expanded in x.re around -inf
Applied rewrites63.4%
Taylor expanded in y.re around 0
Applied rewrites63.4%
Taylor expanded in x.re around 0
Applied rewrites74.3%
if -0.0030000000000000001 < y.re < 0.043999999999999997Initial program 49.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.f6450.3
Applied rewrites50.3%
Taylor expanded in y.re around 0
Applied rewrites50.2%
if 0.043999999999999997 < y.re Initial program 39.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.f6457.9
Applied rewrites57.9%
Taylor expanded in x.re around -inf
Applied rewrites47.7%
Taylor expanded in y.re around 0
Applied rewrites49.9%
Taylor expanded in x.re around -inf
Applied rewrites58.4%
Final simplification59.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (pow (- x.re) y.re) 1.0)))
(if (<= y.re -6e+246)
(* (pow (- x.im) y.re) 1.0)
(if (<= y.re -10500000000000.0) t_0 (if (<= y.re 0.044) 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 <= -6e+246) {
tmp = pow(-x_46_im, y_46_re) * 1.0;
} else if (y_46_re <= -10500000000000.0) {
tmp = t_0;
} else if (y_46_re <= 0.044) {
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 <= (-6d+246)) then
tmp = (-x_46im ** y_46re) * 1.0d0
else if (y_46re <= (-10500000000000.0d0)) then
tmp = t_0
else if (y_46re <= 0.044d0) 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 <= -6e+246) {
tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
} else if (y_46_re <= -10500000000000.0) {
tmp = t_0;
} else if (y_46_re <= 0.044) {
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 <= -6e+246: tmp = math.pow(-x_46_im, y_46_re) * 1.0 elif y_46_re <= -10500000000000.0: tmp = t_0 elif y_46_re <= 0.044: 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(-x_46_re) ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -6e+246) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0); elseif (y_46_re <= -10500000000000.0) tmp = t_0; elseif (y_46_re <= 0.044) 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 <= -6e+246) tmp = (-x_46_im ^ y_46_re) * 1.0; elseif (y_46_re <= -10500000000000.0) tmp = t_0; elseif (y_46_re <= 0.044) 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, -6e+246], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, -10500000000000.0], t$95$0, If[LessEqual[y$46$re, 0.044], 1.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(-x.re\right)}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -6 \cdot 10^{+246}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq -10500000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.044:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -6e246Initial 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.f6494.1
Applied rewrites94.1%
Taylor expanded in x.re around -inf
Applied rewrites94.2%
Taylor expanded in y.re around 0
Applied rewrites88.3%
Taylor expanded in x.im around -inf
Applied rewrites76.7%
if -6e246 < y.re < -1.05e13 or 0.043999999999999997 < y.re Initial 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.f6460.7
Applied rewrites60.7%
Taylor expanded in x.re around -inf
Applied rewrites51.7%
Taylor expanded in y.re around 0
Applied rewrites53.8%
Taylor expanded in x.re around -inf
Applied rewrites60.1%
if -1.05e13 < y.re < 0.043999999999999997Initial program 48.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.f6450.3
Applied rewrites50.3%
Taylor expanded in y.re around 0
Applied rewrites48.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow (- x.im) y.re) 1.0))) (if (<= y.re -9.4e+23) t_0 (if (<= y.re 1.55e+28) 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 <= -9.4e+23) {
tmp = t_0;
} else if (y_46_re <= 1.55e+28) {
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 <= (-9.4d+23)) then
tmp = t_0
else if (y_46re <= 1.55d+28) 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 <= -9.4e+23) {
tmp = t_0;
} else if (y_46_re <= 1.55e+28) {
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 <= -9.4e+23: tmp = t_0 elif y_46_re <= 1.55e+28: 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(-x_46_im) ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -9.4e+23) tmp = t_0; elseif (y_46_re <= 1.55e+28) 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 <= -9.4e+23) tmp = t_0; elseif (y_46_re <= 1.55e+28) 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, -9.4e+23], t$95$0, If[LessEqual[y$46$re, 1.55e+28], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(-x.im\right)}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -9.4 \cdot 10^{+23}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.55 \cdot 10^{+28}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -9.3999999999999994e23 or 1.55e28 < y.re Initial program 38.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.f6466.3
Applied rewrites66.3%
Taylor expanded in x.re around -inf
Applied rewrites58.2%
Taylor expanded in y.re around 0
Applied rewrites59.8%
Taylor expanded in x.im around -inf
Applied rewrites46.1%
if -9.3999999999999994e23 < y.re < 1.55e28Initial program 49.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.f6450.0
Applied rewrites50.0%
Taylor expanded in y.re around 0
Applied rewrites46.4%
(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 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.f6457.7
Applied rewrites57.7%
Taylor expanded in y.re around 0
Applied rewrites25.7%
herbie shell --seed 2024268
(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)))))