
(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 11 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 (* 1.0 (pow (fma x.re x.re (* x.im x.im)) (* 0.5 y.re)))))
(if (<= y.re -1.8e-7)
t_0
(if (<= y.re 320000000000.0)
(*
(cos (* (atan2 x.im x.re) y.re))
(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 = 1.0 * pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (0.5 * y_46_re));
double tmp;
if (y_46_re <= -1.8e-7) {
tmp = t_0;
} else if (y_46_re <= 320000000000.0) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp((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(1.0 * (fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(0.5 * y_46_re))) tmp = 0.0 if (y_46_re <= -1.8e-7) tmp = t_0; elseif (y_46_re <= 320000000000.0) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 * N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.8e-7], t$95$0, If[LessEqual[y$46$re, 320000000000.0], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $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 := 1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 320000000000:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.79999999999999997e-7 or 3.2e11 < y.re Initial program 31.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6466.0
Applied rewrites66.0%
Taylor expanded in y.re around 0
Applied rewrites75.7%
Applied rewrites75.7%
if -1.79999999999999997e-7 < y.re < 3.2e11Initial program 46.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6451.7
Applied rewrites51.7%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6478.9
Applied rewrites78.9%
Final simplification77.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* 1.0 (pow (fma x.re x.re (* x.im x.im)) (* 0.5 y.re)))))
(if (<= y.re -1.8e-7)
t_0
(if (<= y.re 350000000000.0)
(* 1.0 (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 = 1.0 * pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (0.5 * y_46_re));
double tmp;
if (y_46_re <= -1.8e-7) {
tmp = t_0;
} else if (y_46_re <= 350000000000.0) {
tmp = 1.0 * exp((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(1.0 * (fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(0.5 * y_46_re))) tmp = 0.0 if (y_46_re <= -1.8e-7) tmp = t_0; elseif (y_46_re <= 350000000000.0) tmp = Float64(1.0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 * N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.8e-7], t$95$0, If[LessEqual[y$46$re, 350000000000.0], N[(1.0 * 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 := 1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 350000000000:\\
\;\;\;\;1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.79999999999999997e-7 or 3.5e11 < y.re Initial program 31.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6466.0
Applied rewrites66.0%
Taylor expanded in y.re around 0
Applied rewrites75.7%
Applied rewrites75.7%
if -1.79999999999999997e-7 < y.re < 3.5e11Initial program 46.1%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites45.8%
Taylor expanded in y.im around 0
Applied rewrites78.9%
Final simplification77.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (fma x.re x.re (* x.im x.im))))
(if (<= y.re -2.1e-6)
(* 1.0 (pow t_0 (* 0.5 y.re)))
(if (<= y.re 3.1e-5) 1.0 (* (pow (* t_0 t_0) (* 0.25 y.re)) 1.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(x_46_re, x_46_re, (x_46_im * x_46_im));
double tmp;
if (y_46_re <= -2.1e-6) {
tmp = 1.0 * pow(t_0, (0.5 * y_46_re));
} else if (y_46_re <= 3.1e-5) {
tmp = 1.0;
} else {
tmp = pow((t_0 * t_0), (0.25 * y_46_re)) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) tmp = 0.0 if (y_46_re <= -2.1e-6) tmp = Float64(1.0 * (t_0 ^ Float64(0.5 * y_46_re))); elseif (y_46_re <= 3.1e-5) tmp = 1.0; else tmp = Float64((Float64(t_0 * t_0) ^ Float64(0.25 * y_46_re)) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.1e-6], N[(1.0 * N[Power[t$95$0, N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.1e-5], 1.0, N[(N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], N[(0.25 * y$46$re), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\\
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{-6}:\\
\;\;\;\;1 \cdot {t\_0}^{\left(0.5 \cdot y.re\right)}\\
\mathbf{elif}\;y.re \leq 3.1 \cdot 10^{-5}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{\left(0.25 \cdot y.re\right)} \cdot 1\\
\end{array}
\end{array}
if y.re < -2.0999999999999998e-6Initial program 32.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6476.0
Applied rewrites76.0%
Taylor expanded in y.re around 0
Applied rewrites79.2%
Applied rewrites79.2%
if -2.0999999999999998e-6 < y.re < 3.10000000000000014e-5Initial program 45.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6437.1
Applied rewrites37.1%
Taylor expanded in y.re around 0
Applied rewrites48.5%
if 3.10000000000000014e-5 < y.re Initial program 31.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.4
Applied rewrites57.4%
Taylor expanded in y.re around 0
Applied rewrites70.8%
Applied rewrites70.8%
Applied rewrites72.1%
Final simplification62.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* 1.0 (pow (fma x.re x.re (* x.im x.im)) (* 0.5 y.re))))) (if (<= y.re -2.1e-6) t_0 (if (<= y.re 4e-14) 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 = 1.0 * pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (0.5 * y_46_re));
double tmp;
if (y_46_re <= -2.1e-6) {
tmp = t_0;
} else if (y_46_re <= 4e-14) {
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(1.0 * (fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(0.5 * y_46_re))) tmp = 0.0 if (y_46_re <= -2.1e-6) tmp = t_0; elseif (y_46_re <= 4e-14) tmp = 1.0; else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 * N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.1e-6], t$95$0, If[LessEqual[y$46$re, 4e-14], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{-14}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.0999999999999998e-6 or 4e-14 < y.re Initial program 32.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6466.1
Applied rewrites66.1%
Taylor expanded in y.re around 0
Applied rewrites74.8%
Applied rewrites74.8%
if -2.0999999999999998e-6 < y.re < 4e-14Initial 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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6436.5
Applied rewrites36.5%
Taylor expanded in y.re around 0
Applied rewrites48.3%
Final simplification62.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.im -2.35e-119)
(* (pow (- x.im) y.re) 1.0)
(if (<= x.im 2.55e-9)
(* (pow (* x.re x.re) (* 0.5 y.re)) 1.0)
(* (pow (* x.im x.im) (* 0.5 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 <= -2.35e-119) {
tmp = pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 2.55e-9) {
tmp = pow((x_46_re * x_46_re), (0.5 * y_46_re)) * 1.0;
} else {
tmp = pow((x_46_im * x_46_im), (0.5 * 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 <= (-2.35d-119)) then
tmp = (-x_46im ** y_46re) * 1.0d0
else if (x_46im <= 2.55d-9) then
tmp = ((x_46re * x_46re) ** (0.5d0 * y_46re)) * 1.0d0
else
tmp = ((x_46im * x_46im) ** (0.5d0 * 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 <= -2.35e-119) {
tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 2.55e-9) {
tmp = Math.pow((x_46_re * x_46_re), (0.5 * y_46_re)) * 1.0;
} else {
tmp = Math.pow((x_46_im * x_46_im), (0.5 * 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 <= -2.35e-119: tmp = math.pow(-x_46_im, y_46_re) * 1.0 elif x_46_im <= 2.55e-9: tmp = math.pow((x_46_re * x_46_re), (0.5 * y_46_re)) * 1.0 else: tmp = math.pow((x_46_im * x_46_im), (0.5 * 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 <= -2.35e-119) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0); elseif (x_46_im <= 2.55e-9) tmp = Float64((Float64(x_46_re * x_46_re) ^ Float64(0.5 * y_46_re)) * 1.0); else tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(0.5 * 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 <= -2.35e-119) tmp = (-x_46_im ^ y_46_re) * 1.0; elseif (x_46_im <= 2.55e-9) tmp = ((x_46_re * x_46_re) ^ (0.5 * y_46_re)) * 1.0; else tmp = ((x_46_im * x_46_im) ^ (0.5 * 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, -2.35e-119], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 2.55e-9], N[(N[Power[N[(x$46$re * x$46$re), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2.35 \cdot 10^{-119}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.im \leq 2.55 \cdot 10^{-9}:\\
\;\;\;\;{\left(x.re \cdot x.re\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\
\end{array}
\end{array}
if x.im < -2.35000000000000001e-119Initial 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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.8
Applied rewrites50.8%
Taylor expanded in y.re around 0
Applied rewrites55.3%
Taylor expanded in x.im around -inf
Applied rewrites63.2%
if -2.35000000000000001e-119 < x.im < 2.55000000000000009e-9Initial program 48.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6451.1
Applied rewrites51.1%
Taylor expanded in y.re around 0
Applied rewrites56.9%
Applied rewrites56.9%
Taylor expanded in x.im around 0
Applied rewrites58.8%
if 2.55000000000000009e-9 < x.im Initial program 29.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.1
Applied rewrites57.1%
Taylor expanded in y.re around 0
Applied rewrites60.3%
Applied rewrites60.3%
Taylor expanded in x.im around inf
Applied rewrites65.0%
Final simplification61.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re -185000.0)
(* (pow (- x.re) y.re) 1.0)
(if (<= x.re 1.75e+27)
(* (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 <= -185000.0) {
tmp = pow(-x_46_re, y_46_re) * 1.0;
} else if (x_46_re <= 1.75e+27) {
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 <= (-185000.0d0)) then
tmp = (-x_46re ** y_46re) * 1.0d0
else if (x_46re <= 1.75d+27) 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 <= -185000.0) {
tmp = Math.pow(-x_46_re, y_46_re) * 1.0;
} else if (x_46_re <= 1.75e+27) {
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 <= -185000.0: tmp = math.pow(-x_46_re, y_46_re) * 1.0 elif x_46_re <= 1.75e+27: 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 <= -185000.0) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * 1.0); elseif (x_46_re <= 1.75e+27) 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 <= -185000.0) tmp = (-x_46_re ^ y_46_re) * 1.0; elseif (x_46_re <= 1.75e+27) 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, -185000.0], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$re, 1.75e+27], 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 -185000:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.re \leq 1.75 \cdot 10^{+27}:\\
\;\;\;\;{\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 < -185000Initial program 23.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6452.2
Applied rewrites52.2%
Taylor expanded in y.re around 0
Applied rewrites56.9%
Taylor expanded in x.re around -inf
Applied rewrites63.5%
if -185000 < x.re < 1.7500000000000001e27Initial program 50.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6451.1
Applied rewrites51.1%
Taylor expanded in y.re around 0
Applied rewrites57.9%
Applied rewrites57.9%
Taylor expanded in x.im around inf
Applied rewrites60.1%
if 1.7500000000000001e27 < x.re Initial program 26.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.7
Applied rewrites55.7%
Taylor expanded in y.re around 0
Applied rewrites55.7%
Taylor expanded in x.im around 0
Applied rewrites60.9%
Final simplification61.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -4.4e-79) (* (pow (- x.im) y.re) 1.0) (if (<= x.im 1.7e-14) (* (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 <= -4.4e-79) {
tmp = pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 1.7e-14) {
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 <= (-4.4d-79)) then
tmp = (-x_46im ** y_46re) * 1.0d0
else if (x_46im <= 1.7d-14) 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 <= -4.4e-79) {
tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 1.7e-14) {
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 <= -4.4e-79: tmp = math.pow(-x_46_im, y_46_re) * 1.0 elif x_46_im <= 1.7e-14: 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 <= -4.4e-79) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0); elseif (x_46_im <= 1.7e-14) tmp = Float64((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 <= -4.4e-79) tmp = (-x_46_im ^ y_46_re) * 1.0; elseif (x_46_im <= 1.7e-14) 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, -4.4e-79], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 1.7e-14], 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 -4.4 \cdot 10^{-79}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.im \leq 1.7 \cdot 10^{-14}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.im < -4.3999999999999998e-79Initial program 26.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.3
Applied rewrites48.3%
Taylor expanded in y.re around 0
Applied rewrites53.4%
Taylor expanded in x.im around -inf
Applied rewrites61.3%
if -4.3999999999999998e-79 < x.im < 1.70000000000000001e-14Initial program 50.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6453.2
Applied rewrites53.2%
Taylor expanded in y.re around 0
Applied rewrites58.5%
Taylor expanded in x.re around -inf
Applied rewrites55.9%
if 1.70000000000000001e-14 < x.im Initial program 30.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6456.2
Applied rewrites56.2%
Taylor expanded in y.re around 0
Applied rewrites59.4%
Taylor expanded in x.re around 0
Applied rewrites62.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -8.5e-130) (* (pow (- x.im) y.re) 1.0) (if (<= x.im 6.4e-15) (* (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 <= -8.5e-130) {
tmp = pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 6.4e-15) {
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 <= (-8.5d-130)) then
tmp = (-x_46im ** y_46re) * 1.0d0
else if (x_46im <= 6.4d-15) 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 <= -8.5e-130) {
tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
} else if (x_46_im <= 6.4e-15) {
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 <= -8.5e-130: tmp = math.pow(-x_46_im, y_46_re) * 1.0 elif x_46_im <= 6.4e-15: 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 <= -8.5e-130) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0); elseif (x_46_im <= 6.4e-15) 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 <= -8.5e-130) tmp = (-x_46_im ^ y_46_re) * 1.0; elseif (x_46_im <= 6.4e-15) 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, -8.5e-130], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 6.4e-15], 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 -8.5 \cdot 10^{-130}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.im \leq 6.4 \cdot 10^{-15}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.im < -8.50000000000000033e-130Initial 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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.8
Applied rewrites50.8%
Taylor expanded in y.re around 0
Applied rewrites55.3%
Taylor expanded in x.im around -inf
Applied rewrites63.2%
if -8.50000000000000033e-130 < x.im < 6.3999999999999999e-15Initial program 48.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6451.6
Applied rewrites51.6%
Taylor expanded in y.re around 0
Applied rewrites57.4%
Taylor expanded in x.im around 0
Applied rewrites49.5%
if 6.3999999999999999e-15 < x.im Initial program 30.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6456.2
Applied rewrites56.2%
Taylor expanded in y.re around 0
Applied rewrites59.4%
Taylor expanded in x.re around 0
Applied rewrites62.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -44.0) (* (pow x.re y.re) 1.0) (if (<= y.re 4.3e+15) 1.0 (* (pow x.im y.re) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -44.0) {
tmp = pow(x_46_re, y_46_re) * 1.0;
} else if (y_46_re <= 4.3e+15) {
tmp = 1.0;
} else {
tmp = pow(x_46_im, y_46_re) * 1.0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= (-44.0d0)) then
tmp = (x_46re ** y_46re) * 1.0d0
else if (y_46re <= 4.3d+15) then
tmp = 1.0d0
else
tmp = (x_46im ** y_46re) * 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -44.0) {
tmp = Math.pow(x_46_re, y_46_re) * 1.0;
} else if (y_46_re <= 4.3e+15) {
tmp = 1.0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -44.0: tmp = math.pow(x_46_re, y_46_re) * 1.0 elif y_46_re <= 4.3e+15: tmp = 1.0 else: tmp = math.pow(x_46_im, y_46_re) * 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -44.0) tmp = Float64((x_46_re ^ y_46_re) * 1.0); elseif (y_46_re <= 4.3e+15) tmp = 1.0; else tmp = Float64((x_46_im ^ y_46_re) * 1.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -44.0) tmp = (x_46_re ^ y_46_re) * 1.0; elseif (y_46_re <= 4.3e+15) tmp = 1.0; else tmp = (x_46_im ^ y_46_re) * 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -44.0], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 4.3e+15], 1.0, N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -44:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{+15}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -44Initial program 31.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6475.6
Applied rewrites75.6%
Taylor expanded in y.re around 0
Applied rewrites78.8%
Taylor expanded in x.im around 0
Applied rewrites64.2%
if -44 < y.re < 4.3e15Initial program 45.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6437.2
Applied rewrites37.2%
Taylor expanded in y.re around 0
Applied rewrites46.6%
if 4.3e15 < y.re Initial program 31.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.2
Applied rewrites59.2%
Taylor expanded in y.re around 0
Applied rewrites74.7%
Taylor expanded in x.re around 0
Applied rewrites56.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 -430.0) t_0 (if (<= y.re 4.3e+15) 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 <= -430.0) {
tmp = t_0;
} else if (y_46_re <= 4.3e+15) {
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 <= (-430.0d0)) then
tmp = t_0
else if (y_46re <= 4.3d+15) 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 <= -430.0) {
tmp = t_0;
} else if (y_46_re <= 4.3e+15) {
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 <= -430.0: tmp = t_0 elif y_46_re <= 4.3e+15: 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 <= -430.0) tmp = t_0; elseif (y_46_re <= 4.3e+15) 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 <= -430.0) tmp = t_0; elseif (y_46_re <= 4.3e+15) 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, -430.0], t$95$0, If[LessEqual[y$46$re, 4.3e+15], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x.im}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -430:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{+15}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -430 or 4.3e15 < y.re Initial program 30.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6466.5
Applied rewrites66.5%
Taylor expanded in y.re around 0
Applied rewrites76.4%
Taylor expanded in x.re around 0
Applied rewrites55.5%
if -430 < y.re < 4.3e15Initial program 46.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6437.7
Applied rewrites37.7%
Taylor expanded in y.re around 0
Applied rewrites46.2%
(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 38.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
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
Applied rewrites23.9%
herbie shell --seed 2024235
(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)))))