
(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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $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[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 42.0%
hypot-def42.0%
fma-def42.0%
hypot-def84.5%
*-commutative84.5%
Simplified84.5%
Final simplification84.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(t_1
(sin (fma y.re (atan2 x.im x.re) (* (log (hypot x.re x.im)) y.im)))))
(if (<= y.re -2.6e-13)
(* t_0 (sin (* y.re (atan2 x.im x.re))))
(if (<= y.re 1.95e+21)
(* (exp (* (atan2 x.im x.re) (- y.im))) t_1)
(if (or (<= y.re 6e+108) (not (<= y.re 3.7e+192)))
(* t_0 (sin (* y.im (log (hypot x.im x.re)))))
(* t_1 (pow (hypot 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 = 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 t_1 = sin(fma(y_46_re, atan2(x_46_im, x_46_re), (log(hypot(x_46_re, x_46_im)) * y_46_im)));
double tmp;
if (y_46_re <= -2.6e-13) {
tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.95e+21) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_1;
} else if ((y_46_re <= 6e+108) || !(y_46_re <= 3.7e+192)) {
tmp = t_0 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = t_1 * pow(hypot(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) t_0 = 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_1 = sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))) tmp = 0.0 if (y_46_re <= -2.6e-13) tmp = Float64(t_0 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1.95e+21) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * t_1); elseif ((y_46_re <= 6e+108) || !(y_46_re <= 3.7e+192)) tmp = Float64(t_0 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ 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[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]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.6e-13], N[(t$95$0 * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.95e+21], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[Or[LessEqual[y$46$re, 6e+108], N[Not[LessEqual[y$46$re, 3.7e+192]], $MachinePrecision]], N[(t$95$0 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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}\\
t_1 := \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right)\\
\mathbf{if}\;y.re \leq -2.6 \cdot 10^{-13}:\\
\;\;\;\;t_0 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 1.95 \cdot 10^{+21}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_1\\
\mathbf{elif}\;y.re \leq 6 \cdot 10^{+108} \lor \neg \left(y.re \leq 3.7 \cdot 10^{+192}\right):\\
\;\;\;\;t_0 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.6e-13Initial program 44.6%
Taylor expanded in y.im around 0 89.3%
if -2.6e-13 < y.re < 1.95e21Initial program 37.7%
exp-diff37.6%
exp-to-pow37.7%
hypot-def37.7%
*-commutative37.7%
exp-prod37.7%
+-commutative37.7%
*-commutative37.7%
fma-def37.7%
+-commutative37.7%
Simplified84.0%
Taylor expanded in y.re around 0 83.6%
rec-exp83.6%
distribute-rgt-neg-in83.6%
Simplified83.6%
if 1.95e21 < y.re < 5.99999999999999968e108 or 3.7000000000000001e192 < y.re Initial program 41.5%
Taylor expanded in y.re around 0 43.9%
unpow243.9%
unpow243.9%
hypot-def80.5%
Simplified80.5%
if 5.99999999999999968e108 < y.re < 3.7000000000000001e192Initial program 61.9%
exp-diff47.6%
exp-to-pow47.6%
hypot-def47.6%
*-commutative47.6%
exp-prod47.6%
+-commutative47.6%
*-commutative47.6%
fma-def47.6%
+-commutative47.6%
Simplified61.9%
Taylor expanded in y.im around 0 81.1%
unpow281.1%
unpow281.1%
hypot-def81.1%
Simplified81.1%
Final simplification84.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(sin (fma y.re (atan2 x.im x.re) (* (log (hypot x.re x.im)) y.im)))))
(if (<= y.re -2.2e-13)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (* y.re (atan2 x.im x.re))))
(if (<= y.re 3.7e-37)
(* (exp (* (atan2 x.im x.re) (- y.im))) t_0)
(* t_0 (pow (hypot 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 = sin(fma(y_46_re, atan2(x_46_im, x_46_re), (log(hypot(x_46_re, x_46_im)) * y_46_im)));
double tmp;
if (y_46_re <= -2.2e-13) {
tmp = 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))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 3.7e-37) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_0;
} else {
tmp = t_0 * pow(hypot(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) t_0 = sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))) tmp = 0.0 if (y_46_re <= -2.2e-13) tmp = 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))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 3.7e-37) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * t_0); else tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ 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[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.2e-13], 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] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.7e-37], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right)\\
\mathbf{if}\;y.re \leq -2.2 \cdot 10^{-13}:\\
\;\;\;\;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 \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{-37}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.19999999999999997e-13Initial program 44.6%
Taylor expanded in y.im around 0 89.3%
if -2.19999999999999997e-13 < y.re < 3.7e-37Initial program 37.8%
exp-diff37.7%
exp-to-pow37.7%
hypot-def37.7%
*-commutative37.7%
exp-prod37.7%
+-commutative37.7%
*-commutative37.7%
fma-def37.7%
+-commutative37.7%
Simplified83.7%
Taylor expanded in y.re around 0 83.9%
rec-exp83.9%
distribute-rgt-neg-in83.9%
Simplified83.9%
if 3.7e-37 < y.re Initial program 47.0%
exp-diff35.6%
exp-to-pow35.7%
hypot-def35.7%
*-commutative35.7%
exp-prod35.7%
+-commutative35.7%
*-commutative35.7%
fma-def35.7%
+-commutative35.7%
Simplified61.4%
Taylor expanded in y.im around 0 66.0%
unpow266.0%
unpow266.0%
hypot-def70.1%
Simplified70.1%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sqrt (+ (* x.re x.re) (* x.im x.im))))
(t_2 (/ (sin (fabs (* y.im (log (hypot x.im x.re))))) (exp t_0)))
(t_3 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.im -9e+40)
t_2
(if (<= y.im 7.2e+31)
(*
(sin (fma y.re (atan2 x.im x.re) (* (log (hypot x.re x.im)) y.im)))
(pow (hypot x.im x.re) y.re))
(if (<= y.im 1.05e+97)
(* (exp (- (* y.re (log t_1)) t_0)) t_3)
(if (<= y.im 4.5e+291)
t_2
(* (cbrt (pow t_3 3.0)) (pow t_1 y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)));
double t_2 = sin(fabs((y_46_im * log(hypot(x_46_im, x_46_re))))) / exp(t_0);
double t_3 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -9e+40) {
tmp = t_2;
} else if (y_46_im <= 7.2e+31) {
tmp = sin(fma(y_46_re, atan2(x_46_im, x_46_re), (log(hypot(x_46_re, x_46_im)) * y_46_im))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 1.05e+97) {
tmp = exp(((y_46_re * log(t_1)) - t_0)) * t_3;
} else if (y_46_im <= 4.5e+291) {
tmp = t_2;
} else {
tmp = cbrt(pow(t_3, 3.0)) * pow(t_1, 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_im) t_1 = sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) t_2 = Float64(sin(abs(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) / exp(t_0)) t_3 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -9e+40) tmp = t_2; elseif (y_46_im <= 7.2e+31) tmp = Float64(sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 1.05e+97) tmp = Float64(exp(Float64(Float64(y_46_re * log(t_1)) - t_0)) * t_3); elseif (y_46_im <= 4.5e+291) tmp = t_2; else tmp = Float64(cbrt((t_3 ^ 3.0)) * (t_1 ^ 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$im), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[N[Abs[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -9e+40], t$95$2, If[LessEqual[y$46$im, 7.2e+31], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.05e+97], N[(N[Exp[N[(N[(y$46$re * N[Log[t$95$1], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[y$46$im, 4.5e+291], t$95$2, N[(N[Power[N[Power[t$95$3, 3.0], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[t$95$1, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sqrt{x.re \cdot x.re + x.im \cdot x.im}\\
t_2 := \frac{\sin \left(\left|y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right|\right)}{e^{t_0}}\\
t_3 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -9 \cdot 10^{+40}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq 7.2 \cdot 10^{+31}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 1.05 \cdot 10^{+97}:\\
\;\;\;\;e^{y.re \cdot \log t_1 - t_0} \cdot t_3\\
\mathbf{elif}\;y.im \leq 4.5 \cdot 10^{+291}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{t_3}^{3}} \cdot {t_1}^{y.re}\\
\end{array}
\end{array}
if y.im < -9.00000000000000064e40 or 1.05000000000000006e97 < y.im < 4.49999999999999995e291Initial program 33.0%
exp-diff20.5%
exp-to-pow20.5%
hypot-def20.5%
*-commutative20.5%
exp-prod20.5%
+-commutative20.5%
*-commutative20.5%
fma-def20.5%
+-commutative20.5%
Simplified56.6%
hypot-udef20.5%
add-sqr-sqrt10.2%
sqrt-unprod8.0%
pow28.0%
*-commutative8.0%
hypot-udef19.7%
Applied egg-rr19.7%
unpow219.7%
rem-sqrt-square56.5%
hypot-def17.0%
unpow217.0%
unpow217.0%
+-commutative17.0%
unpow217.0%
unpow217.0%
hypot-def56.5%
Simplified56.5%
Taylor expanded in y.re around 0 62.7%
if -9.00000000000000064e40 < y.im < 7.19999999999999992e31Initial program 48.7%
exp-diff48.0%
exp-to-pow48.0%
hypot-def48.0%
*-commutative48.0%
exp-prod48.0%
+-commutative48.0%
*-commutative48.0%
fma-def48.0%
+-commutative48.0%
Simplified90.8%
Taylor expanded in y.im around 0 66.3%
unpow266.3%
unpow266.3%
hypot-def90.0%
Simplified90.0%
if 7.19999999999999992e31 < y.im < 1.05000000000000006e97Initial program 26.7%
Taylor expanded in y.im around 0 73.6%
if 4.49999999999999995e291 < y.im Initial program 50.0%
exp-diff50.0%
exp-to-pow50.0%
hypot-def50.0%
*-commutative50.0%
exp-prod50.0%
+-commutative50.0%
*-commutative50.0%
fma-def50.0%
+-commutative50.0%
Simplified50.0%
clear-num50.0%
inv-pow50.0%
Applied egg-rr50.0%
unpow-150.0%
Simplified50.0%
Taylor expanded in y.im around 0 35.9%
+-commutative35.9%
unpow235.9%
unpow235.9%
Simplified35.9%
add-cbrt-cube66.9%
pow366.9%
Applied egg-rr66.9%
Final simplification79.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.re -2.6e-34)
(*
(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 7.4e-121)
(/
(sin (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (atan2 x.im x.re)))
(* t_0 (pow (hypot 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 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -2.6e-34) {
tmp = 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;
} else if (y_46_re <= 7.4e-121) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = t_0 * pow(hypot(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 t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -2.6e-34) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else if (y_46_re <= 7.4e-121) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_0 * Math.pow(Math.hypot(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): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -2.6e-34: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0 elif y_46_re <= 7.4e-121: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) else: tmp = t_0 * math.pow(math.hypot(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) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -2.6e-34) tmp = 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); elseif (y_46_re <= 7.4e-121) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = Float64(t_0 * (hypot(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) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -2.6e-34) tmp = 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; elseif (y_46_re <= 7.4e-121) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); else tmp = t_0 * (hypot(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_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.6e-34], 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, 7.4e-121], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -2.6 \cdot 10^{-34}:\\
\;\;\;\;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{elif}\;y.re \leq 7.4 \cdot 10^{-121}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.5999999999999999e-34Initial program 43.9%
Taylor expanded in y.im around 0 88.0%
if -2.5999999999999999e-34 < y.re < 7.4000000000000004e-121Initial program 34.8%
exp-diff34.8%
exp-to-pow34.8%
hypot-def34.8%
*-commutative34.8%
exp-prod34.8%
+-commutative34.8%
*-commutative34.8%
fma-def34.8%
+-commutative34.8%
Simplified82.4%
clear-num82.4%
inv-pow82.4%
Applied egg-rr82.4%
unpow-182.4%
Simplified82.4%
Taylor expanded in y.re around 0 26.5%
*-commutative26.5%
unpow226.5%
unpow226.5%
hypot-def64.6%
exp-prod64.5%
Simplified64.5%
if 7.4000000000000004e-121 < y.re Initial program 48.7%
exp-diff39.8%
exp-to-pow39.9%
hypot-def39.9%
*-commutative39.9%
exp-prod39.9%
+-commutative39.9%
*-commutative39.9%
fma-def39.9%
+-commutative39.9%
Simplified67.7%
clear-num67.7%
inv-pow67.7%
Applied egg-rr67.7%
unpow-167.7%
Simplified67.7%
Taylor expanded in y.im around 0 54.9%
unpow254.9%
unpow254.9%
hypot-def61.5%
Simplified61.5%
Final simplification69.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -8.8e-33) (not (<= y.re 6.8e-120)))
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(/
(sin (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (atan2 x.im x.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 <= -8.8e-33) || !(y_46_re <= 6.8e-120)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -8.8e-33) || !(y_46_re <= 6.8e-120)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -8.8e-33) or not (y_46_re <= 6.8e-120): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_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 <= -8.8e-33) || !(y_46_re <= 6.8e-120)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -8.8e-33) || ~((y_46_re <= 6.8e-120))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -8.8e-33], N[Not[LessEqual[y$46$re, 6.8e-120]], $MachinePrecision]], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -8.8 \cdot 10^{-33} \lor \neg \left(y.re \leq 6.8 \cdot 10^{-120}\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\end{array}
\end{array}
if y.re < -8.80000000000000022e-33 or 6.8000000000000002e-120 < y.re Initial program 46.7%
exp-diff37.0%
exp-to-pow37.1%
hypot-def37.1%
*-commutative37.1%
exp-prod37.1%
+-commutative37.1%
*-commutative37.1%
fma-def37.1%
+-commutative37.1%
Simplified71.1%
clear-num71.1%
inv-pow71.1%
Applied egg-rr71.1%
unpow-171.1%
Simplified71.1%
Taylor expanded in y.im around 0 68.3%
unpow268.3%
unpow268.3%
hypot-def72.4%
Simplified72.4%
if -8.80000000000000022e-33 < y.re < 6.8000000000000002e-120Initial program 34.8%
exp-diff34.8%
exp-to-pow34.8%
hypot-def34.8%
*-commutative34.8%
exp-prod34.8%
+-commutative34.8%
*-commutative34.8%
fma-def34.8%
+-commutative34.8%
Simplified82.4%
clear-num82.4%
inv-pow82.4%
Applied egg-rr82.4%
unpow-182.4%
Simplified82.4%
Taylor expanded in y.re around 0 26.5%
*-commutative26.5%
unpow226.5%
unpow226.5%
hypot-def64.6%
exp-prod64.5%
Simplified64.5%
Final simplification69.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.im (log x.re))))
(t_1 (sin (* y.re (atan2 x.im x.re))))
(t_2 (exp (* (atan2 x.im x.re) y.im))))
(if (<= x.re 1.12e-163)
(* t_1 (pow (sqrt (+ (* x.re x.re) (* x.im x.im))) y.re))
(if (<= x.re 1.5e-121)
(/ t_0 t_2)
(if (<= x.re 3.5e-18)
(* t_1 (pow (hypot x.im x.re) y.re))
(/ (* t_0 (pow x.re y.re)) t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_im * log(x_46_re)));
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = exp((atan2(x_46_im, x_46_re) * y_46_im));
double tmp;
if (x_46_re <= 1.12e-163) {
tmp = t_1 * pow(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else if (x_46_re <= 1.5e-121) {
tmp = t_0 / t_2;
} else if (x_46_re <= 3.5e-18) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = (t_0 * pow(x_46_re, y_46_re)) / t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_im * Math.log(x_46_re)));
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = Math.exp((Math.atan2(x_46_im, x_46_re) * y_46_im));
double tmp;
if (x_46_re <= 1.12e-163) {
tmp = t_1 * Math.pow(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else if (x_46_re <= 1.5e-121) {
tmp = t_0 / t_2;
} else if (x_46_re <= 3.5e-18) {
tmp = t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = (t_0 * Math.pow(x_46_re, y_46_re)) / t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_im * math.log(x_46_re))) t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_2 = math.exp((math.atan2(x_46_im, x_46_re) * y_46_im)) tmp = 0 if x_46_re <= 1.12e-163: tmp = t_1 * math.pow(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re) elif x_46_re <= 1.5e-121: tmp = t_0 / t_2 elif x_46_re <= 3.5e-18: tmp = t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = (t_0 * math.pow(x_46_re, y_46_re)) / t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_im * log(x_46_re))) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = exp(Float64(atan(x_46_im, x_46_re) * y_46_im)) tmp = 0.0 if (x_46_re <= 1.12e-163) tmp = Float64(t_1 * (sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) ^ y_46_re)); elseif (x_46_re <= 1.5e-121) tmp = Float64(t_0 / t_2); elseif (x_46_re <= 3.5e-18) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(Float64(t_0 * (x_46_re ^ y_46_re)) / t_2); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_im * log(x_46_re))); t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); t_2 = exp((atan2(x_46_im, x_46_re) * y_46_im)); tmp = 0.0; if (x_46_re <= 1.12e-163) tmp = t_1 * (sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))) ^ y_46_re); elseif (x_46_re <= 1.5e-121) tmp = t_0 / t_2; elseif (x_46_re <= 3.5e-18) tmp = t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = (t_0 * (x_46_re ^ y_46_re)) / t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 1.12e-163], N[(t$95$1 * N[Power[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.5e-121], N[(t$95$0 / t$95$2), $MachinePrecision], If[LessEqual[x$46$re, 3.5e-18], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.im \cdot \log x.re\right)\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq 1.12 \cdot 10^{-163}:\\
\;\;\;\;t_1 \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 1.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{t_0}{t_2}\\
\mathbf{elif}\;x.re \leq 3.5 \cdot 10^{-18}:\\
\;\;\;\;t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0 \cdot {x.re}^{y.re}}{t_2}\\
\end{array}
\end{array}
if x.re < 1.12e-163Initial program 45.4%
exp-diff38.0%
exp-to-pow38.1%
hypot-def38.1%
*-commutative38.1%
exp-prod38.1%
+-commutative38.1%
*-commutative38.1%
fma-def38.1%
+-commutative38.1%
Simplified76.8%
clear-num76.8%
inv-pow76.8%
Applied egg-rr76.8%
unpow-176.8%
Simplified76.8%
Taylor expanded in y.im around 0 55.2%
+-commutative55.2%
unpow255.2%
unpow255.2%
Simplified55.2%
if 1.12e-163 < x.re < 1.5e-121Initial program 41.7%
exp-diff25.0%
exp-to-pow25.0%
hypot-def25.0%
*-commutative25.0%
exp-prod25.0%
+-commutative25.0%
*-commutative25.0%
fma-def25.0%
+-commutative25.0%
Simplified41.7%
clear-num41.7%
inv-pow41.7%
Applied egg-rr41.7%
unpow-141.7%
Simplified41.7%
Taylor expanded in x.im around 0 58.5%
Taylor expanded in y.re around 0 83.6%
if 1.5e-121 < x.re < 3.4999999999999999e-18Initial program 74.8%
exp-diff69.8%
exp-to-pow69.8%
hypot-def69.8%
*-commutative69.8%
exp-prod69.8%
+-commutative69.8%
*-commutative69.8%
fma-def69.8%
+-commutative69.8%
Simplified89.8%
clear-num89.8%
inv-pow89.8%
Applied egg-rr89.8%
unpow-189.8%
Simplified89.8%
Taylor expanded in y.im around 0 60.8%
unpow260.8%
unpow260.8%
hypot-def70.9%
Simplified70.9%
if 3.4999999999999999e-18 < x.re Initial program 22.6%
exp-diff22.6%
exp-to-pow22.6%
hypot-def22.6%
*-commutative22.6%
exp-prod22.6%
+-commutative22.6%
*-commutative22.6%
fma-def22.6%
+-commutative22.6%
Simplified74.0%
clear-num74.0%
inv-pow74.0%
Applied egg-rr74.0%
unpow-174.0%
Simplified74.0%
Taylor expanded in x.im around 0 71.0%
Taylor expanded in y.re around 0 59.2%
Final simplification58.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -2.7e-54)
(* t_1 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 2.45e-231)
(* t_1 (pow (hypot x.im x.re) y.re))
(* t_1 (exp (- (* y.re (log x.im)) t_0)))))))
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_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -2.7e-54) {
tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 2.45e-231) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -2.7e-54) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 2.45e-231) {
tmp = t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -2.7e-54: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 2.45e-231: tmp = t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) 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_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -2.7e-54) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 2.45e-231) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -2.7e-54) tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 2.45e-231) tmp = t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_1 * exp(((y_46_re * log(x_46_im)) - 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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -2.7e-54], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2.45e-231], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -2.7 \cdot 10^{-54}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 2.45 \cdot 10^{-231}:\\
\;\;\;\;t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -2.70000000000000026e-54Initial program 35.5%
Taylor expanded in y.im around 0 61.0%
Taylor expanded in x.im around -inf 75.7%
mul-1-neg56.2%
Simplified75.7%
if -2.70000000000000026e-54 < x.im < 2.45000000000000002e-231Initial program 49.9%
exp-diff44.2%
exp-to-pow44.2%
hypot-def44.2%
*-commutative44.2%
exp-prod44.2%
+-commutative44.2%
*-commutative44.2%
fma-def44.2%
+-commutative44.2%
Simplified78.6%
clear-num78.6%
inv-pow78.6%
Applied egg-rr78.6%
unpow-178.6%
Simplified78.6%
Taylor expanded in y.im around 0 54.4%
unpow254.4%
unpow254.4%
hypot-def56.9%
Simplified56.9%
if 2.45000000000000002e-231 < x.im Initial program 39.7%
Taylor expanded in y.im around 0 55.0%
Taylor expanded in x.re around 0 68.9%
Final simplification66.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im 4.2e-230)
(* t_0 (pow (hypot x.im x.re) y.re))
(* t_0 (exp (- (* y.re (log x.im)) (* (atan2 x.im x.re) y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= 4.2e-230) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * exp(((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im)));
}
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.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= 4.2e-230) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * Math.exp(((y_46_re * Math.log(x_46_im)) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= 4.2e-230: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * math.exp(((y_46_re * math.log(x_46_im)) - (math.atan2(x_46_im, x_46_re) * y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= 4.2e-230) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * exp(Float64(Float64(y_46_re * log(x_46_im)) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= 4.2e-230) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0 * exp(((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, 4.2e-230], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq 4.2 \cdot 10^{-230}:\\
\;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if x.im < 4.1999999999999997e-230Initial program 43.4%
exp-diff37.8%
exp-to-pow37.8%
hypot-def37.8%
*-commutative37.8%
exp-prod37.8%
+-commutative37.8%
*-commutative37.8%
fma-def37.8%
+-commutative37.8%
Simplified77.1%
clear-num77.1%
inv-pow77.1%
Applied egg-rr77.1%
unpow-177.1%
Simplified77.1%
Taylor expanded in y.im around 0 55.0%
unpow255.0%
unpow255.0%
hypot-def56.9%
Simplified56.9%
if 4.1999999999999997e-230 < x.im Initial program 39.7%
Taylor expanded in y.im around 0 55.0%
Taylor expanded in x.re around 0 68.9%
Final simplification61.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin t_0))
(t_2 (pow (sqrt (+ (* x.re x.re) (* x.im x.im))) y.re)))
(if (<= y.im -5500000000000.0)
(* t_0 t_2)
(if (<= y.im 58.0) (* t_1 (pow (hypot x.im x.re) y.re)) (* t_1 t_2)))))
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 = sin(t_0);
double t_2 = pow(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
double tmp;
if (y_46_im <= -5500000000000.0) {
tmp = t_0 * t_2;
} else if (y_46_im <= 58.0) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_1 * t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin(t_0);
double t_2 = Math.pow(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
double tmp;
if (y_46_im <= -5500000000000.0) {
tmp = t_0 * t_2;
} else if (y_46_im <= 58.0) {
tmp = t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_1 * t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.sin(t_0) t_2 = math.pow(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re) tmp = 0 if y_46_im <= -5500000000000.0: tmp = t_0 * t_2 elif y_46_im <= 58.0: tmp = t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_1 * t_2 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 = sin(t_0) t_2 = sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) ^ y_46_re tmp = 0.0 if (y_46_im <= -5500000000000.0) tmp = Float64(t_0 * t_2); elseif (y_46_im <= 58.0) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_1 * t_2); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = sin(t_0); t_2 = sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))) ^ y_46_re; tmp = 0.0; if (y_46_im <= -5500000000000.0) tmp = t_0 * t_2; elseif (y_46_im <= 58.0) tmp = t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_1 * t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$im, -5500000000000.0], N[(t$95$0 * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 58.0], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t_0\\
t_2 := {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -5500000000000:\\
\;\;\;\;t_0 \cdot t_2\\
\mathbf{elif}\;y.im \leq 58:\\
\;\;\;\;t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot t_2\\
\end{array}
\end{array}
if y.im < -5.5e12Initial program 30.9%
exp-diff20.0%
exp-to-pow20.0%
hypot-def20.0%
*-commutative20.0%
exp-prod20.0%
+-commutative20.0%
*-commutative20.0%
fma-def20.0%
+-commutative20.0%
Simplified51.5%
clear-num51.5%
inv-pow51.5%
Applied egg-rr51.5%
unpow-151.5%
Simplified51.5%
Taylor expanded in y.im around 0 44.2%
+-commutative44.2%
unpow244.2%
unpow244.2%
Simplified44.2%
Taylor expanded in y.re around 0 46.0%
if -5.5e12 < y.im < 58Initial program 48.4%
exp-diff47.6%
exp-to-pow47.7%
hypot-def47.7%
*-commutative47.7%
exp-prod47.7%
+-commutative47.7%
*-commutative47.7%
fma-def47.7%
+-commutative47.7%
Simplified91.9%
clear-num91.9%
inv-pow91.9%
Applied egg-rr91.9%
unpow-191.9%
Simplified91.9%
Taylor expanded in y.im around 0 55.9%
unpow255.9%
unpow255.9%
hypot-def67.0%
Simplified67.0%
if 58 < y.im Initial program 37.4%
exp-diff24.3%
exp-to-pow24.3%
hypot-def24.3%
*-commutative24.3%
exp-prod24.3%
+-commutative24.3%
*-commutative24.3%
fma-def24.3%
+-commutative24.3%
Simplified59.5%
clear-num59.5%
inv-pow59.5%
Applied egg-rr59.5%
unpow-159.5%
Simplified59.5%
Taylor expanded in y.im around 0 44.0%
+-commutative44.0%
unpow244.0%
unpow244.0%
Simplified44.0%
Final simplification57.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.im -5500000000000.0)
(and (not (<= y.im 5e-51)) (<= y.im 1.06e+279)))
(* t_0 (pow (sqrt (+ (* x.re x.re) (* x.im x.im))) y.re))
(* (sin t_0) (pow (hypot 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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -5500000000000.0) || (!(y_46_im <= 5e-51) && (y_46_im <= 1.06e+279))) {
tmp = t_0 * pow(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else {
tmp = sin(t_0) * pow(hypot(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 t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -5500000000000.0) || (!(y_46_im <= 5e-51) && (y_46_im <= 1.06e+279))) {
tmp = t_0 * Math.pow(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else {
tmp = Math.sin(t_0) * Math.pow(Math.hypot(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): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_im <= -5500000000000.0) or (not (y_46_im <= 5e-51) and (y_46_im <= 1.06e+279)): tmp = t_0 * math.pow(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re) else: tmp = math.sin(t_0) * math.pow(math.hypot(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) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -5500000000000.0) || (!(y_46_im <= 5e-51) && (y_46_im <= 1.06e+279))) tmp = Float64(t_0 * (sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) ^ y_46_re)); else tmp = Float64(sin(t_0) * (hypot(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) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_im <= -5500000000000.0) || (~((y_46_im <= 5e-51)) && (y_46_im <= 1.06e+279))) tmp = t_0 * (sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))) ^ y_46_re); else tmp = sin(t_0) * (hypot(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_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -5500000000000.0], And[N[Not[LessEqual[y$46$im, 5e-51]], $MachinePrecision], LessEqual[y$46$im, 1.06e+279]]], N[(t$95$0 * N[Power[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -5500000000000 \lor \neg \left(y.im \leq 5 \cdot 10^{-51}\right) \land y.im \leq 1.06 \cdot 10^{+279}:\\
\;\;\;\;t_0 \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\sin t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -5.5e12 or 5.00000000000000004e-51 < y.im < 1.05999999999999998e279Initial program 35.2%
exp-diff22.9%
exp-to-pow22.9%
hypot-def22.9%
*-commutative22.9%
exp-prod22.9%
+-commutative22.9%
*-commutative22.9%
fma-def22.9%
+-commutative22.9%
Simplified56.2%
clear-num56.2%
inv-pow56.2%
Applied egg-rr56.2%
unpow-156.2%
Simplified56.2%
Taylor expanded in y.im around 0 43.5%
+-commutative43.5%
unpow243.5%
unpow243.5%
Simplified43.5%
Taylor expanded in y.re around 0 44.4%
if -5.5e12 < y.im < 5.00000000000000004e-51 or 1.05999999999999998e279 < y.im Initial program 47.4%
exp-diff46.6%
exp-to-pow46.7%
hypot-def46.7%
*-commutative46.7%
exp-prod46.7%
+-commutative46.7%
*-commutative46.7%
fma-def46.7%
+-commutative46.7%
Simplified90.7%
clear-num90.8%
inv-pow90.8%
Applied egg-rr90.8%
unpow-190.8%
Simplified90.8%
Taylor expanded in y.im around 0 56.1%
unpow256.1%
unpow256.1%
hypot-def67.1%
Simplified67.1%
Final simplification57.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (sin t_0)))
(if (<= x.re -9.5e-234)
(* t_1 (pow (- (* (/ (* x.im x.im) x.re) -0.5) x.re) y.re))
(if (<= x.re 1.3e-159)
(* t_0 (pow (sqrt (+ (* x.re x.re) (* x.im x.im))) y.re))
(* t_1 (pow 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double tmp;
if (x_46_re <= -9.5e-234) {
tmp = t_1 * pow(((((x_46_im * x_46_im) / x_46_re) * -0.5) - x_46_re), y_46_re);
} else if (x_46_re <= 1.3e-159) {
tmp = t_0 * pow(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else {
tmp = t_1 * 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
t_1 = sin(t_0)
if (x_46re <= (-9.5d-234)) then
tmp = t_1 * (((((x_46im * x_46im) / x_46re) * (-0.5d0)) - x_46re) ** y_46re)
else if (x_46re <= 1.3d-159) then
tmp = t_0 * (sqrt(((x_46re * x_46re) + (x_46im * x_46im))) ** y_46re)
else
tmp = t_1 * (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 t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin(t_0);
double tmp;
if (x_46_re <= -9.5e-234) {
tmp = t_1 * Math.pow(((((x_46_im * x_46_im) / x_46_re) * -0.5) - x_46_re), y_46_re);
} else if (x_46_re <= 1.3e-159) {
tmp = t_0 * Math.pow(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else {
tmp = t_1 * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.sin(t_0) tmp = 0 if x_46_re <= -9.5e-234: tmp = t_1 * math.pow(((((x_46_im * x_46_im) / x_46_re) * -0.5) - x_46_re), y_46_re) elif x_46_re <= 1.3e-159: tmp = t_0 * math.pow(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re) else: tmp = t_1 * math.pow(x_46_re, y_46_re) 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 = sin(t_0) tmp = 0.0 if (x_46_re <= -9.5e-234) tmp = Float64(t_1 * (Float64(Float64(Float64(Float64(x_46_im * x_46_im) / x_46_re) * -0.5) - x_46_re) ^ y_46_re)); elseif (x_46_re <= 1.3e-159) tmp = Float64(t_0 * (sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) ^ y_46_re)); else tmp = Float64(t_1 * (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) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = sin(t_0); tmp = 0.0; if (x_46_re <= -9.5e-234) tmp = t_1 * (((((x_46_im * x_46_im) / x_46_re) * -0.5) - x_46_re) ^ y_46_re); elseif (x_46_re <= 1.3e-159) tmp = t_0 * (sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))) ^ y_46_re); else tmp = t_1 * (x_46_re ^ 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[x$46$re, -9.5e-234], N[(t$95$1 * N[Power[N[(N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * -0.5), $MachinePrecision] - x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.3e-159], N[(t$95$0 * N[Power[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t_0\\
\mathbf{if}\;x.re \leq -9.5 \cdot 10^{-234}:\\
\;\;\;\;t_1 \cdot {\left(\frac{x.im \cdot x.im}{x.re} \cdot -0.5 - x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 1.3 \cdot 10^{-159}:\\
\;\;\;\;t_0 \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -9.4999999999999999e-234Initial program 43.7%
exp-diff36.3%
exp-to-pow36.3%
hypot-def36.3%
*-commutative36.3%
exp-prod36.3%
+-commutative36.3%
*-commutative36.3%
fma-def36.3%
+-commutative36.3%
Simplified74.9%
clear-num75.0%
inv-pow75.0%
Applied egg-rr75.0%
unpow-175.0%
Simplified75.0%
Taylor expanded in y.im around 0 52.3%
+-commutative52.3%
unpow252.3%
unpow252.3%
Simplified52.3%
Taylor expanded in x.re around -inf 53.7%
+-commutative53.7%
mul-1-neg53.7%
unsub-neg53.7%
*-commutative53.7%
unpow253.7%
Simplified53.7%
if -9.4999999999999999e-234 < x.re < 1.2999999999999999e-159Initial program 49.3%
exp-diff42.1%
exp-to-pow42.3%
hypot-def42.3%
*-commutative42.3%
exp-prod42.3%
+-commutative42.3%
*-commutative42.3%
fma-def42.3%
+-commutative42.3%
Simplified82.7%
clear-num82.7%
inv-pow82.7%
Applied egg-rr82.7%
unpow-182.7%
Simplified82.7%
Taylor expanded in y.im around 0 64.4%
+-commutative64.4%
unpow264.4%
unpow264.4%
Simplified64.4%
Taylor expanded in y.re around 0 57.3%
if 1.2999999999999999e-159 < x.re Initial program 36.5%
exp-diff33.3%
exp-to-pow33.3%
hypot-def33.3%
*-commutative33.3%
exp-prod33.3%
+-commutative33.3%
*-commutative33.3%
fma-def33.3%
+-commutative33.3%
Simplified72.9%
clear-num72.9%
inv-pow72.9%
Applied egg-rr72.9%
unpow-172.9%
Simplified72.9%
Taylor expanded in x.im around 0 71.0%
Taylor expanded in y.im around 0 48.4%
*-commutative48.4%
Simplified48.4%
Final simplification52.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re 7.5e+15)
(* t_0 (pow (sqrt (+ (* x.re x.re) (* x.im x.im))) y.re))
(* (sin t_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 t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= 7.5e+15) {
tmp = t_0 * pow(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else {
tmp = sin(t_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) :: t_0
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
if (y_46re <= 7.5d+15) then
tmp = t_0 * (sqrt(((x_46re * x_46re) + (x_46im * x_46im))) ** y_46re)
else
tmp = sin(t_0) * (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 t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= 7.5e+15) {
tmp = t_0 * Math.pow(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else {
tmp = Math.sin(t_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): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_re <= 7.5e+15: tmp = t_0 * math.pow(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re) else: tmp = math.sin(t_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) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= 7.5e+15) tmp = Float64(t_0 * (sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) ^ y_46_re)); else tmp = Float64(sin(t_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) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= 7.5e+15) tmp = t_0 * (sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))) ^ y_46_re); else tmp = sin(t_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_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, 7.5e+15], N[(t$95$0 * N[Power[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq 7.5 \cdot 10^{+15}:\\
\;\;\;\;t_0 \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\sin t_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < 7.5e15Initial program 40.2%
exp-diff36.5%
exp-to-pow36.6%
hypot-def36.6%
*-commutative36.6%
exp-prod36.6%
+-commutative36.6%
*-commutative36.6%
fma-def36.6%
+-commutative36.6%
Simplified81.5%
clear-num81.5%
inv-pow81.5%
Applied egg-rr81.5%
unpow-181.5%
Simplified81.5%
Taylor expanded in y.im around 0 47.3%
+-commutative47.3%
unpow247.3%
unpow247.3%
Simplified47.3%
Taylor expanded in y.re around 0 45.7%
if 7.5e15 < y.re Initial program 47.6%
exp-diff34.9%
exp-to-pow34.9%
hypot-def34.9%
*-commutative34.9%
exp-prod34.9%
+-commutative34.9%
*-commutative34.9%
fma-def34.9%
+-commutative34.9%
Simplified57.1%
clear-num57.1%
inv-pow57.1%
Applied egg-rr57.1%
unpow-157.1%
Simplified57.1%
Taylor expanded in x.im around 0 38.2%
Taylor expanded in y.im around 0 62.2%
*-commutative62.2%
Simplified62.2%
Final simplification49.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (or (<= x.im -7e+104) (and (not (<= x.im -2e+32)) (<= x.im -2.2e-298)))
(* t_0 (pow x.re y.re))
(* t_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 t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((x_46_im <= -7e+104) || (!(x_46_im <= -2e+32) && (x_46_im <= -2.2e-298))) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = sin((y_46re * atan2(x_46im, x_46re)))
if ((x_46im <= (-7d+104)) .or. (.not. (x_46im <= (-2d+32))) .and. (x_46im <= (-2.2d-298))) then
tmp = t_0 * (x_46re ** y_46re)
else
tmp = t_0 * (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 t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((x_46_im <= -7e+104) || (!(x_46_im <= -2e+32) && (x_46_im <= -2.2e-298))) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else {
tmp = t_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): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (x_46_im <= -7e+104) or (not (x_46_im <= -2e+32) and (x_46_im <= -2.2e-298)): tmp = t_0 * math.pow(x_46_re, y_46_re) else: tmp = t_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) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((x_46_im <= -7e+104) || (!(x_46_im <= -2e+32) && (x_46_im <= -2.2e-298))) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); else tmp = Float64(t_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) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if ((x_46_im <= -7e+104) || (~((x_46_im <= -2e+32)) && (x_46_im <= -2.2e-298))) tmp = t_0 * (x_46_re ^ y_46_re); else tmp = t_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_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x$46$im, -7e+104], And[N[Not[LessEqual[x$46$im, -2e+32]], $MachinePrecision], LessEqual[x$46$im, -2.2e-298]]], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -7 \cdot 10^{+104} \lor \neg \left(x.im \leq -2 \cdot 10^{+32}\right) \land x.im \leq -2.2 \cdot 10^{-298}:\\
\;\;\;\;t_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -7.0000000000000003e104 or -2.00000000000000011e32 < x.im < -2.2e-298Initial program 37.5%
exp-diff34.3%
exp-to-pow34.3%
hypot-def34.3%
*-commutative34.3%
exp-prod34.3%
+-commutative34.3%
*-commutative34.3%
fma-def34.3%
+-commutative34.3%
Simplified78.8%
clear-num78.8%
inv-pow78.8%
Applied egg-rr78.8%
unpow-178.8%
Simplified78.8%
Taylor expanded in x.im around 0 36.5%
Taylor expanded in y.im around 0 46.5%
*-commutative46.5%
Simplified46.5%
if -7.0000000000000003e104 < x.im < -2.00000000000000011e32 or -2.2e-298 < x.im Initial program 46.6%
exp-diff38.0%
exp-to-pow38.0%
hypot-def38.0%
*-commutative38.0%
exp-prod38.0%
+-commutative38.0%
*-commutative38.0%
fma-def38.0%
+-commutative38.0%
Simplified72.2%
clear-num72.2%
inv-pow72.2%
Applied egg-rr72.2%
unpow-172.2%
Simplified72.2%
Taylor expanded in y.im around 0 47.7%
+-commutative47.7%
unpow247.7%
unpow247.7%
Simplified47.7%
Taylor expanded in x.re around 0 43.7%
Final simplification45.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.re -1.5e-71)
(* t_0 (pow (- x.re) y.re))
(if (<= x.re 1.3e-159)
(* t_0 (pow (- x.im) y.re))
(* t_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 t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -1.5e-71) {
tmp = t_0 * pow(-x_46_re, y_46_re);
} else if (x_46_re <= 1.3e-159) {
tmp = t_0 * pow(-x_46_im, y_46_re);
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46re <= (-1.5d-71)) then
tmp = t_0 * (-x_46re ** y_46re)
else if (x_46re <= 1.3d-159) then
tmp = t_0 * (-x_46im ** y_46re)
else
tmp = t_0 * (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 t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -1.5e-71) {
tmp = t_0 * Math.pow(-x_46_re, y_46_re);
} else if (x_46_re <= 1.3e-159) {
tmp = t_0 * Math.pow(-x_46_im, y_46_re);
} else {
tmp = t_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): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= -1.5e-71: tmp = t_0 * math.pow(-x_46_re, y_46_re) elif x_46_re <= 1.3e-159: tmp = t_0 * math.pow(-x_46_im, y_46_re) else: tmp = t_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) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -1.5e-71) tmp = Float64(t_0 * (Float64(-x_46_re) ^ y_46_re)); elseif (x_46_re <= 1.3e-159) tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re)); else tmp = Float64(t_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) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= -1.5e-71) tmp = t_0 * (-x_46_re ^ y_46_re); elseif (x_46_re <= 1.3e-159) tmp = t_0 * (-x_46_im ^ y_46_re); else tmp = t_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_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -1.5e-71], N[(t$95$0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.3e-159], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -1.5 \cdot 10^{-71}:\\
\;\;\;\;t_0 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 1.3 \cdot 10^{-159}:\\
\;\;\;\;t_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -1.5000000000000001e-71Initial program 40.1%
exp-diff35.0%
exp-to-pow35.0%
hypot-def35.0%
*-commutative35.0%
exp-prod35.0%
+-commutative35.0%
*-commutative35.0%
fma-def35.0%
+-commutative35.0%
Simplified78.2%
clear-num78.2%
inv-pow78.2%
Applied egg-rr78.2%
unpow-178.2%
Simplified78.2%
Taylor expanded in y.im around 0 49.6%
+-commutative49.6%
unpow249.6%
unpow249.6%
Simplified49.6%
Taylor expanded in x.re around -inf 50.4%
mul-1-neg50.4%
Simplified50.4%
if -1.5000000000000001e-71 < x.re < 1.2999999999999999e-159Initial program 52.5%
exp-diff41.9%
exp-to-pow42.0%
hypot-def42.0%
*-commutative42.0%
exp-prod42.0%
+-commutative42.0%
*-commutative42.0%
fma-def42.1%
+-commutative42.1%
Simplified75.2%
clear-num75.2%
inv-pow75.2%
Applied egg-rr75.2%
unpow-175.2%
Simplified75.2%
Taylor expanded in y.im around 0 64.0%
+-commutative64.0%
unpow264.0%
unpow264.0%
Simplified64.0%
Taylor expanded in x.im around -inf 52.4%
mul-1-neg52.4%
Simplified52.4%
if 1.2999999999999999e-159 < x.re Initial program 36.5%
exp-diff33.3%
exp-to-pow33.3%
hypot-def33.3%
*-commutative33.3%
exp-prod33.3%
+-commutative33.3%
*-commutative33.3%
fma-def33.3%
+-commutative33.3%
Simplified72.9%
clear-num72.9%
inv-pow72.9%
Applied egg-rr72.9%
unpow-172.9%
Simplified72.9%
Taylor expanded in x.im around 0 71.0%
Taylor expanded in y.im around 0 48.4%
*-commutative48.4%
Simplified48.4%
Final simplification50.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -1.7e-41)
(* t_0 (pow (- x.im) y.re))
(if (<= x.im -1.95e-298)
(* t_0 (pow x.re y.re))
(* t_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 t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -1.7e-41) {
tmp = t_0 * pow(-x_46_im, y_46_re);
} else if (x_46_im <= -1.95e-298) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46im <= (-1.7d-41)) then
tmp = t_0 * (-x_46im ** y_46re)
else if (x_46im <= (-1.95d-298)) then
tmp = t_0 * (x_46re ** y_46re)
else
tmp = t_0 * (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 t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -1.7e-41) {
tmp = t_0 * Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= -1.95e-298) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else {
tmp = t_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): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -1.7e-41: tmp = t_0 * math.pow(-x_46_im, y_46_re) elif x_46_im <= -1.95e-298: tmp = t_0 * math.pow(x_46_re, y_46_re) else: tmp = t_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) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -1.7e-41) tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re)); elseif (x_46_im <= -1.95e-298) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); else tmp = Float64(t_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) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -1.7e-41) tmp = t_0 * (-x_46_im ^ y_46_re); elseif (x_46_im <= -1.95e-298) tmp = t_0 * (x_46_re ^ y_46_re); else tmp = t_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_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.7e-41], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -1.95e-298], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -1.7 \cdot 10^{-41}:\\
\;\;\;\;t_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq -1.95 \cdot 10^{-298}:\\
\;\;\;\;t_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -1.6999999999999999e-41Initial program 33.7%
exp-diff28.1%
exp-to-pow28.2%
hypot-def28.2%
*-commutative28.2%
exp-prod28.2%
+-commutative28.2%
*-commutative28.2%
fma-def28.2%
+-commutative28.2%
Simplified74.6%
clear-num74.6%
inv-pow74.6%
Applied egg-rr74.6%
unpow-174.6%
Simplified74.6%
Taylor expanded in y.im around 0 55.9%
+-commutative55.9%
unpow255.9%
unpow255.9%
Simplified55.9%
Taylor expanded in x.im around -inf 56.2%
mul-1-neg56.2%
Simplified56.2%
if -1.6999999999999999e-41 < x.im < -1.95000000000000014e-298Initial program 48.5%
exp-diff44.3%
exp-to-pow44.3%
hypot-def44.3%
*-commutative44.3%
exp-prod44.3%
+-commutative44.3%
*-commutative44.3%
fma-def44.3%
+-commutative44.3%
Simplified80.4%
clear-num80.4%
inv-pow80.4%
Applied egg-rr80.4%
unpow-180.4%
Simplified80.4%
Taylor expanded in x.im around 0 34.7%
Taylor expanded in y.im around 0 46.5%
*-commutative46.5%
Simplified46.5%
if -1.95000000000000014e-298 < x.im Initial program 43.1%
exp-diff36.0%
exp-to-pow36.0%
hypot-def36.0%
*-commutative36.0%
exp-prod36.0%
+-commutative36.0%
*-commutative36.0%
fma-def36.0%
+-commutative36.0%
Simplified73.0%
clear-num73.0%
inv-pow73.0%
Applied egg-rr73.0%
unpow-173.0%
Simplified73.0%
Taylor expanded in y.im around 0 45.1%
+-commutative45.1%
unpow245.1%
unpow245.1%
Simplified45.1%
Taylor expanded in x.re around 0 42.4%
Final simplification47.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) (pow x.im y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, 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
code = sin((y_46re * atan2(x_46im, x_46re))) * (x_46im ** y_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}
\end{array}
Initial program 42.0%
exp-diff36.1%
exp-to-pow36.2%
hypot-def36.2%
*-commutative36.2%
exp-prod36.2%
+-commutative36.2%
*-commutative36.2%
fma-def36.2%
+-commutative36.2%
Simplified75.5%
clear-num75.5%
inv-pow75.5%
Applied egg-rr75.5%
unpow-175.5%
Simplified75.5%
Taylor expanded in y.im around 0 50.5%
+-commutative50.5%
unpow250.5%
unpow250.5%
Simplified50.5%
Taylor expanded in x.re around 0 33.7%
Final simplification33.7%
herbie shell --seed 2023293
(FPCore (x.re x.im y.re y.im)
:name "powComplex, imaginary part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))