
(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 15 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)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (* y.im (atan2 x.im x.re)))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2)))
(t_4 (* y.im (log (hypot x.im x.re)))))
(if (<= y.re -1e+110)
(* (pow (hypot x.re x.im) y.re) (sin (pow (cbrt (fma y.im t_0 t_1)) 3.0)))
(if (<= y.re 4.1e+35)
(* (exp (- (* y.re t_0) t_2)) (sin (fma t_0 y.im t_1)))
(if (<= y.re 1.8e+234)
(* t_3 (sin t_4))
(* t_3 (sin (+ t_1 (fabs t_4)))))))))
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));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = y_46_im * atan2(x_46_im, x_46_re);
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double t_4 = y_46_im * log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -1e+110) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(pow(cbrt(fma(y_46_im, t_0, t_1)), 3.0));
} else if (y_46_re <= 4.1e+35) {
tmp = exp(((y_46_re * t_0) - t_2)) * sin(fma(t_0, y_46_im, t_1));
} else if (y_46_re <= 1.8e+234) {
tmp = t_3 * sin(t_4);
} else {
tmp = t_3 * sin((t_1 + fabs(t_4)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_2)) t_4 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -1e+110) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin((cbrt(fma(y_46_im, t_0, t_1)) ^ 3.0))); elseif (y_46_re <= 4.1e+35) tmp = Float64(exp(Float64(Float64(y_46_re * t_0) - t_2)) * sin(fma(t_0, y_46_im, t_1))); elseif (y_46_re <= 1.8e+234) tmp = Float64(t_3 * sin(t_4)); else tmp = Float64(t_3 * sin(Float64(t_1 + abs(t_4)))); end return tmp 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]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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] - t$95$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1e+110], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$0 + t$95$1), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.1e+35], N[(N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.8e+234], N[(t$95$3 * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Sin[N[(t$95$1 + N[Abs[t$95$4], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_2}\\
t_4 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{+110}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, t_0, t_1\right)}\right)}^{3}\right)\\
\mathbf{elif}\;y.re \leq 4.1 \cdot 10^{+35}:\\
\;\;\;\;e^{y.re \cdot t_0 - t_2} \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, t_1\right)\right)\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{+234}:\\
\;\;\;\;t_3 \cdot \sin t_4\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \sin \left(t_1 + \left|t_4\right|\right)\\
\end{array}
\end{array}
if y.re < -1e110Initial program 22.4%
exp-diff18.4%
exp-to-pow18.4%
hypot-def18.4%
*-commutative18.4%
exp-prod18.4%
+-commutative18.4%
*-commutative18.4%
fma-def18.4%
+-commutative18.4%
Simplified69.4%
Taylor expanded in y.im around 0 85.7%
fma-udef85.7%
*-commutative85.7%
hypot-udef22.4%
+-commutative22.4%
add-cube-cbrt32.7%
pow332.7%
*-commutative32.7%
hypot-udef93.9%
fma-def93.9%
Applied egg-rr93.9%
if -1e110 < y.re < 4.0999999999999998e35Initial program 36.4%
hypot-def36.4%
fma-def36.4%
hypot-def82.2%
*-commutative82.2%
Simplified82.2%
if 4.0999999999999998e35 < y.re < 1.8e234Initial program 24.4%
Taylor expanded in y.re around 0 39.0%
unpow239.0%
unpow239.0%
hypot-def68.4%
Simplified68.4%
if 1.8e234 < y.re Initial program 29.4%
add-sqr-sqrt23.5%
sqrt-unprod17.6%
pow217.6%
*-commutative17.6%
hypot-udef41.2%
Applied egg-rr41.2%
unpow241.2%
rem-sqrt-square70.6%
hypot-def29.4%
unpow229.4%
unpow229.4%
+-commutative29.4%
unpow229.4%
unpow229.4%
hypot-def70.6%
Simplified70.6%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (* y.im (atan2 x.im x.re)))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2))))
(if (<= y.re -1.1e+110)
(* (pow (hypot x.re x.im) y.re) (sin (pow (cbrt (fma y.im t_0 t_1)) 3.0)))
(if (<= y.re 2.9e+35)
(* (exp (- (* y.re t_0) t_2)) (sin (fma t_0 y.im t_1)))
(if (<= y.re 2.8e+234)
(* t_3 (sin (* y.im (log (hypot x.im x.re)))))
(* t_3 (sin t_1)))))))
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));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = y_46_im * atan2(x_46_im, x_46_re);
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double tmp;
if (y_46_re <= -1.1e+110) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(pow(cbrt(fma(y_46_im, t_0, t_1)), 3.0));
} else if (y_46_re <= 2.9e+35) {
tmp = exp(((y_46_re * t_0) - t_2)) * sin(fma(t_0, y_46_im, t_1));
} else if (y_46_re <= 2.8e+234) {
tmp = t_3 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = t_3 * sin(t_1);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_2)) tmp = 0.0 if (y_46_re <= -1.1e+110) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin((cbrt(fma(y_46_im, t_0, t_1)) ^ 3.0))); elseif (y_46_re <= 2.9e+35) tmp = Float64(exp(Float64(Float64(y_46_re * t_0) - t_2)) * sin(fma(t_0, y_46_im, t_1))); elseif (y_46_re <= 2.8e+234) tmp = Float64(t_3 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(t_3 * sin(t_1)); end return tmp 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]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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] - t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.1e+110], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$0 + t$95$1), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.9e+35], N[(N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.8e+234], N[(t$95$3 * 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$3 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_2}\\
\mathbf{if}\;y.re \leq -1.1 \cdot 10^{+110}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, t_0, t_1\right)}\right)}^{3}\right)\\
\mathbf{elif}\;y.re \leq 2.9 \cdot 10^{+35}:\\
\;\;\;\;e^{y.re \cdot t_0 - t_2} \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, t_1\right)\right)\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{+234}:\\
\;\;\;\;t_3 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \sin t_1\\
\end{array}
\end{array}
if y.re < -1.09999999999999996e110Initial program 22.4%
exp-diff18.4%
exp-to-pow18.4%
hypot-def18.4%
*-commutative18.4%
exp-prod18.4%
+-commutative18.4%
*-commutative18.4%
fma-def18.4%
+-commutative18.4%
Simplified69.4%
Taylor expanded in y.im around 0 85.7%
fma-udef85.7%
*-commutative85.7%
hypot-udef22.4%
+-commutative22.4%
add-cube-cbrt32.7%
pow332.7%
*-commutative32.7%
hypot-udef93.9%
fma-def93.9%
Applied egg-rr93.9%
if -1.09999999999999996e110 < y.re < 2.89999999999999995e35Initial program 36.4%
hypot-def36.4%
fma-def36.4%
hypot-def82.2%
*-commutative82.2%
Simplified82.2%
if 2.89999999999999995e35 < y.re < 2.7999999999999998e234Initial program 24.4%
Taylor expanded in y.re around 0 39.0%
unpow239.0%
unpow239.0%
hypot-def68.4%
Simplified68.4%
if 2.7999999999999998e234 < y.re Initial program 29.4%
Taylor expanded in y.im around 0 70.6%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (* y.im (atan2 x.im x.re)))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2))))
(if (<= y.re -8.6e+63)
(fabs (* (pow (hypot x.im x.re) y.re) (sin (fma y.im t_0 t_1))))
(if (<= y.re 118000000000.0)
(*
(/ (pow (hypot x.re x.im) y.re) (exp t_2))
(sin (fma y.re (atan2 x.im x.re) (* y.im (log (hypot x.re x.im))))))
(if (<= y.re 2.45e+235)
(* t_3 (sin (* y.im t_0)))
(* t_3 (sin t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = y_46_im * atan2(x_46_im, x_46_re);
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double tmp;
if (y_46_re <= -8.6e+63) {
tmp = fabs((pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(y_46_im, t_0, t_1))));
} else if (y_46_re <= 118000000000.0) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / exp(t_2)) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * log(hypot(x_46_re, x_46_im)))));
} else if (y_46_re <= 2.45e+235) {
tmp = t_3 * sin((y_46_im * t_0));
} else {
tmp = t_3 * sin(t_1);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_2)) tmp = 0.0 if (y_46_re <= -8.6e+63) tmp = abs(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(y_46_im, t_0, t_1)))); elseif (y_46_re <= 118000000000.0) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / exp(t_2)) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * log(hypot(x_46_re, x_46_im)))))); elseif (y_46_re <= 2.45e+235) tmp = Float64(t_3 * sin(Float64(y_46_im * t_0))); else tmp = Float64(t_3 * sin(t_1)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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] - t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -8.6e+63], N[Abs[N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 118000000000.0], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Exp[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.45e+235], N[(t$95$3 * N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_2}\\
\mathbf{if}\;y.re \leq -8.6 \cdot 10^{+63}:\\
\;\;\;\;\left|{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.im, t_0, t_1\right)\right)\right|\\
\mathbf{elif}\;y.re \leq 118000000000:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{t_2}} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 2.45 \cdot 10^{+235}:\\
\;\;\;\;t_3 \cdot \sin \left(y.im \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \sin t_1\\
\end{array}
\end{array}
if y.re < -8.6000000000000001e63Initial program 23.2%
exp-diff19.6%
exp-to-pow19.6%
hypot-def19.6%
*-commutative19.6%
exp-prod19.6%
+-commutative19.6%
*-commutative19.6%
fma-def19.6%
+-commutative19.6%
Simplified67.9%
Taylor expanded in y.im around 0 82.2%
add-sqr-sqrt80.4%
sqrt-unprod89.4%
pow289.4%
Applied egg-rr89.4%
unpow289.4%
rem-sqrt-square89.4%
*-commutative89.4%
Simplified89.4%
if -8.6000000000000001e63 < y.re < 1.18e11Initial program 37.2%
exp-diff37.2%
exp-to-pow37.2%
hypot-def37.2%
*-commutative37.2%
exp-prod36.8%
+-commutative36.8%
*-commutative36.8%
fma-def36.8%
+-commutative36.8%
Simplified81.8%
Taylor expanded in y.im around inf 82.3%
if 1.18e11 < y.re < 2.4499999999999999e235Initial program 24.4%
Taylor expanded in y.re around 0 37.8%
unpow237.8%
unpow237.8%
hypot-def64.6%
Simplified64.6%
if 2.4499999999999999e235 < y.re Initial program 29.4%
Taylor expanded in y.im around 0 70.6%
Final simplification80.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.im (atan2 x.im x.re)))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))
(sin t_2)))
(t_4 (pow (hypot x.re x.im) y.re)))
(if (<= y.im -65000000.0)
t_3
(if (<= y.im 1.32e-151)
(* t_4 (sin (pow (cbrt (fma y.im t_0 t_2)) 3.0)))
(if (<= y.im 7.8e-53)
(fabs
(*
(pow (hypot x.im x.re) y.re)
(sin (fma y.im (log (hypot x.im x.re)) t_2))))
(if (<= y.im 250.0)
(*
(sin (fma y.re (atan2 x.im x.re) (* y.im t_0)))
(/ t_4 (+ 1.0 t_1)))
t_3))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * sin(t_2);
double t_4 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_im <= -65000000.0) {
tmp = t_3;
} else if (y_46_im <= 1.32e-151) {
tmp = t_4 * sin(pow(cbrt(fma(y_46_im, t_0, t_2)), 3.0));
} else if (y_46_im <= 7.8e-53) {
tmp = fabs((pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_2))));
} else if (y_46_im <= 250.0) {
tmp = sin(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * t_0))) * (t_4 / (1.0 + t_1));
} else {
tmp = t_3;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1)) * sin(t_2)) t_4 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_im <= -65000000.0) tmp = t_3; elseif (y_46_im <= 1.32e-151) tmp = Float64(t_4 * sin((cbrt(fma(y_46_im, t_0, t_2)) ^ 3.0))); elseif (y_46_im <= 7.8e-53) tmp = abs(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_2)))); elseif (y_46_im <= 250.0) tmp = Float64(sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * t_0))) * Float64(t_4 / Float64(1.0 + t_1))); else tmp = t_3; end return tmp 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]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$im, -65000000.0], t$95$3, If[LessEqual[y$46$im, 1.32e-151], N[(t$95$4 * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$0 + t$95$2), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7.8e-53], N[Abs[N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$im, 250.0], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$4 / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1} \cdot \sin t_2\\
t_4 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -65000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.im \leq 1.32 \cdot 10^{-151}:\\
\;\;\;\;t_4 \cdot \sin \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, t_0, t_2\right)}\right)}^{3}\right)\\
\mathbf{elif}\;y.im \leq 7.8 \cdot 10^{-53}:\\
\;\;\;\;\left|{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t_2\right)\right)\right|\\
\mathbf{elif}\;y.im \leq 250:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t_0\right)\right) \cdot \frac{t_4}{1 + t_1}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y.im < -6.5e7 or 250 < y.im Initial program 29.9%
Taylor expanded in y.im around 0 60.9%
if -6.5e7 < y.im < 1.31999999999999999e-151Initial program 30.6%
exp-diff30.6%
exp-to-pow30.6%
hypot-def30.6%
*-commutative30.6%
exp-prod30.6%
+-commutative30.6%
*-commutative30.6%
fma-def30.6%
+-commutative30.6%
Simplified86.3%
Taylor expanded in y.im around 0 82.4%
fma-udef82.4%
*-commutative82.4%
hypot-udef29.5%
+-commutative29.5%
add-cube-cbrt34.9%
pow335.9%
*-commutative35.9%
hypot-udef84.3%
fma-def84.3%
Applied egg-rr84.3%
if 1.31999999999999999e-151 < y.im < 7.8000000000000004e-53Initial program 28.6%
exp-diff28.6%
exp-to-pow28.6%
hypot-def28.6%
*-commutative28.6%
exp-prod28.6%
+-commutative28.6%
*-commutative28.6%
fma-def28.6%
+-commutative28.6%
Simplified66.5%
Taylor expanded in y.im around 0 66.5%
add-sqr-sqrt56.8%
sqrt-unprod90.6%
pow290.6%
Applied egg-rr90.5%
unpow290.5%
rem-sqrt-square90.5%
*-commutative90.5%
Simplified90.5%
if 7.8000000000000004e-53 < y.im < 250Initial program 57.0%
exp-diff57.0%
exp-to-pow57.0%
hypot-def57.0%
*-commutative57.0%
exp-prod56.8%
+-commutative56.8%
*-commutative56.8%
fma-def57.0%
+-commutative57.0%
Simplified98.2%
Taylor expanded in y.im around 0 88.5%
Final simplification74.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))
(t_3 (log (hypot x.im x.re))))
(if (<= y.im -620000000.0)
(* t_2 (sin t_1))
(if (<= y.im 5.8e-276)
(*
(sin (fma y.re (atan2 x.im x.re) (* y.im (log (hypot x.re x.im)))))
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_0)))
(if (<= y.im 3.6e-88)
(fabs (* (pow (hypot x.im x.re) y.re) (sin (fma y.im t_3 t_1))))
(* t_2 (sin (* y.im t_3))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double t_3 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -620000000.0) {
tmp = t_2 * sin(t_1);
} else if (y_46_im <= 5.8e-276) {
tmp = sin(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * log(hypot(x_46_re, x_46_im))))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0));
} else if (y_46_im <= 3.6e-88) {
tmp = fabs((pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(y_46_im, t_3, t_1))));
} else {
tmp = t_2 * sin((y_46_im * t_3));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) 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))))) - t_0)) t_3 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -620000000.0) tmp = Float64(t_2 * sin(t_1)); elseif (y_46_im <= 5.8e-276) tmp = Float64(sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * log(hypot(x_46_re, x_46_im))))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_0))); elseif (y_46_im <= 3.6e-88) tmp = abs(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(y_46_im, t_3, t_1)))); else tmp = Float64(t_2 * sin(Float64(y_46_im * t_3))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -620000000.0], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5.8e-276], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.6e-88], N[Abs[N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$3 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$2 * N[Sin[N[(y$46$im * t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -620000000:\\
\;\;\;\;t_2 \cdot \sin t_1\\
\mathbf{elif}\;y.im \leq 5.8 \cdot 10^{-276}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t_0}\\
\mathbf{elif}\;y.im \leq 3.6 \cdot 10^{-88}:\\
\;\;\;\;\left|{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.im, t_3, t_1\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin \left(y.im \cdot t_3\right)\\
\end{array}
\end{array}
if y.im < -6.2e8Initial program 31.4%
Taylor expanded in y.im around 0 60.5%
if -6.2e8 < y.im < 5.79999999999999975e-276Initial program 30.0%
exp-diff30.0%
exp-to-pow30.0%
hypot-def30.0%
*-commutative30.0%
exp-prod30.0%
+-commutative30.0%
*-commutative30.0%
fma-def30.0%
+-commutative30.0%
Simplified90.1%
Taylor expanded in y.im around 0 85.0%
if 5.79999999999999975e-276 < y.im < 3.5999999999999999e-88Initial program 29.1%
exp-diff29.1%
exp-to-pow29.1%
hypot-def29.1%
*-commutative29.1%
exp-prod29.1%
+-commutative29.1%
*-commutative29.1%
fma-def29.1%
+-commutative29.1%
Simplified74.9%
Taylor expanded in y.im around 0 74.9%
add-sqr-sqrt66.3%
sqrt-unprod74.3%
pow274.3%
Applied egg-rr74.3%
unpow274.3%
rem-sqrt-square85.5%
*-commutative85.5%
Simplified85.5%
if 3.5999999999999999e-88 < y.im Initial program 33.9%
Taylor expanded in y.re around 0 31.6%
unpow231.6%
unpow231.6%
hypot-def64.4%
Simplified64.4%
Final simplification73.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))
(t_2 (log (hypot x.im x.re))))
(if (<= y.im -4e+28)
(* t_1 (sin t_0))
(if (<= y.im 1.32e-278)
(*
(pow (hypot x.re x.im) y.re)
(sin (fma y.re (atan2 x.im x.re) (* y.im (log (hypot x.re x.im))))))
(if (<= y.im 4.1e-88)
(fabs (* (pow (hypot x.im x.re) y.re) (sin (fma y.im t_2 t_0))))
(* t_1 (sin (* y.im 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 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_2 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -4e+28) {
tmp = t_1 * sin(t_0);
} else if (y_46_im <= 1.32e-278) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * log(hypot(x_46_re, x_46_im)))));
} else if (y_46_im <= 4.1e-88) {
tmp = fabs((pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(y_46_im, t_2, t_0))));
} else {
tmp = t_1 * sin((y_46_im * 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 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) t_2 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -4e+28) tmp = Float64(t_1 * sin(t_0)); elseif (y_46_im <= 1.32e-278) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * log(hypot(x_46_re, x_46_im)))))); elseif (y_46_im <= 4.1e-88) tmp = abs(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(y_46_im, t_2, t_0)))); else tmp = Float64(t_1 * sin(Float64(y_46_im * t_2))); 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[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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -4e+28], N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.32e-278], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.1e-88], N[Abs[N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$2 + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$1 * N[Sin[N[(y$46$im * t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -4 \cdot 10^{+28}:\\
\;\;\;\;t_1 \cdot \sin t_0\\
\mathbf{elif}\;y.im \leq 1.32 \cdot 10^{-278}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)\\
\mathbf{elif}\;y.im \leq 4.1 \cdot 10^{-88}:\\
\;\;\;\;\left|{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.im, t_2, t_0\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(y.im \cdot t_2\right)\\
\end{array}
\end{array}
if y.im < -3.99999999999999983e28Initial program 30.7%
Taylor expanded in y.im around 0 59.0%
if -3.99999999999999983e28 < y.im < 1.32e-278Initial program 30.5%
exp-diff30.5%
exp-to-pow30.5%
hypot-def30.5%
*-commutative30.5%
exp-prod30.5%
+-commutative30.5%
*-commutative30.5%
fma-def30.5%
+-commutative30.5%
Simplified90.4%
Taylor expanded in y.im around 0 84.9%
if 1.32e-278 < y.im < 4.1000000000000001e-88Initial program 29.1%
exp-diff29.1%
exp-to-pow29.1%
hypot-def29.1%
*-commutative29.1%
exp-prod29.1%
+-commutative29.1%
*-commutative29.1%
fma-def29.1%
+-commutative29.1%
Simplified74.9%
Taylor expanded in y.im around 0 74.9%
add-sqr-sqrt66.3%
sqrt-unprod74.3%
pow274.3%
Applied egg-rr74.3%
unpow274.3%
rem-sqrt-square85.5%
*-commutative85.5%
Simplified85.5%
if 4.1000000000000001e-88 < y.im Initial program 33.9%
Taylor expanded in y.re around 0 31.6%
unpow231.6%
unpow231.6%
hypot-def64.4%
Simplified64.4%
Final simplification73.3%
(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)))))
(* y.im (atan2 x.im x.re))))))
(if (<= y.im -4.5e+28)
(* t_0 (sin (* y.re (atan2 x.im x.re))))
(if (<= y.im 8.4e+17)
(*
(pow (hypot x.re x.im) y.re)
(sin (fma y.re (atan2 x.im x.re) (* y.im (log (hypot x.re x.im))))))
(* t_0 (sin (* y.im (log (hypot 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 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -4.5e+28) {
tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 8.4e+17) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * log(hypot(x_46_re, x_46_im)))));
} else {
tmp = t_0 * sin((y_46_im * log(hypot(x_46_im, x_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(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -4.5e+28) tmp = Float64(t_0 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_im <= 8.4e+17) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * log(hypot(x_46_re, x_46_im)))))); else tmp = Float64(t_0 * sin(Float64(y_46_im * log(hypot(x_46_im, x_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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -4.5e+28], 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$im, 8.4e+17], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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]]]]
\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) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -4.5 \cdot 10^{+28}:\\
\;\;\;\;t_0 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.im \leq 8.4 \cdot 10^{+17}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.im < -4.4999999999999997e28Initial program 30.7%
Taylor expanded in y.im around 0 59.0%
if -4.4999999999999997e28 < y.im < 8.4e17Initial program 32.9%
exp-diff32.9%
exp-to-pow32.9%
hypot-def32.9%
*-commutative32.9%
exp-prod32.9%
+-commutative32.9%
*-commutative32.9%
fma-def32.9%
+-commutative32.9%
Simplified83.5%
Taylor expanded in y.im around 0 81.0%
if 8.4e17 < y.im Initial program 28.4%
Taylor expanded in y.re around 0 26.7%
unpow226.7%
unpow226.7%
hypot-def59.8%
Simplified59.8%
Final simplification71.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -4e+28) (not (<= y.im 2.75e+76)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
(sin (* y.re (atan2 x.im x.re))))
(*
(pow (hypot x.re x.im) y.re)
(sin (fma y.re (atan2 x.im x.re) (* y.im (log (hypot x.re x.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -4e+28) || !(y_46_im <= 2.75e+76)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * log(hypot(x_46_re, x_46_im)))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -4e+28) || !(y_46_im <= 2.75e+76)) 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(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * log(hypot(x_46_re, x_46_im)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -4e+28], N[Not[LessEqual[y$46$im, 2.75e+76]], $MachinePrecision]], 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4 \cdot 10^{+28} \lor \neg \left(y.im \leq 2.75 \cdot 10^{+76}\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)\\
\end{array}
\end{array}
if y.im < -3.99999999999999983e28 or 2.75e76 < y.im Initial program 29.1%
Taylor expanded in y.im around 0 58.5%
if -3.99999999999999983e28 < y.im < 2.75e76Initial program 32.9%
exp-diff31.6%
exp-to-pow31.6%
hypot-def31.6%
*-commutative31.6%
exp-prod30.9%
+-commutative30.9%
*-commutative30.9%
fma-def30.9%
+-commutative30.9%
Simplified79.8%
Taylor expanded in y.im around 0 80.2%
Final simplification71.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (/ -1.0 x.im))))
(if (<= x.im -1.0)
(* (exp (- (* t_2 (- y.re)) t_0)) (sin (- t_1 (* y.im t_2))))
(if (<= x.im 2.45e+121)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(sin t_1))
(* (pow (hypot x.re x.im) y.re) (sin (+ t_1 (* y.im (log x.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -1.0) {
tmp = exp(((t_2 * -y_46_re) - t_0)) * sin((t_1 - (y_46_im * t_2)));
} else if (x_46_im <= 2.45e+121) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin(t_1);
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((t_1 + (y_46_im * log(x_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 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -1.0) {
tmp = Math.exp(((t_2 * -y_46_re) - t_0)) * Math.sin((t_1 - (y_46_im * t_2)));
} else if (x_46_im <= 2.45e+121) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * Math.sin(t_1);
} else {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((t_1 + (y_46_im * Math.log(x_46_im))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.log((-1.0 / x_46_im)) tmp = 0 if x_46_im <= -1.0: tmp = math.exp(((t_2 * -y_46_re) - t_0)) * math.sin((t_1 - (y_46_im * t_2))) elif x_46_im <= 2.45e+121: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * math.sin(t_1) else: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((t_1 + (y_46_im * math.log(x_46_im)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -1.0) tmp = Float64(exp(Float64(Float64(t_2 * Float64(-y_46_re)) - t_0)) * sin(Float64(t_1 - Float64(y_46_im * t_2)))); elseif (x_46_im <= 2.45e+121) 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))))) - t_0)) * sin(t_1)); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(t_1 + Float64(y_46_im * log(x_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = log((-1.0 / x_46_im)); tmp = 0.0; if (x_46_im <= -1.0) tmp = exp(((t_2 * -y_46_re) - t_0)) * sin((t_1 - (y_46_im * t_2))); elseif (x_46_im <= 2.45e+121) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin(t_1); else tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((t_1 + (y_46_im * log(x_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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.0], N[(N[Exp[N[(N[(t$95$2 * (-y$46$re)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 - N[(y$46$im * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2.45e+121], 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] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -1:\\
\;\;\;\;e^{t_2 \cdot \left(-y.re\right) - t_0} \cdot \sin \left(t_1 - y.im \cdot t_2\right)\\
\mathbf{elif}\;x.im \leq 2.45 \cdot 10^{+121}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot \sin t_1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(t_1 + y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -1Initial program 31.1%
hypot-def31.1%
fma-def31.1%
hypot-def76.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in x.im around -inf 76.9%
mul-1-neg76.9%
*-commutative76.9%
distribute-rgt-neg-in76.9%
Simplified76.9%
Taylor expanded in x.im around -inf 78.6%
+-commutative78.6%
*-commutative78.6%
mul-1-neg78.6%
unsub-neg78.6%
*-commutative78.6%
Simplified78.6%
if -1 < x.im < 2.4499999999999999e121Initial program 38.4%
Taylor expanded in y.im around 0 53.6%
if 2.4499999999999999e121 < x.im Initial program 6.9%
exp-diff6.9%
exp-to-pow6.9%
hypot-def6.9%
*-commutative6.9%
exp-prod6.9%
+-commutative6.9%
*-commutative6.9%
fma-def6.9%
+-commutative6.9%
Simplified71.9%
Taylor expanded in y.im around 0 58.7%
Taylor expanded in x.re around 0 56.8%
Final simplification60.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1)))
(if (<= x.im -6e+62)
(* t_2 (exp (- (* (log (/ -1.0 x.im)) (- y.re)) t_0)))
(if (<= x.im 1.12e+122)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_2)
(* (pow (hypot x.re x.im) y.re) (sin (+ t_1 (* y.im (log x.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double tmp;
if (x_46_im <= -6e+62) {
tmp = t_2 * exp(((log((-1.0 / x_46_im)) * -y_46_re) - t_0));
} else if (x_46_im <= 1.12e+122) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((t_1 + (y_46_im * log(x_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 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double tmp;
if (x_46_im <= -6e+62) {
tmp = t_2 * Math.exp(((Math.log((-1.0 / x_46_im)) * -y_46_re) - t_0));
} else if (x_46_im <= 1.12e+122) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
} else {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((t_1 + (y_46_im * Math.log(x_46_im))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) tmp = 0 if x_46_im <= -6e+62: tmp = t_2 * math.exp(((math.log((-1.0 / x_46_im)) * -y_46_re) - t_0)) elif x_46_im <= 1.12e+122: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2 else: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((t_1 + (y_46_im * math.log(x_46_im)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) tmp = 0.0 if (x_46_im <= -6e+62) tmp = Float64(t_2 * exp(Float64(Float64(log(Float64(-1.0 / x_46_im)) * Float64(-y_46_re)) - t_0))); elseif (x_46_im <= 1.12e+122) 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))))) - t_0)) * t_2); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(t_1 + Float64(y_46_im * log(x_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); tmp = 0.0; if (x_46_im <= -6e+62) tmp = t_2 * exp(((log((-1.0 / x_46_im)) * -y_46_re) - t_0)); elseif (x_46_im <= 1.12e+122) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2; else tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((t_1 + (y_46_im * log(x_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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[x$46$im, -6e+62], N[(t$95$2 * N[Exp[N[(N[(N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision] * (-y$46$re)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.12e+122], 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] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t_1\\
\mathbf{if}\;x.im \leq -6 \cdot 10^{+62}:\\
\;\;\;\;t_2 \cdot e^{\log \left(\frac{-1}{x.im}\right) \cdot \left(-y.re\right) - t_0}\\
\mathbf{elif}\;x.im \leq 1.12 \cdot 10^{+122}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot t_2\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(t_1 + y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -6e62Initial program 20.4%
hypot-def20.4%
fma-def20.4%
hypot-def77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in x.im around -inf 77.4%
mul-1-neg77.4%
*-commutative77.4%
distribute-rgt-neg-in77.4%
Simplified77.4%
Taylor expanded in y.im around 0 69.9%
if -6e62 < x.im < 1.12000000000000002e122Initial program 41.0%
Taylor expanded in y.im around 0 54.4%
if 1.12000000000000002e122 < x.im Initial program 6.9%
exp-diff6.9%
exp-to-pow6.9%
hypot-def6.9%
*-commutative6.9%
exp-prod6.9%
+-commutative6.9%
*-commutative6.9%
fma-def6.9%
+-commutative6.9%
Simplified71.9%
Taylor expanded in y.im around 0 58.7%
Taylor expanded in x.re around 0 56.8%
Final simplification57.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))))
(if (<= x.re 1.55e-230)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(sin (* y.re (atan2 x.im x.re))))
(*
(sin (* y.im (log (hypot x.im x.re))))
(exp (- (* y.re (log (+ x.re (* 0.5 (/ (* x.im x.im) x.re))))) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= 1.55e-230) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(((y_46_re * log((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))))) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= 1.55e-230) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp(((y_46_re * Math.log((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))))) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_re <= 1.55e-230: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp(((y_46_re * math.log((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))))) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_re <= 1.55e-230) 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))))) - t_0)) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(Float64(y_46_re * log(Float64(x_46_re + Float64(0.5 * Float64(Float64(x_46_im * x_46_im) / x_46_re))))) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_re <= 1.55e-230) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(((y_46_re * log((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))))) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, 1.55e-230], 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] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $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[Exp[N[(N[(y$46$re * N[Log[N[(x$46$re + N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq 1.55 \cdot 10^{-230}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log \left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\right) - t_0}\\
\end{array}
\end{array}
if x.re < 1.55e-230Initial program 32.2%
Taylor expanded in y.im around 0 55.7%
if 1.55e-230 < x.re Initial program 30.1%
Taylor expanded in x.re around inf 29.2%
unpow229.2%
Simplified29.2%
Taylor expanded in y.re around 0 27.3%
unpow228.2%
unpow228.2%
hypot-def53.7%
Simplified58.9%
Final simplification56.9%
(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
(*
t_1
(exp
(- (* (log (/ -1.0 x.im)) (- y.re)) (* y.im (atan2 x.im x.re))))))
(t_3 (* t_1 (pow (hypot x.im x.re) y.re))))
(if (<= x.im -8e-11)
t_2
(if (<= x.im -2.15e-221)
t_3
(if (<= x.im -2.2e-263)
t_2
(if (<= x.im 2e-178)
t_3
(*
(pow (hypot x.re x.im) y.re)
(sin (+ t_0 (* y.im (log x.im)))))))))))
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 = t_1 * exp(((log((-1.0 / x_46_im)) * -y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_3 = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (x_46_im <= -8e-11) {
tmp = t_2;
} else if (x_46_im <= -2.15e-221) {
tmp = t_3;
} else if (x_46_im <= -2.2e-263) {
tmp = t_2;
} else if (x_46_im <= 2e-178) {
tmp = t_3;
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((t_0 + (y_46_im * log(x_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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin(t_0);
double t_2 = t_1 * Math.exp(((Math.log((-1.0 / x_46_im)) * -y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double t_3 = t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (x_46_im <= -8e-11) {
tmp = t_2;
} else if (x_46_im <= -2.15e-221) {
tmp = t_3;
} else if (x_46_im <= -2.2e-263) {
tmp = t_2;
} else if (x_46_im <= 2e-178) {
tmp = t_3;
} else {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((t_0 + (y_46_im * Math.log(x_46_im))));
}
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 = t_1 * math.exp(((math.log((-1.0 / x_46_im)) * -y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) t_3 = t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if x_46_im <= -8e-11: tmp = t_2 elif x_46_im <= -2.15e-221: tmp = t_3 elif x_46_im <= -2.2e-263: tmp = t_2 elif x_46_im <= 2e-178: tmp = t_3 else: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((t_0 + (y_46_im * math.log(x_46_im)))) 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 = Float64(t_1 * exp(Float64(Float64(log(Float64(-1.0 / x_46_im)) * Float64(-y_46_re)) - Float64(y_46_im * atan(x_46_im, x_46_re))))) t_3 = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (x_46_im <= -8e-11) tmp = t_2; elseif (x_46_im <= -2.15e-221) tmp = t_3; elseif (x_46_im <= -2.2e-263) tmp = t_2; elseif (x_46_im <= 2e-178) tmp = t_3; else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(t_0 + Float64(y_46_im * log(x_46_im))))); 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 = t_1 * exp(((log((-1.0 / x_46_im)) * -y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); t_3 = t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re); tmp = 0.0; if (x_46_im <= -8e-11) tmp = t_2; elseif (x_46_im <= -2.15e-221) tmp = t_3; elseif (x_46_im <= -2.2e-263) tmp = t_2; elseif (x_46_im <= 2e-178) tmp = t_3; else tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((t_0 + (y_46_im * log(x_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[(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[(t$95$1 * N[Exp[N[(N[(N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision] * (-y$46$re)), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -8e-11], t$95$2, If[LessEqual[x$46$im, -2.15e-221], t$95$3, If[LessEqual[x$46$im, -2.2e-263], t$95$2, If[LessEqual[x$46$im, 2e-178], t$95$3, N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$0 + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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\\
t_2 := t_1 \cdot e^{\log \left(\frac{-1}{x.im}\right) \cdot \left(-y.re\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_3 := t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;x.im \leq -8 \cdot 10^{-11}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x.im \leq -2.15 \cdot 10^{-221}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x.im \leq -2.2 \cdot 10^{-263}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x.im \leq 2 \cdot 10^{-178}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(t_0 + y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -7.99999999999999952e-11 or -2.1499999999999999e-221 < x.im < -2.2e-263Initial program 29.6%
hypot-def29.6%
fma-def29.5%
hypot-def78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in x.im around -inf 78.8%
mul-1-neg78.8%
*-commutative78.8%
distribute-rgt-neg-in78.8%
Simplified78.8%
Taylor expanded in y.im around 0 70.5%
if -7.99999999999999952e-11 < x.im < -2.1499999999999999e-221 or -2.2e-263 < x.im < 1.9999999999999999e-178Initial program 35.3%
exp-diff33.1%
exp-to-pow33.1%
hypot-def33.1%
*-commutative33.1%
exp-prod32.7%
+-commutative32.7%
*-commutative32.7%
fma-def32.7%
+-commutative32.7%
Simplified69.3%
Taylor expanded in y.im around 0 63.0%
Taylor expanded in y.im around 0 46.9%
unpow246.9%
unpow246.9%
hypot-def48.1%
Simplified48.1%
if 1.9999999999999999e-178 < x.im Initial program 29.1%
exp-diff27.0%
exp-to-pow27.0%
hypot-def27.0%
*-commutative27.0%
exp-prod25.8%
+-commutative25.8%
*-commutative25.8%
fma-def26.8%
+-commutative26.8%
Simplified68.0%
Taylor expanded in y.im around 0 60.2%
Taylor expanded in x.re around 0 53.5%
Final simplification56.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ -1.0 x.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1))
(t_3 (* t_2 (exp (- (* t_0 (- y.re)) (* y.im (atan2 x.im x.re))))))
(t_4 (pow (hypot x.re x.im) y.re)))
(if (<= x.im -3.9e-11)
t_3
(if (<= x.im -1.7e-221)
(* t_4 (sin (- t_1 (* y.im t_0))))
(if (<= x.im -1.9e-264)
t_3
(if (<= x.im 7e-182)
(* t_2 (pow (hypot x.im x.re) y.re))
(* t_4 (sin (+ t_1 (* y.im (log x.im)))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log((-1.0 / x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = t_2 * exp(((t_0 * -y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_4 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (x_46_im <= -3.9e-11) {
tmp = t_3;
} else if (x_46_im <= -1.7e-221) {
tmp = t_4 * sin((t_1 - (y_46_im * t_0)));
} else if (x_46_im <= -1.9e-264) {
tmp = t_3;
} else if (x_46_im <= 7e-182) {
tmp = t_2 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_4 * sin((t_1 + (y_46_im * log(x_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.log((-1.0 / x_46_im));
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double t_3 = t_2 * Math.exp(((t_0 * -y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double t_4 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (x_46_im <= -3.9e-11) {
tmp = t_3;
} else if (x_46_im <= -1.7e-221) {
tmp = t_4 * Math.sin((t_1 - (y_46_im * t_0)));
} else if (x_46_im <= -1.9e-264) {
tmp = t_3;
} else if (x_46_im <= 7e-182) {
tmp = t_2 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_4 * Math.sin((t_1 + (y_46_im * Math.log(x_46_im))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log((-1.0 / x_46_im)) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) t_3 = t_2 * math.exp(((t_0 * -y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) t_4 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if x_46_im <= -3.9e-11: tmp = t_3 elif x_46_im <= -1.7e-221: tmp = t_4 * math.sin((t_1 - (y_46_im * t_0))) elif x_46_im <= -1.9e-264: tmp = t_3 elif x_46_im <= 7e-182: tmp = t_2 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_4 * math.sin((t_1 + (y_46_im * math.log(x_46_im)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(Float64(-1.0 / x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = Float64(t_2 * exp(Float64(Float64(t_0 * Float64(-y_46_re)) - Float64(y_46_im * atan(x_46_im, x_46_re))))) t_4 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (x_46_im <= -3.9e-11) tmp = t_3; elseif (x_46_im <= -1.7e-221) tmp = Float64(t_4 * sin(Float64(t_1 - Float64(y_46_im * t_0)))); elseif (x_46_im <= -1.9e-264) tmp = t_3; elseif (x_46_im <= 7e-182) tmp = Float64(t_2 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_4 * sin(Float64(t_1 + Float64(y_46_im * log(x_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log((-1.0 / x_46_im)); t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); t_3 = t_2 * exp(((t_0 * -y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); t_4 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if (x_46_im <= -3.9e-11) tmp = t_3; elseif (x_46_im <= -1.7e-221) tmp = t_4 * sin((t_1 - (y_46_im * t_0))); elseif (x_46_im <= -1.9e-264) tmp = t_3; elseif (x_46_im <= 7e-182) tmp = t_2 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_4 * sin((t_1 + (y_46_im * log(x_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[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Exp[N[(N[(t$95$0 * (-y$46$re)), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[x$46$im, -3.9e-11], t$95$3, If[LessEqual[x$46$im, -1.7e-221], N[(t$95$4 * N[Sin[N[(t$95$1 - N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -1.9e-264], t$95$3, If[LessEqual[x$46$im, 7e-182], N[(t$95$2 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.im}\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t_1\\
t_3 := t_2 \cdot e^{t_0 \cdot \left(-y.re\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_4 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;x.im \leq -3.9 \cdot 10^{-11}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x.im \leq -1.7 \cdot 10^{-221}:\\
\;\;\;\;t_4 \cdot \sin \left(t_1 - y.im \cdot t_0\right)\\
\mathbf{elif}\;x.im \leq -1.9 \cdot 10^{-264}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x.im \leq 7 \cdot 10^{-182}:\\
\;\;\;\;t_2 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot \sin \left(t_1 + y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -3.9000000000000001e-11 or -1.7000000000000001e-221 < x.im < -1.90000000000000007e-264Initial program 29.6%
hypot-def29.6%
fma-def29.5%
hypot-def78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in x.im around -inf 78.8%
mul-1-neg78.8%
*-commutative78.8%
distribute-rgt-neg-in78.8%
Simplified78.8%
Taylor expanded in y.im around 0 70.5%
if -3.9000000000000001e-11 < x.im < -1.7000000000000001e-221Initial program 38.1%
exp-diff33.3%
exp-to-pow33.3%
hypot-def33.3%
*-commutative33.3%
exp-prod33.3%
+-commutative33.3%
*-commutative33.3%
fma-def33.3%
+-commutative33.3%
Simplified64.2%
Taylor expanded in y.im around 0 60.5%
Taylor expanded in x.im around -inf 47.8%
+-commutative47.8%
mul-1-neg47.8%
unsub-neg47.8%
Simplified47.8%
if -1.90000000000000007e-264 < x.im < 6.99999999999999966e-182Initial program 32.9%
exp-diff32.9%
exp-to-pow32.9%
hypot-def32.9%
*-commutative32.9%
exp-prod32.2%
+-commutative32.2%
*-commutative32.2%
fma-def32.2%
+-commutative32.2%
Simplified73.9%
Taylor expanded in y.im around 0 65.2%
Taylor expanded in y.im around 0 49.3%
unpow249.3%
unpow249.3%
hypot-def51.5%
Simplified51.5%
if 6.99999999999999966e-182 < x.im Initial program 29.1%
exp-diff27.0%
exp-to-pow27.0%
hypot-def27.0%
*-commutative27.0%
exp-prod25.8%
+-commutative25.8%
*-commutative25.8%
fma-def26.8%
+-commutative26.8%
Simplified68.0%
Taylor expanded in y.im around 0 60.2%
Taylor expanded in x.re around 0 53.5%
Final simplification56.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.15e-145) (not (<= y.re 1.15e-97))) (* (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))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.15e-145) || !(y_46_re <= 1.15e-97)) {
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))));
}
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 <= -1.15e-145) || !(y_46_re <= 1.15e-97)) {
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))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.15e-145) or not (y_46_re <= 1.15e-97): 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)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.15e-145) || !(y_46_re <= 1.15e-97)) 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 = sin(Float64(y_46_im * log(hypot(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 <= -1.15e-145) || ~((y_46_re <= 1.15e-97))) 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)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.15e-145], N[Not[LessEqual[y$46$re, 1.15e-97]], $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[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.15 \cdot 10^{-145} \lor \neg \left(y.re \leq 1.15 \cdot 10^{-97}\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}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -1.15000000000000004e-145 or 1.14999999999999997e-97 < y.re Initial program 29.4%
exp-diff26.2%
exp-to-pow26.2%
hypot-def26.2%
*-commutative26.2%
exp-prod25.3%
+-commutative25.3%
*-commutative25.3%
fma-def25.9%
+-commutative25.9%
Simplified62.2%
Taylor expanded in y.im around 0 61.3%
Taylor expanded in y.im around 0 53.6%
unpow253.6%
unpow253.6%
hypot-def57.3%
Simplified57.3%
if -1.15000000000000004e-145 < y.re < 1.14999999999999997e-97Initial program 36.5%
exp-diff36.5%
exp-to-pow36.5%
hypot-def36.5%
*-commutative36.5%
exp-prod36.4%
+-commutative36.4%
*-commutative36.4%
fma-def36.4%
+-commutative36.4%
Simplified82.8%
Taylor expanded in y.im around 0 50.6%
Taylor expanded in y.re around 0 17.9%
unpow217.9%
unpow217.9%
hypot-def41.2%
Simplified41.2%
Final simplification52.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (sin (* y.im (log (hypot x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
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_im * Math.log(Math.hypot(x_46_im, x_46_re))));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re))))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)
\end{array}
Initial program 31.4%
exp-diff29.0%
exp-to-pow29.0%
hypot-def29.0%
*-commutative29.0%
exp-prod28.4%
+-commutative28.4%
*-commutative28.4%
fma-def28.8%
+-commutative28.8%
Simplified67.9%
Taylor expanded in y.im around 0 58.3%
Taylor expanded in y.re around 0 7.3%
unpow27.3%
unpow27.3%
hypot-def16.7%
Simplified16.7%
Final simplification16.7%
herbie shell --seed 2023275
(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)))))