
(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 17 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 (sqrt (hypot x.im x.re)))
(t_2 (* (log t_1) y.im))
(t_3 (* (cos t_0) (cos t_2)))
(t_4 (sqrt (hypot x.re x.im)))
(t_5 (* (sin t_2) (sin t_0))))
(if (<= y.re -2e-9)
(*
(cos (* (log t_4) y.im))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(if (<= y.re 3.9e+41)
(/
(* (- (pow t_3 3.0) (pow t_5 3.0)) (pow t_1 y.re))
(*
(fma t_5 (cos (fma (- (atan2 x.im x.re)) y.re t_2)) (pow t_3 2.0))
(pow (exp y.im) (atan2 x.im x.re))))
(* 1.0 (pow t_4 y.re))))))
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 = sqrt(hypot(x_46_im, x_46_re));
double t_2 = log(t_1) * y_46_im;
double t_3 = cos(t_0) * cos(t_2);
double t_4 = sqrt(hypot(x_46_re, x_46_im));
double t_5 = sin(t_2) * sin(t_0);
double tmp;
if (y_46_re <= -2e-9) {
tmp = cos((log(t_4) * y_46_im)) * 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))));
} else if (y_46_re <= 3.9e+41) {
tmp = ((pow(t_3, 3.0) - pow(t_5, 3.0)) * pow(t_1, y_46_re)) / (fma(t_5, cos(fma(-atan2(x_46_im, x_46_re), y_46_re, t_2)), pow(t_3, 2.0)) * pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = 1.0 * pow(t_4, y_46_re);
}
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 = sqrt(hypot(x_46_im, x_46_re)) t_2 = Float64(log(t_1) * y_46_im) t_3 = Float64(cos(t_0) * cos(t_2)) t_4 = sqrt(hypot(x_46_re, x_46_im)) t_5 = Float64(sin(t_2) * sin(t_0)) tmp = 0.0 if (y_46_re <= -2e-9) tmp = Float64(cos(Float64(log(t_4) * 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) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 3.9e+41) tmp = Float64(Float64(Float64((t_3 ^ 3.0) - (t_5 ^ 3.0)) * (t_1 ^ y_46_re)) / Float64(fma(t_5, cos(fma(Float64(-atan(x_46_im, x_46_re)), y_46_re, t_2)), (t_3 ^ 2.0)) * (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); else tmp = Float64(1.0 * (t_4 ^ y_46_re)); end return 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[Sqrt[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[t$95$1], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[(N[Cos[t$95$0], $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[Sin[t$95$2], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2e-9], N[(N[Cos[N[(N[Log[t$95$4], $MachinePrecision] * 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] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.9e+41], N[(N[(N[(N[Power[t$95$3, 3.0], $MachinePrecision] - N[Power[t$95$5, 3.0], $MachinePrecision]), $MachinePrecision] * N[Power[t$95$1, y$46$re], $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$5 * N[Cos[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$re + t$95$2), $MachinePrecision]], $MachinePrecision] + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[t$95$4, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\\
t_2 := \log t\_1 \cdot y.im\\
t_3 := \cos t\_0 \cdot \cos t\_2\\
t_4 := \sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\\
t_5 := \sin t\_2 \cdot \sin t\_0\\
\mathbf{if}\;y.re \leq -2 \cdot 10^{-9}:\\
\;\;\;\;\cos \left(\log t\_4 \cdot y.im\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{elif}\;y.re \leq 3.9 \cdot 10^{+41}:\\
\;\;\;\;\frac{\left({t\_3}^{3} - {t\_5}^{3}\right) \cdot {t\_1}^{y.re}}{\mathsf{fma}\left(t\_5, \cos \left(\mathsf{fma}\left(-\tan^{-1}_* \frac{x.im}{x.re}, y.re, t\_2\right)\right), {t\_3}^{2}\right) \cdot {\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {t\_4}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.00000000000000012e-9Initial program 42.6%
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.f6478.9
Applied rewrites78.9%
if -2.00000000000000012e-9 < y.re < 3.8999999999999997e41Initial program 40.7%
Applied rewrites80.9%
if 3.8999999999999997e41 < y.re Initial program 34.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.f6468.8
Applied rewrites68.8%
Taylor expanded in y.re around 0
Applied rewrites82.9%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.im x.im) (* x.re x.re))))))
(if (<=
(*
(cos (+ (* y.im t_0) (* (atan2 x.im x.re) y.re)))
(exp (- (* t_0 y.re) (* y.im (atan2 x.im x.re)))))
0.0)
(*
(pow
(sqrt
(/ (- (pow x.re 4.0) (pow x.im 4.0)) (* (- x.re x.im) (+ x.im x.re))))
y.re)
1.0)
(* 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 t_0 = log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))));
double tmp;
if ((cos(((y_46_im * t_0) + (atan2(x_46_im, x_46_re) * y_46_re))) * exp(((t_0 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))))) <= 0.0) {
tmp = pow(sqrt(((pow(x_46_re, 4.0) - pow(x_46_im, 4.0)) / ((x_46_re - x_46_im) * (x_46_im + x_46_re)))), y_46_re) * 1.0;
} else {
tmp = 1.0 * pow(sqrt(hypot(x_46_re, x_46_im)), 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.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))));
double tmp;
if ((Math.cos(((y_46_im * t_0) + (Math.atan2(x_46_im, x_46_re) * y_46_re))) * Math.exp(((t_0 * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))))) <= 0.0) {
tmp = Math.pow(Math.sqrt(((Math.pow(x_46_re, 4.0) - Math.pow(x_46_im, 4.0)) / ((x_46_re - x_46_im) * (x_46_im + x_46_re)))), y_46_re) * 1.0;
} else {
tmp = 1.0 * Math.pow(Math.sqrt(Math.hypot(x_46_re, x_46_im)), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) tmp = 0 if (math.cos(((y_46_im * t_0) + (math.atan2(x_46_im, x_46_re) * y_46_re))) * math.exp(((t_0 * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re))))) <= 0.0: tmp = math.pow(math.sqrt(((math.pow(x_46_re, 4.0) - math.pow(x_46_im, 4.0)) / ((x_46_re - x_46_im) * (x_46_im + x_46_re)))), y_46_re) * 1.0 else: tmp = 1.0 * math.pow(math.sqrt(math.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) t_0 = log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) tmp = 0.0 if (Float64(cos(Float64(Float64(y_46_im * t_0) + Float64(atan(x_46_im, x_46_re) * y_46_re))) * exp(Float64(Float64(t_0 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))) <= 0.0) tmp = Float64((sqrt(Float64(Float64((x_46_re ^ 4.0) - (x_46_im ^ 4.0)) / Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)))) ^ y_46_re) * 1.0); else tmp = Float64(1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))); tmp = 0.0; if ((cos(((y_46_im * t_0) + (atan2(x_46_im, x_46_re) * y_46_re))) * exp(((t_0 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))))) <= 0.0) tmp = (sqrt((((x_46_re ^ 4.0) - (x_46_im ^ 4.0)) / ((x_46_re - x_46_im) * (x_46_im + x_46_re)))) ^ y_46_re) * 1.0; else tmp = 1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ 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[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Cos[N[(N[(y$46$im * t$95$0), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[Power[N[Sqrt[N[(N[(N[Power[x$46$re, 4.0], $MachinePrecision] - N[Power[x$46$im, 4.0], $MachinePrecision]), $MachinePrecision] / N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $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}
t_0 := \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\\
\mathbf{if}\;\cos \left(y.im \cdot t\_0 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{t\_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \leq 0:\\
\;\;\;\;{\left(\sqrt{\frac{{x.re}^{4} - {x.im}^{4}}{\left(x.re - x.im\right) \cdot \left(x.im + x.re\right)}}\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < 0.0Initial program 79.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.f6447.5
Applied rewrites47.5%
Taylor expanded in y.re around 0
Applied rewrites59.0%
Applied rewrites67.6%
if 0.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 22.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.f6462.3
Applied rewrites62.3%
Taylor expanded in y.re around 0
Applied rewrites63.4%
Final simplification64.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sqrt (hypot x.re x.im))))
(if (<= y.re -2e-9)
(*
(cos (* (log t_0) y.im))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(if (<= y.re 4.3e-23)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(cos (* (log (sqrt (hypot x.im x.re))) y.im)))
(* 1.0 (pow t_0 y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sqrt(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -2e-9) {
tmp = cos((log(t_0) * y_46_im)) * 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))));
} else if (y_46_re <= 4.3e-23) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(sqrt(hypot(x_46_im, x_46_re))) * y_46_im));
} else {
tmp = 1.0 * pow(t_0, 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.sqrt(Math.hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -2e-9) {
tmp = Math.cos((Math.log(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) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 4.3e-23) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.cos((Math.log(Math.sqrt(Math.hypot(x_46_im, x_46_re))) * y_46_im));
} else {
tmp = 1.0 * Math.pow(t_0, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sqrt(math.hypot(x_46_re, x_46_im)) tmp = 0 if y_46_re <= -2e-9: tmp = math.cos((math.log(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) - (y_46_im * math.atan2(x_46_im, x_46_re)))) elif y_46_re <= 4.3e-23: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.cos((math.log(math.sqrt(math.hypot(x_46_im, x_46_re))) * y_46_im)) else: tmp = 1.0 * math.pow(t_0, y_46_re) 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)) tmp = 0.0 if (y_46_re <= -2e-9) tmp = Float64(cos(Float64(log(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) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 4.3e-23) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * cos(Float64(log(sqrt(hypot(x_46_im, x_46_re))) * y_46_im))); else tmp = Float64(1.0 * (t_0 ^ 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 = sqrt(hypot(x_46_re, x_46_im)); tmp = 0.0; if (y_46_re <= -2e-9) tmp = cos((log(t_0) * y_46_im)) * 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)))); elseif (y_46_re <= 4.3e-23) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(sqrt(hypot(x_46_im, x_46_re))) * y_46_im)); else tmp = 1.0 * (t_0 ^ 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[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2e-9], N[(N[Cos[N[(N[Log[t$95$0], $MachinePrecision] * 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] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-23], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[t$95$0, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\\
\mathbf{if}\;y.re \leq -2 \cdot 10^{-9}:\\
\;\;\;\;\cos \left(\log 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 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-23}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {t\_0}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.00000000000000012e-9Initial program 42.6%
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.f6478.9
Applied rewrites78.9%
if -2.00000000000000012e-9 < y.re < 4.30000000000000002e-23Initial program 41.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
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.f6444.9
Applied rewrites44.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
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6481.5
Applied rewrites81.5%
if 4.30000000000000002e-23 < y.re Initial program 33.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.f6469.9
Applied rewrites69.9%
Taylor expanded in y.re around 0
Applied rewrites79.3%
Final simplification80.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 -4.9e+132)
t_0
(if (<= y.re -1.95e-9)
(*
(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 4.3e-23)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(cos (* (log (sqrt (hypot 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 = 1.0 * pow(sqrt(hypot(x_46_re, x_46_im)), y_46_re);
double tmp;
if (y_46_re <= -4.9e+132) {
tmp = t_0;
} else if (y_46_re <= -1.95e-9) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 4.3e-23) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(sqrt(hypot(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 = 1.0 * Math.pow(Math.sqrt(Math.hypot(x_46_re, x_46_im)), y_46_re);
double tmp;
if (y_46_re <= -4.9e+132) {
tmp = t_0;
} else if (y_46_re <= -1.95e-9) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 4.3e-23) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.cos((Math.log(Math.sqrt(Math.hypot(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 = 1.0 * math.pow(math.sqrt(math.hypot(x_46_re, x_46_im)), y_46_re) tmp = 0 if y_46_re <= -4.9e+132: tmp = t_0 elif y_46_re <= -1.95e-9: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) elif y_46_re <= 4.3e-23: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.cos((math.log(math.sqrt(math.hypot(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(1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -4.9e+132) tmp = t_0; elseif (y_46_re <= -1.95e-9) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 4.3e-23) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * cos(Float64(log(sqrt(hypot(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 = 1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re); tmp = 0.0; if (y_46_re <= -4.9e+132) tmp = t_0; elseif (y_46_re <= -1.95e-9) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); elseif (y_46_re <= 4.3e-23) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(sqrt(hypot(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[(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, -4.9e+132], t$95$0, If[LessEqual[y$46$re, -1.95e-9], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-23], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $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 -4.9 \cdot 10^{+132}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -1.95 \cdot 10^{-9}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-23}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -4.9000000000000002e132 or 4.30000000000000002e-23 < y.re Initial program 34.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.f6468.5
Applied rewrites68.5%
Taylor expanded in y.re around 0
Applied rewrites80.1%
if -4.9000000000000002e132 < y.re < -1.9500000000000001e-9Initial program 49.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6480.1
Applied rewrites80.1%
if -1.9500000000000001e-9 < y.re < 4.30000000000000002e-23Initial program 41.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
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.f6444.9
Applied rewrites44.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
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6481.5
Applied rewrites81.5%
Final simplification80.7%
(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 -2.5)
t_0
(if (<= y.re 4.3e-23)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(cos (* (log (sqrt (hypot 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 = 1.0 * pow(sqrt(hypot(x_46_re, x_46_im)), y_46_re);
double tmp;
if (y_46_re <= -2.5) {
tmp = t_0;
} else if (y_46_re <= 4.3e-23) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(sqrt(hypot(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 = 1.0 * Math.pow(Math.sqrt(Math.hypot(x_46_re, x_46_im)), y_46_re);
double tmp;
if (y_46_re <= -2.5) {
tmp = t_0;
} else if (y_46_re <= 4.3e-23) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.cos((Math.log(Math.sqrt(Math.hypot(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 = 1.0 * math.pow(math.sqrt(math.hypot(x_46_re, x_46_im)), y_46_re) tmp = 0 if y_46_re <= -2.5: tmp = t_0 elif y_46_re <= 4.3e-23: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.cos((math.log(math.sqrt(math.hypot(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(1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -2.5) tmp = t_0; elseif (y_46_re <= 4.3e-23) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * cos(Float64(log(sqrt(hypot(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 = 1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re); tmp = 0.0; if (y_46_re <= -2.5) tmp = t_0; elseif (y_46_re <= 4.3e-23) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(sqrt(hypot(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[(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, -2.5], t$95$0, If[LessEqual[y$46$re, 4.3e-23], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $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 -2.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-23}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.5 or 4.30000000000000002e-23 < 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.f6468.9
Applied rewrites68.9%
Taylor expanded in y.re around 0
Applied rewrites76.9%
if -2.5 < y.re < 4.30000000000000002e-23Initial 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.f6444.6
Applied rewrites44.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
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6481.0
Applied rewrites81.0%
Final simplification78.7%
(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 -2.7)
t_0
(if (<= y.re 4.3e-23)
(*
(cos (* (atan2 x.im x.re) y.re))
(exp (* (- y.im) (atan2 x.im x.re))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 * pow(sqrt(hypot(x_46_re, x_46_im)), y_46_re);
double tmp;
if (y_46_re <= -2.7) {
tmp = t_0;
} else if (y_46_re <= 4.3e-23) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 * Math.pow(Math.sqrt(Math.hypot(x_46_re, x_46_im)), y_46_re);
double tmp;
if (y_46_re <= -2.7) {
tmp = t_0;
} else if (y_46_re <= 4.3e-23) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = 1.0 * math.pow(math.sqrt(math.hypot(x_46_re, x_46_im)), y_46_re) tmp = 0 if y_46_re <= -2.7: tmp = t_0 elif y_46_re <= 4.3e-23: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -2.7) tmp = t_0; elseif (y_46_re <= 4.3e-23) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re); tmp = 0.0; if (y_46_re <= -2.7) tmp = t_0; elseif (y_46_re <= 4.3e-23) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 * N[Power[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.7], t$95$0, If[LessEqual[y$46$re, 4.3e-23], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -2.7:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-23}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.7000000000000002 or 4.30000000000000002e-23 < 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.f6468.9
Applied rewrites68.9%
Taylor expanded in y.re around 0
Applied rewrites76.9%
if -2.7000000000000002 < y.re < 4.30000000000000002e-23Initial program 43.1%
Taylor expanded in x.re around 0
*-commutativeN/A
lower-*.f64N/A
exp-diffN/A
lower-/.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6444.4
Applied rewrites44.4%
Taylor expanded in y.re around 0
Applied rewrites43.5%
Taylor expanded in y.im around 0
Applied rewrites78.6%
Final simplification77.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im 6e+210) (* 1.0 (pow (sqrt (hypot x.re x.im)) y.re)) (* (pow x.im y.re) (cos (* (atan2 x.im x.re) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= 6e+210) {
tmp = 1.0 * pow(sqrt(hypot(x_46_re, x_46_im)), y_46_re);
} else {
tmp = pow(x_46_im, y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= 6e+210) {
tmp = 1.0 * Math.pow(Math.sqrt(Math.hypot(x_46_re, x_46_im)), y_46_re);
} else {
tmp = Math.pow(x_46_im, y_46_re) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= 6e+210: tmp = 1.0 * math.pow(math.sqrt(math.hypot(x_46_re, x_46_im)), y_46_re) else: tmp = math.pow(x_46_im, y_46_re) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= 6e+210) tmp = Float64(1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re)); else tmp = Float64((x_46_im ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_im <= 6e+210) tmp = 1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re); else tmp = (x_46_im ^ y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, 6e+210], N[(1.0 * N[Power[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 6 \cdot 10^{+210}:\\
\;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\end{array}
\end{array}
if x.im < 6.00000000000000044e210Initial program 43.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.f6456.6
Applied rewrites56.6%
Taylor expanded in y.re around 0
Applied rewrites63.0%
if 6.00000000000000044e210 < x.im Initial program 0.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.f6469.7
Applied rewrites69.7%
Taylor expanded in x.re around 0
Applied rewrites75.1%
Final simplification64.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.15e-63)
(* (pow (fma (/ (* x.re x.re) x.im) 0.5 x.im) y.re) 1.0)
(if (<= y.re 0.0057)
(fma (log (sqrt (hypot x.re x.im))) y.re 1.0)
(*
(pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.15e-63) {
tmp = pow(fma(((x_46_re * x_46_re) / x_46_im), 0.5, x_46_im), y_46_re) * 1.0;
} else if (y_46_re <= 0.0057) {
tmp = fma(log(sqrt(hypot(x_46_re, x_46_im))), y_46_re, 1.0);
} else {
tmp = pow((fma((0.5 / x_46_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -1.15e-63) tmp = Float64((fma(Float64(Float64(x_46_re * x_46_re) / x_46_im), 0.5, x_46_im) ^ y_46_re) * 1.0); elseif (y_46_re <= 0.0057) tmp = fma(log(sqrt(hypot(x_46_re, x_46_im))), y_46_re, 1.0); else tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), Float64(Float64(x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re) ^ y_46_re) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.15e-63], N[(N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5 + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 0.0057], N[(N[Log[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re + 1.0), $MachinePrecision], N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.15 \cdot 10^{-63}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 0.0057:\\
\;\;\;\;\mathsf{fma}\left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right), y.re, 1\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -1.15e-63Initial program 42.9%
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.f6460.5
Applied rewrites60.5%
Taylor expanded in y.re around 0
Applied rewrites65.4%
Taylor expanded in x.re around 0
Applied rewrites65.1%
if -1.15e-63 < y.re < 0.0057000000000000002Initial program 41.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.f6446.9
Applied rewrites46.9%
Taylor expanded in y.re around 0
Applied rewrites46.9%
Taylor expanded in y.re around 0
Applied rewrites46.8%
if 0.0057000000000000002 < y.re Initial program 33.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.f6470.5
Applied rewrites70.5%
Taylor expanded in y.re around 0
Applied rewrites80.4%
Taylor expanded in x.re around inf
Applied rewrites73.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -36000000.0) (* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) 1.0) (* 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_im <= -36000000.0) {
tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * 1.0;
} 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_im <= -36000000.0) tmp = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * 1.0); 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$im, -36000000.0], N[(N[Power[N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5 + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], 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.im \leq -36000000:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -3.6e7Initial program 38.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.f6429.0
Applied rewrites29.0%
Taylor expanded in y.re around 0
Applied rewrites32.6%
Taylor expanded in x.im around 0
Applied rewrites41.0%
if -3.6e7 < y.im Initial program 39.9%
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.f6465.7
Applied rewrites65.7%
Taylor expanded in y.re around 0
Applied rewrites70.2%
Final simplification63.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.15e-63)
(* (pow (fma (/ (* x.re x.re) x.im) 0.5 x.im) y.re) 1.0)
(if (<= y.re 0.0057)
1.0
(*
(pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.15e-63) {
tmp = pow(fma(((x_46_re * x_46_re) / x_46_im), 0.5, x_46_im), y_46_re) * 1.0;
} else if (y_46_re <= 0.0057) {
tmp = 1.0;
} else {
tmp = pow((fma((0.5 / x_46_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -1.15e-63) tmp = Float64((fma(Float64(Float64(x_46_re * x_46_re) / x_46_im), 0.5, x_46_im) ^ y_46_re) * 1.0); elseif (y_46_re <= 0.0057) tmp = 1.0; else tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), Float64(Float64(x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re) ^ y_46_re) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.15e-63], N[(N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5 + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 0.0057], 1.0, N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.15 \cdot 10^{-63}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 0.0057:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -1.15e-63Initial program 42.9%
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.f6460.5
Applied rewrites60.5%
Taylor expanded in y.re around 0
Applied rewrites65.4%
Taylor expanded in x.re around 0
Applied rewrites65.1%
if -1.15e-63 < y.re < 0.0057000000000000002Initial program 41.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.f6446.9
Applied rewrites46.9%
Taylor expanded in y.re around 0
Applied rewrites46.8%
if 0.0057000000000000002 < y.re Initial program 33.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.f6470.5
Applied rewrites70.5%
Taylor expanded in y.re around 0
Applied rewrites80.4%
Taylor expanded in x.re around inf
Applied rewrites73.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.15e-63)
(* (pow (fma (/ (* x.re x.re) x.im) 0.5 x.im) y.re) 1.0)
(if (<= y.re 0.0057)
1.0
(* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.15e-63) {
tmp = pow(fma(((x_46_re * x_46_re) / x_46_im), 0.5, x_46_im), y_46_re) * 1.0;
} else if (y_46_re <= 0.0057) {
tmp = 1.0;
} else {
tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -1.15e-63) tmp = Float64((fma(Float64(Float64(x_46_re * x_46_re) / x_46_im), 0.5, x_46_im) ^ y_46_re) * 1.0); elseif (y_46_re <= 0.0057) tmp = 1.0; else tmp = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.15e-63], N[(N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5 + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 0.0057], 1.0, N[(N[Power[N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5 + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.15 \cdot 10^{-63}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 0.0057:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -1.15e-63Initial program 42.9%
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.f6460.5
Applied rewrites60.5%
Taylor expanded in y.re around 0
Applied rewrites65.4%
Taylor expanded in x.re around 0
Applied rewrites65.1%
if -1.15e-63 < y.re < 0.0057000000000000002Initial program 41.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.f6446.9
Applied rewrites46.9%
Taylor expanded in y.re around 0
Applied rewrites46.8%
if 0.0057000000000000002 < y.re Initial program 33.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.f6470.5
Applied rewrites70.5%
Taylor expanded in y.re around 0
Applied rewrites80.4%
Taylor expanded in x.im around 0
Applied rewrites73.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re -1.35e-17)
(* (pow (sqrt (* x.re x.re)) y.re) 1.0)
(if (<= x.re 6e-189)
(* (pow (* x.im x.im) (* 0.5 y.re)) 1.0)
(* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -1.35e-17) {
tmp = pow(sqrt((x_46_re * x_46_re)), y_46_re) * 1.0;
} else if (x_46_re <= 6e-189) {
tmp = pow((x_46_im * x_46_im), (0.5 * y_46_re)) * 1.0;
} else {
tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -1.35e-17) tmp = Float64((sqrt(Float64(x_46_re * x_46_re)) ^ y_46_re) * 1.0); elseif (x_46_re <= 6e-189) tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(0.5 * y_46_re)) * 1.0); else tmp = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -1.35e-17], N[(N[Power[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$re, 6e-189], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5 + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -1.35 \cdot 10^{-17}:\\
\;\;\;\;{\left(\sqrt{x.re \cdot x.re}\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.re \leq 6 \cdot 10^{-189}:\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.re < -1.3500000000000001e-17Initial program 32.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.f6463.9
Applied rewrites63.9%
Taylor expanded in y.re around 0
Applied rewrites65.6%
Taylor expanded in x.im around 0
Applied rewrites55.7%
if -1.3500000000000001e-17 < x.re < 6e-189Initial program 44.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.f6448.8
Applied rewrites48.8%
Taylor expanded in y.re around 0
Applied rewrites58.1%
Taylor expanded in x.re around 0
Applied rewrites52.6%
Applied rewrites59.2%
if 6e-189 < x.re Initial program 39.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.9
Applied rewrites62.9%
Taylor expanded in y.re around 0
Applied rewrites63.9%
Taylor expanded in x.im around 0
Applied rewrites60.5%
Final simplification58.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re -1.35e-17)
(* (pow (sqrt (* x.re x.re)) y.re) 1.0)
(if (<= x.re 1.1e-26)
(* (pow (* x.im x.im) (* 0.5 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.35e-17) {
tmp = pow(sqrt((x_46_re * x_46_re)), y_46_re) * 1.0;
} else if (x_46_re <= 1.1e-26) {
tmp = pow((x_46_im * x_46_im), (0.5 * 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.35d-17)) then
tmp = (sqrt((x_46re * x_46re)) ** y_46re) * 1.0d0
else if (x_46re <= 1.1d-26) then
tmp = ((x_46im * x_46im) ** (0.5d0 * 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.35e-17) {
tmp = Math.pow(Math.sqrt((x_46_re * x_46_re)), y_46_re) * 1.0;
} else if (x_46_re <= 1.1e-26) {
tmp = Math.pow((x_46_im * x_46_im), (0.5 * 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.35e-17: tmp = math.pow(math.sqrt((x_46_re * x_46_re)), y_46_re) * 1.0 elif x_46_re <= 1.1e-26: tmp = math.pow((x_46_im * x_46_im), (0.5 * 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.35e-17) tmp = Float64((sqrt(Float64(x_46_re * x_46_re)) ^ y_46_re) * 1.0); elseif (x_46_re <= 1.1e-26) tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(0.5 * 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.35e-17) tmp = (sqrt((x_46_re * x_46_re)) ^ y_46_re) * 1.0; elseif (x_46_re <= 1.1e-26) tmp = ((x_46_im * x_46_im) ^ (0.5 * 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.35e-17], N[(N[Power[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$re, 1.1e-26], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $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.35 \cdot 10^{-17}:\\
\;\;\;\;{\left(\sqrt{x.re \cdot x.re}\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.re \leq 1.1 \cdot 10^{-26}:\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.re < -1.3500000000000001e-17Initial program 32.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.f6463.9
Applied rewrites63.9%
Taylor expanded in y.re around 0
Applied rewrites65.6%
Taylor expanded in x.im around 0
Applied rewrites55.7%
if -1.3500000000000001e-17 < x.re < 1.1e-26Initial program 45.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.f6449.1
Applied rewrites49.1%
Taylor expanded in y.re around 0
Applied rewrites59.1%
Taylor expanded in x.re around 0
Applied rewrites52.6%
Applied rewrites58.2%
if 1.1e-26 < x.re Initial program 35.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.f6469.4
Applied rewrites69.4%
Taylor expanded in y.re around 0
Applied rewrites64.9%
Taylor expanded in x.im around 0
Applied rewrites62.7%
Final simplification58.8%
(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.5e+101)
t_0
(if (<= y.re -2.25e-9)
(* (pow x.re y.re) 1.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_im, y_46_re) * 1.0;
double tmp;
if (y_46_re <= -9.5e+101) {
tmp = t_0;
} else if (y_46_re <= -2.25e-9) {
tmp = pow(x_46_re, y_46_re) * 1.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_46im ** y_46re) * 1.0d0
if (y_46re <= (-9.5d+101)) then
tmp = t_0
else if (y_46re <= (-2.25d-9)) then
tmp = (x_46re ** y_46re) * 1.0d0
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_im, y_46_re) * 1.0;
double tmp;
if (y_46_re <= -9.5e+101) {
tmp = t_0;
} else if (y_46_re <= -2.25e-9) {
tmp = Math.pow(x_46_re, y_46_re) * 1.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_im, y_46_re) * 1.0 tmp = 0 if y_46_re <= -9.5e+101: tmp = t_0 elif y_46_re <= -2.25e-9: tmp = math.pow(x_46_re, y_46_re) * 1.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((x_46_im ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -9.5e+101) tmp = t_0; elseif (y_46_re <= -2.25e-9) tmp = Float64((x_46_re ^ y_46_re) * 1.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_im ^ y_46_re) * 1.0; tmp = 0.0; if (y_46_re <= -9.5e+101) tmp = t_0; elseif (y_46_re <= -2.25e-9) tmp = (x_46_re ^ y_46_re) * 1.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$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -9.5e+101], t$95$0, If[LessEqual[y$46$re, -2.25e-9], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 0.044], 1.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x.im}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -9.5 \cdot 10^{+101}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -2.25 \cdot 10^{-9}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 0.044:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -9.49999999999999947e101 or 0.043999999999999997 < 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.f6469.1
Applied rewrites69.1%
Taylor expanded in y.re around 0
Applied rewrites79.4%
Taylor expanded in x.re around 0
Applied rewrites63.4%
if -9.49999999999999947e101 < y.re < -2.24999999999999988e-9Initial program 52.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.f6465.1
Applied rewrites65.1%
Taylor expanded in y.re around 0
Applied rewrites60.8%
Taylor expanded in x.im around 0
Applied rewrites62.3%
if -2.24999999999999988e-9 < y.re < 0.043999999999999997Initial program 41.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.f6445.2
Applied rewrites45.2%
Taylor expanded in y.re around 0
Applied rewrites45.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -9.5e-106) (* (pow (- x.im) y.re) 1.0) (if (<= x.im 9e-27) (* (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 <= -9.5e-106) {
tmp = pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 9e-27) {
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 <= (-9.5d-106)) then
tmp = (-x_46im ** y_46re) * 1.0d0
else if (x_46im <= 9d-27) 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 <= -9.5e-106) {
tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 9e-27) {
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 <= -9.5e-106: tmp = math.pow(-x_46_im, y_46_re) * 1.0 elif x_46_im <= 9e-27: 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 <= -9.5e-106) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0); elseif (x_46_im <= 9e-27) 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 <= -9.5e-106) tmp = (-x_46_im ^ y_46_re) * 1.0; elseif (x_46_im <= 9e-27) 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, -9.5e-106], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 9e-27], 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 -9.5 \cdot 10^{-106}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.im \leq 9 \cdot 10^{-27}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.im < -9.4999999999999994e-106Initial program 39.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.f6450.2
Applied rewrites50.2%
Taylor expanded in y.re around 0
Applied rewrites60.6%
Taylor expanded in x.im around -inf
Applied rewrites61.2%
if -9.4999999999999994e-106 < x.im < 9.0000000000000003e-27Initial program 44.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.f6462.7
Applied rewrites62.7%
Taylor expanded in y.re around 0
Applied rewrites66.4%
Taylor expanded in x.im around 0
Applied rewrites55.4%
if 9.0000000000000003e-27 < x.im Initial program 33.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.f6458.7
Applied rewrites58.7%
Taylor expanded in y.re around 0
Applied rewrites57.3%
Taylor expanded in x.re around 0
Applied rewrites56.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow x.im y.re) 1.0))) (if (<= y.re -5.2e-12) 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_im, y_46_re) * 1.0;
double tmp;
if (y_46_re <= -5.2e-12) {
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_46im ** y_46re) * 1.0d0
if (y_46re <= (-5.2d-12)) 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_im, y_46_re) * 1.0;
double tmp;
if (y_46_re <= -5.2e-12) {
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_im, y_46_re) * 1.0 tmp = 0 if y_46_re <= -5.2e-12: 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((x_46_im ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -5.2e-12) 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_im ^ y_46_re) * 1.0; tmp = 0.0; if (y_46_re <= -5.2e-12) 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$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -5.2e-12], t$95$0, If[LessEqual[y$46$re, 0.044], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x.im}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -5.2 \cdot 10^{-12}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.044:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -5.19999999999999965e-12 or 0.043999999999999997 < y.re Initial program 37.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.f6468.4
Applied rewrites68.4%
Taylor expanded in y.re around 0
Applied rewrites76.2%
Taylor expanded in x.re around 0
Applied rewrites57.7%
if -5.19999999999999965e-12 < y.re < 0.043999999999999997Initial program 41.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.f6445.0
Applied rewrites45.0%
Taylor expanded in y.re around 0
Applied rewrites45.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 39.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
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.8
Applied rewrites57.8%
Taylor expanded in y.re around 0
Applied rewrites22.4%
herbie shell --seed 2024249
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))