
(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 14 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 (cos (* y.re (atan2 x.im x.re))))
(t_1
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
t_0)))
(if (<= y.re -0.064)
t_1
(if (<= y.re 1.18e-8)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 9e+81)
t_1
(* (pow (fma x.re x.re (* x.im x.im)) (* y.re 0.5)) 1.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
double tmp;
if (y_46_re <= -0.064) {
tmp = t_1;
} else if (y_46_re <= 1.18e-8) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 9e+81) {
tmp = t_1;
} else {
tmp = pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (y_46_re * 0.5)) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0) tmp = 0.0 if (y_46_re <= -0.064) tmp = t_1; elseif (y_46_re <= 1.18e-8) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 9e+81) tmp = t_1; else tmp = Float64((fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(y_46_re * 0.5)) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -0.064], t$95$1, If[LessEqual[y$46$re, 1.18e-8], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9e+81], t$95$1, N[(N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\
\mathbf{if}\;y.re \leq -0.064:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 1.18 \cdot 10^{-8}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 9 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1\\
\end{array}
\end{array}
if y.re < -0.064000000000000001 or 1.18e-8 < y.re < 9.00000000000000034e81Initial program 45.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6481.4
Applied rewrites81.4%
if -0.064000000000000001 < y.re < 1.18e-8Initial program 45.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6450.6
Applied rewrites50.6%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6478.1
Applied rewrites78.1%
if 9.00000000000000034e81 < y.re Initial program 38.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6455.4
Applied rewrites55.4%
Taylor expanded in y.re around 0
Applied rewrites66.0%
Applied rewrites66.0%
Final simplification77.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (cos t_0))
(t_2
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -0.064)
(* t_2 t_1)
(if (<= y.re 1.18e-8)
(* t_1 (exp (* (atan2 x.im x.re) (- y.im))))
(*
t_2
(fma
(* y.im (log (sqrt (fma x.im x.im (* x.re x.re)))))
(- (sin t_0))
t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = cos(t_0);
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -0.064) {
tmp = t_2 * t_1;
} else if (y_46_re <= 1.18e-8) {
tmp = t_1 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_2 * fma((y_46_im * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))))), -sin(t_0), t_1);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = cos(t_0) t_2 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -0.064) tmp = Float64(t_2 * t_1); elseif (y_46_re <= 1.18e-8) tmp = Float64(t_1 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_2 * fma(Float64(y_46_im * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))))), Float64(-sin(t_0)), t_1)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.064], N[(t$95$2 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.18e-8], N[(t$95$1 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(N[(y$46$im * N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * (-N[Sin[t$95$0], $MachinePrecision]) + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \cos t\_0\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -0.064:\\
\;\;\;\;t\_2 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1.18 \cdot 10^{-8}:\\
\;\;\;\;t\_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right), -\sin t\_0, t\_1\right)\\
\end{array}
\end{array}
if y.re < -0.064000000000000001Initial program 42.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6482.0
Applied rewrites82.0%
if -0.064000000000000001 < y.re < 1.18e-8Initial program 45.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6450.6
Applied rewrites50.6%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6478.1
Applied rewrites78.1%
if 1.18e-8 < y.re Initial program 43.0%
Taylor expanded in y.im around 0
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites68.0%
Final simplification76.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -0.35)
(* 1.0 (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re))
(if (<= y.re 6.6e+21)
(* (cos (* y.re (atan2 x.im x.re))) (exp (* (atan2 x.im x.re) (- y.im))))
(* 1.0 (sqrt (pow (fma x.re x.re (* x.im x.im)) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -0.35) {
tmp = 1.0 * pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re);
} else if (y_46_re <= 6.6e+21) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 1.0 * sqrt(pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -0.35) tmp = Float64(1.0 * (fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re)); elseif (y_46_re <= 6.6e+21) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(1.0 * sqrt((fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ y_46_re))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -0.35], N[(1.0 * N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.6e+21], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Sqrt[N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.35:\\
\;\;\;\;1 \cdot {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 6.6 \cdot 10^{+21}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \sqrt{{\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{y.re}}\\
\end{array}
\end{array}
if y.re < -0.34999999999999998Initial program 42.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6477.2
Applied rewrites77.2%
Taylor expanded in y.re around 0
Applied rewrites78.9%
Taylor expanded in x.im around 0
Applied rewrites78.9%
if -0.34999999999999998 < y.re < 6.6e21Initial program 45.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6452.8
Applied rewrites52.8%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6476.0
Applied rewrites76.0%
if 6.6e21 < y.re Initial program 41.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6455.0
Applied rewrites55.0%
Taylor expanded in y.re around 0
Applied rewrites66.3%
Applied rewrites66.3%
Final simplification74.3%
(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 -0.064)
(* 1.0 (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re))
(if (<= y.re 3.25e-44)
(* (cos (* y.re (atan2 x.im x.re))) 1.0)
(* 1.0 (pow (* t_0 t_0) (* y.re 0.25)))))))
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 <= -0.064) {
tmp = 1.0 * pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re);
} else if (y_46_re <= 3.25e-44) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * 1.0;
} else {
tmp = 1.0 * pow((t_0 * t_0), (y_46_re * 0.25));
}
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 <= -0.064) tmp = Float64(1.0 * (fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re)); elseif (y_46_re <= 3.25e-44) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * 1.0); else tmp = Float64(1.0 * (Float64(t_0 * t_0) ^ Float64(y_46_re * 0.25))); 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, -0.064], N[(1.0 * N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.25e-44], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], N[(1.0 * N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], N[(y$46$re * 0.25), $MachinePrecision]], $MachinePrecision]), $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 -0.064:\\
\;\;\;\;1 \cdot {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 3.25 \cdot 10^{-44}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\left(t\_0 \cdot t\_0\right)}^{\left(y.re \cdot 0.25\right)}\\
\end{array}
\end{array}
if y.re < -0.064000000000000001Initial program 42.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6477.2
Applied rewrites77.2%
Taylor expanded in y.re around 0
Applied rewrites78.9%
Taylor expanded in x.im around 0
Applied rewrites78.9%
if -0.064000000000000001 < y.re < 3.25e-44Initial program 44.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6434.2
Applied rewrites34.2%
Taylor expanded in y.re around 0
Applied rewrites50.9%
if 3.25e-44 < y.re Initial program 44.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6452.3
Applied rewrites52.3%
Taylor expanded in y.re around 0
Applied rewrites59.2%
Applied rewrites59.9%
(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 -0.064)
(* 1.0 (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re))
(if (<= y.re 3.25e-44) 1.0 (* 1.0 (pow (* t_0 t_0) (* y.re 0.25)))))))
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 <= -0.064) {
tmp = 1.0 * pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re);
} else if (y_46_re <= 3.25e-44) {
tmp = 1.0;
} else {
tmp = 1.0 * pow((t_0 * t_0), (y_46_re * 0.25));
}
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 <= -0.064) tmp = Float64(1.0 * (fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re)); elseif (y_46_re <= 3.25e-44) tmp = 1.0; else tmp = Float64(1.0 * (Float64(t_0 * t_0) ^ Float64(y_46_re * 0.25))); 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, -0.064], N[(1.0 * N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.25e-44], 1.0, N[(1.0 * N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], N[(y$46$re * 0.25), $MachinePrecision]], $MachinePrecision]), $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 -0.064:\\
\;\;\;\;1 \cdot {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 3.25 \cdot 10^{-44}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\left(t\_0 \cdot t\_0\right)}^{\left(y.re \cdot 0.25\right)}\\
\end{array}
\end{array}
if y.re < -0.064000000000000001Initial program 42.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6477.2
Applied rewrites77.2%
Taylor expanded in y.re around 0
Applied rewrites78.9%
Taylor expanded in x.im around 0
Applied rewrites78.9%
if -0.064000000000000001 < y.re < 3.25e-44Initial program 44.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6434.2
Applied rewrites34.2%
Taylor expanded in y.re around 0
Applied rewrites50.9%
if 3.25e-44 < y.re Initial program 44.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6452.3
Applied rewrites52.3%
Taylor expanded in y.re around 0
Applied rewrites59.2%
Applied rewrites59.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -0.064)
(* 1.0 (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re))
(if (<= y.re 8.6e-44)
1.0
(* 1.0 (sqrt (pow (fma x.re x.re (* x.im x.im)) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -0.064) {
tmp = 1.0 * pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re);
} else if (y_46_re <= 8.6e-44) {
tmp = 1.0;
} else {
tmp = 1.0 * sqrt(pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -0.064) tmp = Float64(1.0 * (fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re)); elseif (y_46_re <= 8.6e-44) tmp = 1.0; else tmp = Float64(1.0 * sqrt((fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ y_46_re))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -0.064], N[(1.0 * N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.6e-44], 1.0, N[(1.0 * N[Sqrt[N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.064:\\
\;\;\;\;1 \cdot {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 8.6 \cdot 10^{-44}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \sqrt{{\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{y.re}}\\
\end{array}
\end{array}
if y.re < -0.064000000000000001Initial program 42.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6477.2
Applied rewrites77.2%
Taylor expanded in y.re around 0
Applied rewrites78.9%
Taylor expanded in x.im around 0
Applied rewrites78.9%
if -0.064000000000000001 < y.re < 8.60000000000000027e-44Initial program 44.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6433.7
Applied rewrites33.7%
Taylor expanded in y.re around 0
Applied rewrites50.1%
if 8.60000000000000027e-44 < y.re Initial program 44.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6453.5
Applied rewrites53.5%
Taylor expanded in y.re around 0
Applied rewrites60.7%
Applied rewrites60.7%
(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 -0.064)
(* (pow t_0 (* y.re 0.5)) 1.0)
(if (<= y.re 8.6e-44) 1.0 (* 1.0 (sqrt (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 = fma(x_46_re, x_46_re, (x_46_im * x_46_im));
double tmp;
if (y_46_re <= -0.064) {
tmp = pow(t_0, (y_46_re * 0.5)) * 1.0;
} else if (y_46_re <= 8.6e-44) {
tmp = 1.0;
} else {
tmp = 1.0 * sqrt(pow(t_0, y_46_re));
}
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 <= -0.064) tmp = Float64((t_0 ^ Float64(y_46_re * 0.5)) * 1.0); elseif (y_46_re <= 8.6e-44) tmp = 1.0; else tmp = Float64(1.0 * sqrt((t_0 ^ 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[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.064], N[(N[Power[t$95$0, N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 8.6e-44], 1.0, N[(1.0 * N[Sqrt[N[Power[t$95$0, y$46$re], $MachinePrecision]], $MachinePrecision]), $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 -0.064:\\
\;\;\;\;{t\_0}^{\left(y.re \cdot 0.5\right)} \cdot 1\\
\mathbf{elif}\;y.re \leq 8.6 \cdot 10^{-44}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \sqrt{{t\_0}^{y.re}}\\
\end{array}
\end{array}
if y.re < -0.064000000000000001Initial program 42.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6477.2
Applied rewrites77.2%
Taylor expanded in y.re around 0
Applied rewrites78.9%
Applied rewrites78.9%
if -0.064000000000000001 < y.re < 8.60000000000000027e-44Initial program 44.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6433.7
Applied rewrites33.7%
Taylor expanded in y.re around 0
Applied rewrites50.1%
if 8.60000000000000027e-44 < y.re Initial program 44.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6453.5
Applied rewrites53.5%
Taylor expanded in y.re around 0
Applied rewrites60.7%
Applied rewrites60.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow (fma x.re x.re (* x.im x.im)) (* y.re 0.5)) 1.0))) (if (<= y.re -0.064) t_0 (if (<= y.re 8.6e-44) 1.0 t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (y_46_re * 0.5)) * 1.0;
double tmp;
if (y_46_re <= -0.064) {
tmp = t_0;
} else if (y_46_re <= 8.6e-44) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(y_46_re * 0.5)) * 1.0) tmp = 0.0 if (y_46_re <= -0.064) tmp = t_0; elseif (y_46_re <= 8.6e-44) tmp = 1.0; else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -0.064], t$95$0, If[LessEqual[y$46$re, 8.6e-44], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1\\
\mathbf{if}\;y.re \leq -0.064:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 8.6 \cdot 10^{-44}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.064000000000000001 or 8.60000000000000027e-44 < y.re Initial program 43.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6464.0
Applied rewrites64.0%
Taylor expanded in y.re around 0
Applied rewrites68.7%
Applied rewrites68.7%
if -0.064000000000000001 < y.re < 8.60000000000000027e-44Initial program 44.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6433.7
Applied rewrites33.7%
Taylor expanded in y.re around 0
Applied rewrites50.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re -1.86e-16)
(* 1.0 (pow (- x.re) y.re))
(if (<= x.re 1.12e-142)
(* 1.0 (sqrt (pow (* x.im x.im) y.re)))
(* 1.0 (pow 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_re <= -1.86e-16) {
tmp = 1.0 * pow(-x_46_re, y_46_re);
} else if (x_46_re <= 1.12e-142) {
tmp = 1.0 * sqrt(pow((x_46_im * x_46_im), y_46_re));
} else {
tmp = 1.0 * pow(x_46_re, y_46_re);
}
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.86d-16)) then
tmp = 1.0d0 * (-x_46re ** y_46re)
else if (x_46re <= 1.12d-142) then
tmp = 1.0d0 * sqrt(((x_46im * x_46im) ** y_46re))
else
tmp = 1.0d0 * (x_46re ** y_46re)
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.86e-16) {
tmp = 1.0 * Math.pow(-x_46_re, y_46_re);
} else if (x_46_re <= 1.12e-142) {
tmp = 1.0 * Math.sqrt(Math.pow((x_46_im * x_46_im), y_46_re));
} else {
tmp = 1.0 * Math.pow(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_re <= -1.86e-16: tmp = 1.0 * math.pow(-x_46_re, y_46_re) elif x_46_re <= 1.12e-142: tmp = 1.0 * math.sqrt(math.pow((x_46_im * x_46_im), y_46_re)) else: tmp = 1.0 * math.pow(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_re <= -1.86e-16) tmp = Float64(1.0 * (Float64(-x_46_re) ^ y_46_re)); elseif (x_46_re <= 1.12e-142) tmp = Float64(1.0 * sqrt((Float64(x_46_im * x_46_im) ^ y_46_re))); else tmp = Float64(1.0 * (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_re <= -1.86e-16) tmp = 1.0 * (-x_46_re ^ y_46_re); elseif (x_46_re <= 1.12e-142) tmp = 1.0 * sqrt(((x_46_im * x_46_im) ^ y_46_re)); else tmp = 1.0 * (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$re, -1.86e-16], N[(1.0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.12e-142], N[(1.0 * N[Sqrt[N[Power[N[(x$46$im * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -1.86 \cdot 10^{-16}:\\
\;\;\;\;1 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 1.12 \cdot 10^{-142}:\\
\;\;\;\;1 \cdot \sqrt{{\left(x.im \cdot x.im\right)}^{y.re}}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -1.8599999999999999e-16Initial program 31.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6448.1
Applied rewrites48.1%
Taylor expanded in y.re around 0
Applied rewrites54.2%
Taylor expanded in x.re around -inf
Applied rewrites62.8%
if -1.8599999999999999e-16 < x.re < 1.1199999999999999e-142Initial program 51.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6444.6
Applied rewrites44.6%
Taylor expanded in y.re around 0
Applied rewrites47.9%
Applied rewrites47.9%
Taylor expanded in x.re around 0
Applied rewrites47.8%
if 1.1199999999999999e-142 < x.re Initial program 45.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6455.0
Applied rewrites55.0%
Taylor expanded in y.re around 0
Applied rewrites55.0%
Taylor expanded in x.im around 0
Applied rewrites64.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -4.1e-173) (* 1.0 (pow (- x.re) y.re)) (if (<= x.re 5.3e-143) (* 1.0 (pow x.im y.re)) (* 1.0 (pow 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_re <= -4.1e-173) {
tmp = 1.0 * pow(-x_46_re, y_46_re);
} else if (x_46_re <= 5.3e-143) {
tmp = 1.0 * pow(x_46_im, y_46_re);
} else {
tmp = 1.0 * pow(x_46_re, y_46_re);
}
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 <= (-4.1d-173)) then
tmp = 1.0d0 * (-x_46re ** y_46re)
else if (x_46re <= 5.3d-143) then
tmp = 1.0d0 * (x_46im ** y_46re)
else
tmp = 1.0d0 * (x_46re ** y_46re)
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 <= -4.1e-173) {
tmp = 1.0 * Math.pow(-x_46_re, y_46_re);
} else if (x_46_re <= 5.3e-143) {
tmp = 1.0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = 1.0 * Math.pow(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_re <= -4.1e-173: tmp = 1.0 * math.pow(-x_46_re, y_46_re) elif x_46_re <= 5.3e-143: tmp = 1.0 * math.pow(x_46_im, y_46_re) else: tmp = 1.0 * math.pow(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_re <= -4.1e-173) tmp = Float64(1.0 * (Float64(-x_46_re) ^ y_46_re)); elseif (x_46_re <= 5.3e-143) tmp = Float64(1.0 * (x_46_im ^ y_46_re)); else tmp = Float64(1.0 * (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_re <= -4.1e-173) tmp = 1.0 * (-x_46_re ^ y_46_re); elseif (x_46_re <= 5.3e-143) tmp = 1.0 * (x_46_im ^ y_46_re); else tmp = 1.0 * (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$re, -4.1e-173], N[(1.0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 5.3e-143], N[(1.0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -4.1 \cdot 10^{-173}:\\
\;\;\;\;1 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 5.3 \cdot 10^{-143}:\\
\;\;\;\;1 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -4.0999999999999997e-173Initial program 44.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6448.1
Applied rewrites48.1%
Taylor expanded in y.re around 0
Applied rewrites53.1%
Taylor expanded in x.re around -inf
Applied rewrites57.7%
if -4.0999999999999997e-173 < x.re < 5.29999999999999997e-143Initial program 36.8%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6442.2
Applied rewrites42.2%
Taylor expanded in y.re around 0
Applied rewrites45.6%
Taylor expanded in x.re around 0
Applied rewrites39.7%
if 5.29999999999999997e-143 < x.re Initial program 45.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6455.0
Applied rewrites55.0%
Taylor expanded in y.re around 0
Applied rewrites55.0%
Taylor expanded in x.im around 0
Applied rewrites64.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -75000000.0) (* 1.0 (pow (- x.im) y.re)) (if (<= x.im 4.8e-52) (* 1.0 (pow x.re y.re)) (* 1.0 (pow x.im y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -75000000.0) {
tmp = 1.0 * pow(-x_46_im, y_46_re);
} else if (x_46_im <= 4.8e-52) {
tmp = 1.0 * pow(x_46_re, y_46_re);
} else {
tmp = 1.0 * pow(x_46_im, y_46_re);
}
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 <= (-75000000.0d0)) then
tmp = 1.0d0 * (-x_46im ** y_46re)
else if (x_46im <= 4.8d-52) then
tmp = 1.0d0 * (x_46re ** y_46re)
else
tmp = 1.0d0 * (x_46im ** y_46re)
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 <= -75000000.0) {
tmp = 1.0 * Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 4.8e-52) {
tmp = 1.0 * Math.pow(x_46_re, y_46_re);
} else {
tmp = 1.0 * Math.pow(x_46_im, 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 <= -75000000.0: tmp = 1.0 * math.pow(-x_46_im, y_46_re) elif x_46_im <= 4.8e-52: tmp = 1.0 * math.pow(x_46_re, y_46_re) else: tmp = 1.0 * math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -75000000.0) tmp = Float64(1.0 * (Float64(-x_46_im) ^ y_46_re)); elseif (x_46_im <= 4.8e-52) tmp = Float64(1.0 * (x_46_re ^ y_46_re)); else tmp = Float64(1.0 * (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) tmp = 0.0; if (x_46_im <= -75000000.0) tmp = 1.0 * (-x_46_im ^ y_46_re); elseif (x_46_im <= 4.8e-52) tmp = 1.0 * (x_46_re ^ y_46_re); else tmp = 1.0 * (x_46_im ^ 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, -75000000.0], N[(1.0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4.8e-52], N[(1.0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -75000000:\\
\;\;\;\;1 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 4.8 \cdot 10^{-52}:\\
\;\;\;\;1 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -7.5e7Initial program 27.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6450.1
Applied rewrites50.1%
Taylor expanded in y.re around 0
Applied rewrites51.9%
Taylor expanded in x.im around -inf
Applied rewrites59.3%
if -7.5e7 < x.im < 4.8000000000000003e-52Initial program 53.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6452.9
Applied rewrites52.9%
Taylor expanded in y.re around 0
Applied rewrites55.5%
Taylor expanded in x.im around 0
Applied rewrites52.7%
if 4.8000000000000003e-52 < x.im Initial program 37.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6444.3
Applied rewrites44.3%
Taylor expanded in y.re around 0
Applied rewrites47.3%
Taylor expanded in x.re around 0
Applied rewrites60.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* 1.0 (pow x.re y.re)))) (if (<= y.re -2.35e+14) t_0 (if (<= y.re 460000.0) 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(x_46_re, y_46_re);
double tmp;
if (y_46_re <= -2.35e+14) {
tmp = t_0;
} else if (y_46_re <= 460000.0) {
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 = 1.0d0 * (x_46re ** y_46re)
if (y_46re <= (-2.35d+14)) then
tmp = t_0
else if (y_46re <= 460000.0d0) 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 = 1.0 * Math.pow(x_46_re, y_46_re);
double tmp;
if (y_46_re <= -2.35e+14) {
tmp = t_0;
} else if (y_46_re <= 460000.0) {
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 = 1.0 * math.pow(x_46_re, y_46_re) tmp = 0 if y_46_re <= -2.35e+14: tmp = t_0 elif y_46_re <= 460000.0: 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 * (x_46_re ^ y_46_re)) tmp = 0.0 if (y_46_re <= -2.35e+14) tmp = t_0; elseif (y_46_re <= 460000.0) 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 = 1.0 * (x_46_re ^ y_46_re); tmp = 0.0; if (y_46_re <= -2.35e+14) tmp = t_0; elseif (y_46_re <= 460000.0) 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[(1.0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.35e+14], t$95$0, If[LessEqual[y$46$re, 460000.0], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 \cdot {x.re}^{y.re}\\
\mathbf{if}\;y.re \leq -2.35 \cdot 10^{+14}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 460000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.35e14 or 4.6e5 < y.re Initial program 43.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6466.0
Applied rewrites66.0%
Taylor expanded in y.re around 0
Applied rewrites72.5%
Taylor expanded in x.im around 0
Applied rewrites62.2%
if -2.35e14 < y.re < 4.6e5Initial program 44.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6435.2
Applied rewrites35.2%
Taylor expanded in y.re around 0
Applied rewrites46.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* 1.0 (pow x.im y.re)))) (if (<= y.re -0.062) t_0 (if (<= y.re 98000000.0) 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(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -0.062) {
tmp = t_0;
} else if (y_46_re <= 98000000.0) {
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 = 1.0d0 * (x_46im ** y_46re)
if (y_46re <= (-0.062d0)) then
tmp = t_0
else if (y_46re <= 98000000.0d0) 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 = 1.0 * Math.pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -0.062) {
tmp = t_0;
} else if (y_46_re <= 98000000.0) {
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 = 1.0 * math.pow(x_46_im, y_46_re) tmp = 0 if y_46_re <= -0.062: tmp = t_0 elif y_46_re <= 98000000.0: 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 * (x_46_im ^ y_46_re)) tmp = 0.0 if (y_46_re <= -0.062) tmp = t_0; elseif (y_46_re <= 98000000.0) 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 = 1.0 * (x_46_im ^ y_46_re); tmp = 0.0; if (y_46_re <= -0.062) tmp = t_0; elseif (y_46_re <= 98000000.0) 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[(1.0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.062], t$95$0, If[LessEqual[y$46$re, 98000000.0], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 \cdot {x.im}^{y.re}\\
\mathbf{if}\;y.re \leq -0.062:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 98000000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.062 or 9.8e7 < y.re Initial program 42.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6465.3
Applied rewrites65.3%
Taylor expanded in y.re around 0
Applied rewrites71.6%
Taylor expanded in x.re around 0
Applied rewrites52.2%
if -0.062 < y.re < 9.8e7Initial program 45.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6435.3
Applied rewrites35.3%
Taylor expanded in y.re around 0
Applied rewrites47.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 43.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6450.0
Applied rewrites50.0%
Taylor expanded in y.re around 0
Applied rewrites25.2%
herbie shell --seed 2024222
(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)))))