
(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 (+ (* x.re x.re) (* x.im x.im))) (t_1 (* y.re (atan2 x.im x.re))))
(if (<= y.re -7.5e+54)
(fabs (* (sin t_1) (pow t_0 (/ y.re 2.0))))
(if (<= y.re 48000000000.0)
(*
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))
(sin (fma (log (hypot x.re x.im)) y.im t_1)))
(*
(exp (- (* y.re (log (sqrt t_0))) (* (atan2 x.im x.re) y.im)))
(* y.im (* 0.5 (log t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re * x_46_re) + (x_46_im * x_46_im);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -7.5e+54) {
tmp = fabs((sin(t_1) * pow(t_0, (y_46_re / 2.0))));
} else if (y_46_re <= 48000000000.0) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re))) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1));
} else {
tmp = exp(((y_46_re * log(sqrt(t_0))) - (atan2(x_46_im, x_46_re) * y_46_im))) * (y_46_im * (0.5 * log(t_0)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -7.5e+54) tmp = abs(Float64(sin(t_1) * (t_0 ^ Float64(y_46_re / 2.0)))); elseif (y_46_re <= 48000000000.0) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(t_0))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * Float64(y_46_im * Float64(0.5 * log(t_0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.5e+54], N[Abs[N[(N[Sin[t$95$1], $MachinePrecision] * N[Power[t$95$0, N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 48000000000.0], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(y$46$im * N[(0.5 * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot x.re + x.im \cdot x.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -7.5 \cdot 10^{+54}:\\
\;\;\;\;\left|\sin t\_1 \cdot {t\_0}^{\left(\frac{y.re}{2}\right)}\right|\\
\mathbf{elif}\;y.re \leq 48000000000:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{t\_0}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(y.im \cdot \left(0.5 \cdot \log t\_0\right)\right)\\
\end{array}
\end{array}
if y.re < -7.50000000000000042e54Initial program 46.7%
exp-diff35.6%
exp-to-pow35.6%
hypot-define35.6%
*-commutative35.6%
exp-prod28.9%
fma-define28.9%
hypot-define66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in y.im around 0 82.4%
unpow282.4%
unpow282.4%
hypot-undefine82.4%
Simplified82.4%
Taylor expanded in y.im around 0 82.4%
add-sqr-sqrt80.2%
sqrt-unprod86.8%
pow286.8%
*-commutative86.8%
*-commutative86.8%
hypot-undefine86.8%
+-commutative86.8%
sqrt-pow286.8%
Applied egg-rr86.8%
unpow286.8%
rem-sqrt-square86.8%
*-commutative86.8%
Simplified86.8%
if -7.50000000000000042e54 < y.re < 4.8e10Initial program 39.2%
exp-diff39.2%
exp-to-pow39.2%
hypot-define39.2%
*-commutative39.2%
exp-prod39.0%
fma-define39.0%
hypot-define80.5%
*-commutative80.5%
Simplified80.5%
if 4.8e10 < y.re Initial program 29.0%
Taylor expanded in y.re around 0 32.3%
+-commutative32.3%
unpow232.3%
unpow232.3%
unpow1/232.3%
exp-to-pow32.3%
*-commutative32.3%
rem-log-exp32.3%
associate-*r*32.3%
Simplified32.3%
Taylor expanded in y.im around 0 67.8%
*-commutative67.8%
+-commutative67.8%
unpow267.8%
unpow267.8%
associate-*l*67.8%
*-commutative67.8%
Simplified67.8%
Final simplification78.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re x.re) (* x.im x.im)))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (sin t_2)))
(if (<= y.re -1.52e+22)
(fabs (* t_3 (pow t_0 (/ y.re 2.0))))
(if (<= y.re 1.7e-57)
(* (sin (fma (log (hypot x.re x.im)) y.im t_2)) (/ 1.0 (exp t_1)))
(if (<= y.re 2.8e+28)
(*
t_3
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.re 3.8e+56)
(* t_3 (pow x.re y.re))
(*
(exp (- (* y.re (log (sqrt t_0))) t_1))
(* y.im (* 0.5 (log t_0))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re * x_46_re) + (x_46_im * x_46_im);
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = sin(t_2);
double tmp;
if (y_46_re <= -1.52e+22) {
tmp = fabs((t_3 * pow(t_0, (y_46_re / 2.0))));
} else if (y_46_re <= 1.7e-57) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) * (1.0 / exp(t_1));
} else if (y_46_re <= 2.8e+28) {
tmp = t_3 * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 3.8e+56) {
tmp = t_3 * pow(x_46_re, y_46_re);
} else {
tmp = exp(((y_46_re * log(sqrt(t_0))) - t_1)) * (y_46_im * (0.5 * log(t_0)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = sin(t_2) tmp = 0.0 if (y_46_re <= -1.52e+22) tmp = abs(Float64(t_3 * (t_0 ^ Float64(y_46_re / 2.0)))); elseif (y_46_re <= 1.7e-57) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) * Float64(1.0 / exp(t_1))); elseif (y_46_re <= 2.8e+28) tmp = Float64(t_3 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); elseif (y_46_re <= 3.8e+56) tmp = Float64(t_3 * (x_46_re ^ y_46_re)); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(t_0))) - t_1)) * Float64(y_46_im * Float64(0.5 * log(t_0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$2], $MachinePrecision]}, If[LessEqual[y$46$re, -1.52e+22], N[Abs[N[(t$95$3 * N[Power[t$95$0, N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 1.7e-57], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.8e+28], N[(t$95$3 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.8e+56], N[(t$95$3 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[(y$46$im * N[(0.5 * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot x.re + x.im \cdot x.im\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \sin t\_2\\
\mathbf{if}\;y.re \leq -1.52 \cdot 10^{+22}:\\
\;\;\;\;\left|t\_3 \cdot {t\_0}^{\left(\frac{y.re}{2}\right)}\right|\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{-57}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_2\right)\right) \cdot \frac{1}{e^{t\_1}}\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{+28}:\\
\;\;\;\;t\_3 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.re \leq 3.8 \cdot 10^{+56}:\\
\;\;\;\;t\_3 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{t\_0}\right) - t\_1} \cdot \left(y.im \cdot \left(0.5 \cdot \log t\_0\right)\right)\\
\end{array}
\end{array}
if y.re < -1.52e22Initial program 47.1%
exp-diff37.3%
exp-to-pow37.3%
hypot-define37.3%
*-commutative37.3%
exp-prod31.4%
fma-define31.4%
hypot-define68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in y.im around 0 82.5%
unpow282.5%
unpow282.5%
hypot-undefine82.5%
Simplified82.5%
Taylor expanded in y.im around 0 82.5%
add-sqr-sqrt78.6%
sqrt-unprod84.5%
pow284.5%
*-commutative84.5%
*-commutative84.5%
hypot-undefine84.5%
+-commutative84.5%
sqrt-pow284.5%
Applied egg-rr84.5%
unpow284.5%
rem-sqrt-square84.5%
*-commutative84.5%
Simplified84.5%
if -1.52e22 < y.re < 1.70000000000000008e-57Initial program 37.9%
exp-diff37.9%
exp-to-pow37.9%
hypot-define37.9%
*-commutative37.9%
exp-prod37.7%
fma-define37.7%
hypot-define79.0%
*-commutative79.0%
Simplified79.0%
frac-2neg79.0%
distribute-frac-neg79.0%
hypot-define50.0%
sqrt-pow250.0%
div-inv50.0%
metadata-eval50.0%
neg-sub052.2%
pow-exp52.4%
Applied egg-rr52.4%
Taylor expanded in y.re around 0 81.9%
if 1.70000000000000008e-57 < y.re < 2.8000000000000001e28Initial program 42.9%
exp-diff35.7%
exp-to-pow35.7%
hypot-define35.7%
*-commutative35.7%
exp-prod35.7%
fma-define35.7%
hypot-define85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in y.im around 0 85.5%
if 2.8000000000000001e28 < y.re < 3.79999999999999996e56Initial program 16.7%
exp-diff16.7%
exp-to-pow16.7%
hypot-define16.7%
*-commutative16.7%
exp-prod16.7%
fma-define16.7%
hypot-define50.0%
*-commutative50.0%
Simplified50.0%
Taylor expanded in y.im around 0 50.8%
unpow250.8%
unpow250.8%
hypot-undefine50.8%
Simplified50.8%
Taylor expanded in y.im around 0 50.8%
Taylor expanded in x.im around 0 67.2%
if 3.79999999999999996e56 < y.re Initial program 30.8%
Taylor expanded in y.re around 0 34.6%
+-commutative34.6%
unpow234.6%
unpow234.6%
unpow1/234.6%
exp-to-pow34.6%
*-commutative34.6%
rem-log-exp34.6%
associate-*r*34.6%
Simplified34.6%
Taylor expanded in y.im around 0 71.2%
*-commutative71.2%
+-commutative71.2%
unpow271.2%
unpow271.2%
associate-*l*71.2%
*-commutative71.2%
Simplified71.2%
Final simplification77.8%
(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)
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(t_2 (pow (hypot x.im x.re) y.re)))
(if (<= y.im -1.7e+16)
t_1
(if (<= y.im -4e-27)
(* t_2 (sin (* y.im (log (hypot x.im x.re)))))
(if (<= y.im 180000000000.0)
(* (sin (fma (log (hypot x.re x.im)) y.im t_0)) t_2)
t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(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_2 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -1.7e+16) {
tmp = t_1;
} else if (y_46_im <= -4e-27) {
tmp = t_2 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_im <= 180000000000.0) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(sin(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_2 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_im <= -1.7e+16) tmp = t_1; elseif (y_46_im <= -4e-27) tmp = Float64(t_2 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (y_46_im <= 180000000000.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * t_2); else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[t$95$0], $MachinePrecision] * 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]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$im, -1.7e+16], t$95$1, If[LessEqual[y$46$im, -4e-27], N[(t$95$2 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 180000000000.0], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t\_0 \cdot 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_2 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -1.7 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -4 \cdot 10^{-27}:\\
\;\;\;\;t\_2 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.im \leq 180000000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.7e16 or 1.8e11 < y.im Initial program 33.1%
Taylor expanded in y.im around 0 56.4%
if -1.7e16 < y.im < -4.0000000000000002e-27Initial program 30.0%
exp-diff30.0%
exp-to-pow30.0%
hypot-define30.0%
*-commutative30.0%
exp-prod30.0%
fma-define30.0%
hypot-define50.0%
*-commutative50.0%
Simplified50.0%
Taylor expanded in y.im around 0 39.7%
unpow239.7%
unpow239.7%
hypot-undefine49.3%
Simplified49.3%
Taylor expanded in y.re around 0 59.3%
unpow259.3%
unpow259.3%
hypot-define99.3%
Simplified99.3%
if -4.0000000000000002e-27 < y.im < 1.8e11Initial program 43.0%
exp-diff43.0%
exp-to-pow43.0%
hypot-define43.0%
*-commutative43.0%
exp-prod43.0%
fma-define43.0%
hypot-define91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in y.im around 0 63.7%
unpow263.7%
unpow263.7%
hypot-undefine91.6%
Simplified91.6%
Final simplification76.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re x.re) (* x.im x.im)))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2 (* y.re (atan2 x.im x.re))))
(if (<= y.re -0.88)
(fabs (* (sin t_2) (pow t_0 (/ y.re 2.0))))
(if (<= y.re 1.2e+31)
(* (sin (fma (log (hypot x.re x.im)) y.im t_2)) (/ 1.0 (exp t_1)))
(*
(exp (- (* y.re (log (sqrt t_0))) t_1))
(* y.im (* 0.5 (log t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re * x_46_re) + (x_46_im * x_46_im);
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -0.88) {
tmp = fabs((sin(t_2) * pow(t_0, (y_46_re / 2.0))));
} else if (y_46_re <= 1.2e+31) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) * (1.0 / exp(t_1));
} else {
tmp = exp(((y_46_re * log(sqrt(t_0))) - t_1)) * (y_46_im * (0.5 * log(t_0)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -0.88) tmp = abs(Float64(sin(t_2) * (t_0 ^ Float64(y_46_re / 2.0)))); elseif (y_46_re <= 1.2e+31) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) * Float64(1.0 / exp(t_1))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(t_0))) - t_1)) * Float64(y_46_im * Float64(0.5 * log(t_0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.88], N[Abs[N[(N[Sin[t$95$2], $MachinePrecision] * N[Power[t$95$0, N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 1.2e+31], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[(y$46$im * N[(0.5 * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot x.re + x.im \cdot x.im\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -0.88:\\
\;\;\;\;\left|\sin t\_2 \cdot {t\_0}^{\left(\frac{y.re}{2}\right)}\right|\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{+31}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_2\right)\right) \cdot \frac{1}{e^{t\_1}}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{t\_0}\right) - t\_1} \cdot \left(y.im \cdot \left(0.5 \cdot \log t\_0\right)\right)\\
\end{array}
\end{array}
if y.re < -0.880000000000000004Initial program 44.6%
exp-diff35.7%
exp-to-pow35.7%
hypot-define35.7%
*-commutative35.7%
exp-prod30.4%
fma-define30.4%
hypot-define67.9%
*-commutative67.9%
Simplified67.9%
Taylor expanded in y.im around 0 80.6%
unpow280.6%
unpow280.6%
hypot-undefine80.6%
Simplified80.6%
Taylor expanded in y.im around 0 80.6%
add-sqr-sqrt77.0%
sqrt-unprod82.4%
pow282.4%
*-commutative82.4%
*-commutative82.4%
hypot-undefine82.4%
+-commutative82.4%
sqrt-pow282.4%
Applied egg-rr82.4%
unpow282.4%
rem-sqrt-square82.4%
*-commutative82.4%
Simplified82.4%
if -0.880000000000000004 < y.re < 1.19999999999999991e31Initial program 38.7%
exp-diff38.0%
exp-to-pow38.0%
hypot-define38.0%
*-commutative38.0%
exp-prod37.9%
fma-define37.9%
hypot-define79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in y.re around 0 79.6%
if 1.19999999999999991e31 < y.re Initial program 29.8%
Taylor expanded in y.re around 0 33.3%
+-commutative33.3%
unpow233.3%
unpow233.3%
unpow1/233.3%
exp-to-pow33.3%
*-commutative33.3%
rem-log-exp33.3%
associate-*r*33.3%
Simplified33.3%
Taylor expanded in y.im around 0 70.2%
*-commutative70.2%
+-commutative70.2%
unpow270.2%
unpow270.2%
associate-*l*70.2%
*-commutative70.2%
Simplified70.2%
Final simplification78.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
(t_1
(*
t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(t_2 (pow (hypot x.im x.re) y.re))
(t_3 (* t_2 (sin (* y.im (log (hypot x.im x.re)))))))
(if (<= y.im -1.7e+16)
t_1
(if (<= y.im -5.2e-204)
t_3
(if (<= y.im 3.6e-297)
(* t_0 t_2)
(if (<= y.im 27500000000000.0) t_3 t_1))))))
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 t_1 = 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_2 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_3 = t_2 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.7e+16) {
tmp = t_1;
} else if (y_46_im <= -5.2e-204) {
tmp = t_3;
} else if (y_46_im <= 3.6e-297) {
tmp = t_0 * t_2;
} else if (y_46_im <= 27500000000000.0) {
tmp = t_3;
} else {
tmp = t_1;
}
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 t_1 = t_0 * 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)));
double t_2 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_3 = t_2 * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.7e+16) {
tmp = t_1;
} else if (y_46_im <= -5.2e-204) {
tmp = t_3;
} else if (y_46_im <= 3.6e-297) {
tmp = t_0 * t_2;
} else if (y_46_im <= 27500000000000.0) {
tmp = t_3;
} else {
tmp = t_1;
}
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))) t_1 = t_0 * 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_2 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_3 = t_2 * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_im <= -1.7e+16: tmp = t_1 elif y_46_im <= -5.2e-204: tmp = t_3 elif y_46_im <= 3.6e-297: tmp = t_0 * t_2 elif y_46_im <= 27500000000000.0: tmp = t_3 else: tmp = t_1 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))) t_1 = Float64(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_2 = hypot(x_46_im, x_46_re) ^ y_46_re t_3 = Float64(t_2 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_im <= -1.7e+16) tmp = t_1; elseif (y_46_im <= -5.2e-204) tmp = t_3; elseif (y_46_im <= 3.6e-297) tmp = Float64(t_0 * t_2); elseif (y_46_im <= 27500000000000.0) tmp = t_3; else tmp = t_1; 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))); t_1 = 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))); t_2 = hypot(x_46_im, x_46_re) ^ y_46_re; t_3 = t_2 * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_im <= -1.7e+16) tmp = t_1; elseif (y_46_im <= -5.2e-204) tmp = t_3; elseif (y_46_im <= 3.6e-297) tmp = t_0 * t_2; elseif (y_46_im <= 27500000000000.0) tmp = t_3; else tmp = t_1; 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]}, Block[{t$95$1 = N[(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]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.7e+16], t$95$1, If[LessEqual[y$46$im, -5.2e-204], t$95$3, If[LessEqual[y$46$im, 3.6e-297], N[(t$95$0 * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 27500000000000.0], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := t\_0 \cdot 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_2 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_3 := t\_2 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.im \leq -1.7 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -5.2 \cdot 10^{-204}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.im \leq 3.6 \cdot 10^{-297}:\\
\;\;\;\;t\_0 \cdot t\_2\\
\mathbf{elif}\;y.im \leq 27500000000000:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.7e16 or 2.75e13 < y.im Initial program 33.1%
Taylor expanded in y.im around 0 56.4%
if -1.7e16 < y.im < -5.19999999999999965e-204 or 3.59999999999999994e-297 < y.im < 2.75e13Initial program 40.3%
exp-diff40.3%
exp-to-pow40.3%
hypot-define40.3%
*-commutative40.3%
exp-prod40.3%
fma-define40.3%
hypot-define86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in y.im around 0 58.5%
unpow258.5%
unpow258.5%
hypot-undefine86.9%
Simplified86.9%
Taylor expanded in y.re around 0 37.1%
unpow237.1%
unpow237.1%
hypot-define80.6%
Simplified80.6%
if -5.19999999999999965e-204 < y.im < 3.59999999999999994e-297Initial program 49.9%
exp-diff49.9%
exp-to-pow49.9%
hypot-define49.9%
*-commutative49.9%
exp-prod49.9%
fma-define50.0%
hypot-define96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in y.im around 0 77.7%
unpow277.7%
unpow277.7%
hypot-undefine96.0%
Simplified96.0%
Taylor expanded in y.im around 0 86.5%
Final simplification70.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re x.re) (* x.im x.im)))
(t_1 (sin (* y.re (atan2 x.im x.re))))
(t_2 (pow (hypot x.im x.re) y.re))
(t_3 (* t_2 (sin (* y.im (log (hypot x.im x.re)))))))
(if (<= y.im -1.7e+16)
(+ (+ (* t_1 (pow t_0 (/ y.re 2.0))) 1.0) -1.0)
(if (<= y.im -3.7e-204)
t_3
(if (<= y.im 9.5e-297)
(* t_1 t_2)
(if (<= y.im 1e+17)
t_3
(*
t_1
(/ (pow t_0 (* y.re 0.5)) (exp (* (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 = (x_46_re * x_46_re) + (x_46_im * x_46_im);
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_3 = t_2 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.7e+16) {
tmp = ((t_1 * pow(t_0, (y_46_re / 2.0))) + 1.0) + -1.0;
} else if (y_46_im <= -3.7e-204) {
tmp = t_3;
} else if (y_46_im <= 9.5e-297) {
tmp = t_1 * t_2;
} else if (y_46_im <= 1e+17) {
tmp = t_3;
} else {
tmp = t_1 * (pow(t_0, (y_46_re * 0.5)) / exp((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 = (x_46_re * x_46_re) + (x_46_im * x_46_im);
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_3 = t_2 * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.7e+16) {
tmp = ((t_1 * Math.pow(t_0, (y_46_re / 2.0))) + 1.0) + -1.0;
} else if (y_46_im <= -3.7e-204) {
tmp = t_3;
} else if (y_46_im <= 9.5e-297) {
tmp = t_1 * t_2;
} else if (y_46_im <= 1e+17) {
tmp = t_3;
} else {
tmp = t_1 * (Math.pow(t_0, (y_46_re * 0.5)) / Math.exp((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 = (x_46_re * x_46_re) + (x_46_im * x_46_im) t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_2 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_3 = t_2 * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_im <= -1.7e+16: tmp = ((t_1 * math.pow(t_0, (y_46_re / 2.0))) + 1.0) + -1.0 elif y_46_im <= -3.7e-204: tmp = t_3 elif y_46_im <= 9.5e-297: tmp = t_1 * t_2 elif y_46_im <= 1e+17: tmp = t_3 else: tmp = t_1 * (math.pow(t_0, (y_46_re * 0.5)) / math.exp((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 = Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = hypot(x_46_im, x_46_re) ^ y_46_re t_3 = Float64(t_2 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_im <= -1.7e+16) tmp = Float64(Float64(Float64(t_1 * (t_0 ^ Float64(y_46_re / 2.0))) + 1.0) + -1.0); elseif (y_46_im <= -3.7e-204) tmp = t_3; elseif (y_46_im <= 9.5e-297) tmp = Float64(t_1 * t_2); elseif (y_46_im <= 1e+17) tmp = t_3; else tmp = Float64(t_1 * Float64((t_0 ^ Float64(y_46_re * 0.5)) / exp(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 = (x_46_re * x_46_re) + (x_46_im * x_46_im); t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); t_2 = hypot(x_46_im, x_46_re) ^ y_46_re; t_3 = t_2 * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_im <= -1.7e+16) tmp = ((t_1 * (t_0 ^ (y_46_re / 2.0))) + 1.0) + -1.0; elseif (y_46_im <= -3.7e-204) tmp = t_3; elseif (y_46_im <= 9.5e-297) tmp = t_1 * t_2; elseif (y_46_im <= 1e+17) tmp = t_3; else tmp = t_1 * ((t_0 ^ (y_46_re * 0.5)) / exp((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[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.7e+16], N[(N[(N[(t$95$1 * N[Power[t$95$0, N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[y$46$im, -3.7e-204], t$95$3, If[LessEqual[y$46$im, 9.5e-297], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 1e+17], t$95$3, N[(t$95$1 * N[(N[Power[t$95$0, N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] / N[Exp[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 := x.re \cdot x.re + x.im \cdot x.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_3 := t\_2 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.im \leq -1.7 \cdot 10^{+16}:\\
\;\;\;\;\left(t\_1 \cdot {t\_0}^{\left(\frac{y.re}{2}\right)} + 1\right) + -1\\
\mathbf{elif}\;y.im \leq -3.7 \cdot 10^{-204}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.im \leq 9.5 \cdot 10^{-297}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;y.im \leq 10^{+17}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{{t\_0}^{\left(y.re \cdot 0.5\right)}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\end{array}
\end{array}
if y.im < -1.7e16Initial program 39.0%
exp-diff32.2%
exp-to-pow32.2%
hypot-define32.2%
*-commutative32.2%
exp-prod27.1%
fma-define27.1%
hypot-define52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in y.im around 0 43.3%
unpow243.3%
unpow243.3%
hypot-undefine33.5%
Simplified33.5%
Taylor expanded in y.im around 0 37.1%
expm1-log1p-u32.0%
expm1-undefine46.5%
*-commutative46.5%
*-commutative46.5%
hypot-undefine49.7%
+-commutative49.7%
sqrt-pow249.7%
Applied egg-rr49.7%
sub-neg49.7%
log1p-undefine49.7%
rem-exp-log54.8%
*-commutative54.8%
metadata-eval54.8%
Simplified54.8%
if -1.7e16 < y.im < -3.6999999999999997e-204 or 9.5000000000000005e-297 < y.im < 1e17Initial program 40.3%
exp-diff40.3%
exp-to-pow40.3%
hypot-define40.3%
*-commutative40.3%
exp-prod40.3%
fma-define40.3%
hypot-define86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in y.im around 0 58.5%
unpow258.5%
unpow258.5%
hypot-undefine86.9%
Simplified86.9%
Taylor expanded in y.re around 0 37.1%
unpow237.1%
unpow237.1%
hypot-define80.6%
Simplified80.6%
if -3.6999999999999997e-204 < y.im < 9.5000000000000005e-297Initial program 49.9%
exp-diff49.9%
exp-to-pow49.9%
hypot-define49.9%
*-commutative49.9%
exp-prod49.9%
fma-define50.0%
hypot-define96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in y.im around 0 77.7%
unpow277.7%
unpow277.7%
hypot-undefine96.0%
Simplified96.0%
Taylor expanded in y.im around 0 86.5%
if 1e17 < y.im Initial program 27.0%
exp-diff21.8%
exp-to-pow21.8%
hypot-define21.8%
*-commutative21.8%
exp-prod21.4%
fma-define21.4%
hypot-define48.5%
*-commutative48.5%
Simplified48.5%
frac-2neg48.5%
distribute-frac-neg48.5%
hypot-define44.5%
sqrt-pow244.5%
div-inv44.5%
metadata-eval44.5%
neg-sub044.5%
pow-exp46.5%
Applied egg-rr46.5%
Taylor expanded in y.im around 0 44.2%
Final simplification66.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
(t_1
(+
(+ (* t_0 (pow (+ (* x.re x.re) (* x.im x.im)) (/ y.re 2.0))) 1.0)
-1.0))
(t_2 (pow (hypot x.im x.re) y.re))
(t_3 (* t_2 (sin (* y.im (log (hypot x.im x.re)))))))
(if (<= y.im -1.7e+16)
t_1
(if (<= y.im -1.3e-203)
t_3
(if (<= y.im 9e-297)
(* t_0 t_2)
(if (<= y.im 1750000000000.0) t_3 t_1))))))
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 t_1 = ((t_0 * pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0))) + 1.0) + -1.0;
double t_2 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_3 = t_2 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.7e+16) {
tmp = t_1;
} else if (y_46_im <= -1.3e-203) {
tmp = t_3;
} else if (y_46_im <= 9e-297) {
tmp = t_0 * t_2;
} else if (y_46_im <= 1750000000000.0) {
tmp = t_3;
} else {
tmp = t_1;
}
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 t_1 = ((t_0 * Math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0))) + 1.0) + -1.0;
double t_2 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_3 = t_2 * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.7e+16) {
tmp = t_1;
} else if (y_46_im <= -1.3e-203) {
tmp = t_3;
} else if (y_46_im <= 9e-297) {
tmp = t_0 * t_2;
} else if (y_46_im <= 1750000000000.0) {
tmp = t_3;
} else {
tmp = t_1;
}
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))) t_1 = ((t_0 * math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0))) + 1.0) + -1.0 t_2 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_3 = t_2 * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_im <= -1.7e+16: tmp = t_1 elif y_46_im <= -1.3e-203: tmp = t_3 elif y_46_im <= 9e-297: tmp = t_0 * t_2 elif y_46_im <= 1750000000000.0: tmp = t_3 else: tmp = t_1 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))) t_1 = Float64(Float64(Float64(t_0 * (Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) ^ Float64(y_46_re / 2.0))) + 1.0) + -1.0) t_2 = hypot(x_46_im, x_46_re) ^ y_46_re t_3 = Float64(t_2 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_im <= -1.7e+16) tmp = t_1; elseif (y_46_im <= -1.3e-203) tmp = t_3; elseif (y_46_im <= 9e-297) tmp = Float64(t_0 * t_2); elseif (y_46_im <= 1750000000000.0) tmp = t_3; else tmp = t_1; 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))); t_1 = ((t_0 * (((x_46_re * x_46_re) + (x_46_im * x_46_im)) ^ (y_46_re / 2.0))) + 1.0) + -1.0; t_2 = hypot(x_46_im, x_46_re) ^ y_46_re; t_3 = t_2 * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_im <= -1.7e+16) tmp = t_1; elseif (y_46_im <= -1.3e-203) tmp = t_3; elseif (y_46_im <= 9e-297) tmp = t_0 * t_2; elseif (y_46_im <= 1750000000000.0) tmp = t_3; else tmp = t_1; 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]}, Block[{t$95$1 = N[(N[(N[(t$95$0 * N[Power[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] + -1.0), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.7e+16], t$95$1, If[LessEqual[y$46$im, -1.3e-203], t$95$3, If[LessEqual[y$46$im, 9e-297], N[(t$95$0 * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 1750000000000.0], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := \left(t\_0 \cdot {\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)} + 1\right) + -1\\
t_2 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_3 := t\_2 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.im \leq -1.7 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -1.3 \cdot 10^{-203}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.im \leq 9 \cdot 10^{-297}:\\
\;\;\;\;t\_0 \cdot t\_2\\
\mathbf{elif}\;y.im \leq 1750000000000:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.7e16 or 1.75e12 < y.im Initial program 33.1%
exp-diff27.1%
exp-to-pow27.1%
hypot-define27.1%
*-commutative27.1%
exp-prod24.3%
fma-define24.3%
hypot-define50.5%
*-commutative50.5%
Simplified50.5%
Taylor expanded in y.im around 0 37.6%
unpow237.6%
unpow237.6%
hypot-undefine27.0%
Simplified27.0%
Taylor expanded in y.im around 0 27.6%
expm1-log1p-u25.0%
expm1-undefine41.4%
*-commutative41.4%
*-commutative41.4%
hypot-undefine42.1%
+-commutative42.1%
sqrt-pow242.1%
Applied egg-rr42.1%
sub-neg42.1%
log1p-undefine42.1%
rem-exp-log49.0%
*-commutative49.0%
metadata-eval49.0%
Simplified49.0%
if -1.7e16 < y.im < -1.29999999999999988e-203 or 8.99999999999999951e-297 < y.im < 1.75e12Initial program 40.3%
exp-diff40.3%
exp-to-pow40.3%
hypot-define40.3%
*-commutative40.3%
exp-prod40.3%
fma-define40.3%
hypot-define86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in y.im around 0 58.5%
unpow258.5%
unpow258.5%
hypot-undefine86.9%
Simplified86.9%
Taylor expanded in y.re around 0 37.1%
unpow237.1%
unpow237.1%
hypot-define80.6%
Simplified80.6%
if -1.29999999999999988e-203 < y.im < 8.99999999999999951e-297Initial program 49.9%
exp-diff49.9%
exp-to-pow49.9%
hypot-define49.9%
*-commutative49.9%
exp-prod49.9%
fma-define50.0%
hypot-define96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in y.im around 0 77.7%
unpow277.7%
unpow277.7%
hypot-undefine96.0%
Simplified96.0%
Taylor expanded in y.im around 0 86.5%
Final simplification66.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re x.re) (* x.im x.im)))
(t_1 (sin (* y.re (atan2 x.im x.re))))
(t_2 (+ (+ (* t_1 (pow t_0 (/ y.re 2.0))) 1.0) -1.0)))
(if (<= y.im -95.0)
t_2
(if (<= y.im -1.6e-45)
(*
(* y.im (* 0.5 (log t_0)))
(exp (- (* y.re (log (- x.re))) (* (atan2 x.im x.re) y.im))))
(if (<= y.im 1.6e+38) (* t_1 (pow (hypot x.im 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 = (x_46_re * x_46_re) + (x_46_im * x_46_im);
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = ((t_1 * pow(t_0, (y_46_re / 2.0))) + 1.0) + -1.0;
double tmp;
if (y_46_im <= -95.0) {
tmp = t_2;
} else if (y_46_im <= -1.6e-45) {
tmp = (y_46_im * (0.5 * log(t_0))) * exp(((y_46_re * log(-x_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_im <= 1.6e+38) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 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 = (x_46_re * x_46_re) + (x_46_im * x_46_im);
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = ((t_1 * Math.pow(t_0, (y_46_re / 2.0))) + 1.0) + -1.0;
double tmp;
if (y_46_im <= -95.0) {
tmp = t_2;
} else if (y_46_im <= -1.6e-45) {
tmp = (y_46_im * (0.5 * Math.log(t_0))) * Math.exp(((y_46_re * Math.log(-x_46_re)) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_im <= 1.6e+38) {
tmp = t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_re * x_46_re) + (x_46_im * x_46_im) t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_2 = ((t_1 * math.pow(t_0, (y_46_re / 2.0))) + 1.0) + -1.0 tmp = 0 if y_46_im <= -95.0: tmp = t_2 elif y_46_im <= -1.6e-45: tmp = (y_46_im * (0.5 * math.log(t_0))) * math.exp(((y_46_re * math.log(-x_46_re)) - (math.atan2(x_46_im, x_46_re) * y_46_im))) elif y_46_im <= 1.6e+38: tmp = t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = Float64(Float64(Float64(t_1 * (t_0 ^ Float64(y_46_re / 2.0))) + 1.0) + -1.0) tmp = 0.0 if (y_46_im <= -95.0) tmp = t_2; elseif (y_46_im <= -1.6e-45) tmp = Float64(Float64(y_46_im * Float64(0.5 * log(t_0))) * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_im <= 1.6e+38) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = t_2; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_re * x_46_re) + (x_46_im * x_46_im); t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); t_2 = ((t_1 * (t_0 ^ (y_46_re / 2.0))) + 1.0) + -1.0; tmp = 0.0; if (y_46_im <= -95.0) tmp = t_2; elseif (y_46_im <= -1.6e-45) tmp = (y_46_im * (0.5 * log(t_0))) * exp(((y_46_re * log(-x_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im))); elseif (y_46_im <= 1.6e+38) tmp = t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = 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[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $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[(N[(N[(t$95$1 * N[Power[t$95$0, N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[y$46$im, -95.0], t$95$2, If[LessEqual[y$46$im, -1.6e-45], N[(N[(y$46$im * N[(0.5 * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.6e+38], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot x.re + x.im \cdot x.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := \left(t\_1 \cdot {t\_0}^{\left(\frac{y.re}{2}\right)} + 1\right) + -1\\
\mathbf{if}\;y.im \leq -95:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq -1.6 \cdot 10^{-45}:\\
\;\;\;\;\left(y.im \cdot \left(0.5 \cdot \log t\_0\right)\right) \cdot e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{+38}:\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.im < -95 or 1.59999999999999993e38 < y.im Initial program 33.8%
exp-diff27.8%
exp-to-pow27.8%
hypot-define27.8%
*-commutative27.8%
exp-prod25.2%
fma-define25.2%
hypot-define51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in y.im around 0 38.3%
unpow238.3%
unpow238.3%
hypot-undefine27.7%
Simplified27.7%
Taylor expanded in y.im around 0 27.6%
expm1-log1p-u25.0%
expm1-undefine41.4%
*-commutative41.4%
*-commutative41.4%
hypot-undefine42.1%
+-commutative42.1%
sqrt-pow242.1%
Applied egg-rr42.1%
sub-neg42.1%
log1p-undefine42.1%
rem-exp-log49.0%
*-commutative49.0%
metadata-eval49.0%
Simplified49.0%
if -95 < y.im < -1.60000000000000004e-45Initial program 38.2%
Taylor expanded in y.re around 0 61.3%
+-commutative61.3%
unpow261.3%
unpow261.3%
unpow1/261.3%
exp-to-pow61.3%
*-commutative61.3%
rem-log-exp61.3%
associate-*r*61.3%
Simplified61.3%
Taylor expanded in y.im around 0 76.9%
*-commutative76.9%
+-commutative76.9%
unpow276.9%
unpow276.9%
associate-*l*76.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in x.re around -inf 61.5%
mul-1-neg61.5%
neg-sub061.5%
Simplified61.5%
if -1.60000000000000004e-45 < y.im < 1.59999999999999993e38Initial program 41.9%
exp-diff41.9%
exp-to-pow41.9%
hypot-define41.9%
*-commutative41.9%
exp-prod41.7%
fma-define41.7%
hypot-define89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in y.im around 0 63.0%
unpow263.0%
unpow263.0%
hypot-undefine90.0%
Simplified90.0%
Taylor expanded in y.im around 0 56.7%
Final simplification53.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re x.re) (* x.im x.im)))
(t_1 (sin (* y.re (atan2 x.im x.re))))
(t_2 (+ (+ (* t_1 (pow t_0 (/ y.re 2.0))) 1.0) -1.0))
(t_3 (pow (hypot x.im x.re) y.re)))
(if (<= y.im -850000000000.0)
t_2
(if (<= y.im -1.32e-45)
(* t_3 (sin (* (log t_0) (* y.im 0.5))))
(if (<= y.im 1.6e+38) (* t_1 t_3) t_2)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re * x_46_re) + (x_46_im * x_46_im);
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = ((t_1 * pow(t_0, (y_46_re / 2.0))) + 1.0) + -1.0;
double t_3 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -850000000000.0) {
tmp = t_2;
} else if (y_46_im <= -1.32e-45) {
tmp = t_3 * sin((log(t_0) * (y_46_im * 0.5)));
} else if (y_46_im <= 1.6e+38) {
tmp = t_1 * t_3;
} else {
tmp = 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 = (x_46_re * x_46_re) + (x_46_im * x_46_im);
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = ((t_1 * Math.pow(t_0, (y_46_re / 2.0))) + 1.0) + -1.0;
double t_3 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -850000000000.0) {
tmp = t_2;
} else if (y_46_im <= -1.32e-45) {
tmp = t_3 * Math.sin((Math.log(t_0) * (y_46_im * 0.5)));
} else if (y_46_im <= 1.6e+38) {
tmp = t_1 * t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_re * x_46_re) + (x_46_im * x_46_im) t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_2 = ((t_1 * math.pow(t_0, (y_46_re / 2.0))) + 1.0) + -1.0 t_3 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_im <= -850000000000.0: tmp = t_2 elif y_46_im <= -1.32e-45: tmp = t_3 * math.sin((math.log(t_0) * (y_46_im * 0.5))) elif y_46_im <= 1.6e+38: tmp = t_1 * t_3 else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = Float64(Float64(Float64(t_1 * (t_0 ^ Float64(y_46_re / 2.0))) + 1.0) + -1.0) t_3 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_im <= -850000000000.0) tmp = t_2; elseif (y_46_im <= -1.32e-45) tmp = Float64(t_3 * sin(Float64(log(t_0) * Float64(y_46_im * 0.5)))); elseif (y_46_im <= 1.6e+38) tmp = Float64(t_1 * t_3); else tmp = t_2; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_re * x_46_re) + (x_46_im * x_46_im); t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); t_2 = ((t_1 * (t_0 ^ (y_46_re / 2.0))) + 1.0) + -1.0; t_3 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_im <= -850000000000.0) tmp = t_2; elseif (y_46_im <= -1.32e-45) tmp = t_3 * sin((log(t_0) * (y_46_im * 0.5))); elseif (y_46_im <= 1.6e+38) tmp = t_1 * t_3; else tmp = 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[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $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[(N[(N[(t$95$1 * N[Power[t$95$0, N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] + -1.0), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$im, -850000000000.0], t$95$2, If[LessEqual[y$46$im, -1.32e-45], N[(t$95$3 * N[Sin[N[(N[Log[t$95$0], $MachinePrecision] * N[(y$46$im * 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.6e+38], N[(t$95$1 * t$95$3), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot x.re + x.im \cdot x.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := \left(t\_1 \cdot {t\_0}^{\left(\frac{y.re}{2}\right)} + 1\right) + -1\\
t_3 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -850000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq -1.32 \cdot 10^{-45}:\\
\;\;\;\;t\_3 \cdot \sin \left(\log t\_0 \cdot \left(y.im \cdot 0.5\right)\right)\\
\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{+38}:\\
\;\;\;\;t\_1 \cdot t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.im < -8.5e11 or 1.59999999999999993e38 < y.im Initial program 33.2%
exp-diff27.1%
exp-to-pow27.1%
hypot-define27.1%
*-commutative27.1%
exp-prod24.5%
fma-define24.5%
hypot-define51.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in y.im around 0 37.7%
unpow237.7%
unpow237.7%
hypot-undefine27.1%
Simplified27.1%
Taylor expanded in y.im around 0 26.9%
expm1-log1p-u24.3%
expm1-undefine40.8%
*-commutative40.8%
*-commutative40.8%
hypot-undefine41.6%
+-commutative41.6%
sqrt-pow241.6%
Applied egg-rr41.6%
sub-neg41.6%
log1p-undefine41.6%
rem-exp-log48.5%
*-commutative48.5%
metadata-eval48.5%
Simplified48.5%
if -8.5e11 < y.im < -1.32000000000000005e-45Initial program 42.6%
exp-diff42.6%
exp-to-pow42.6%
hypot-define42.6%
*-commutative42.6%
exp-prod42.6%
fma-define42.6%
hypot-define71.2%
*-commutative71.2%
Simplified71.2%
Taylor expanded in y.im around 0 50.0%
unpow250.0%
unpow250.0%
hypot-undefine70.7%
Simplified70.7%
Taylor expanded in y.im around inf 63.6%
+-commutative63.6%
unpow263.6%
unpow263.6%
unpow1/263.6%
exp-to-pow63.6%
*-commutative63.6%
rem-log-exp63.6%
associate-*r*63.6%
Simplified63.6%
if -1.32000000000000005e-45 < y.im < 1.59999999999999993e38Initial program 41.9%
exp-diff41.9%
exp-to-pow41.9%
hypot-define41.9%
*-commutative41.9%
exp-prod41.7%
fma-define41.7%
hypot-define89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in y.im around 0 63.0%
unpow263.0%
unpow263.0%
hypot-undefine90.0%
Simplified90.0%
Taylor expanded in y.im around 0 56.7%
Final simplification53.4%
(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 -1.7e+16) (not (<= y.im 3.75e-159)))
(+
(+ (* (sin t_0) (pow (+ (* x.re x.re) (* x.im x.im)) (/ y.re 2.0))) 1.0)
-1.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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -1.7e+16) || !(y_46_im <= 3.75e-159)) {
tmp = ((sin(t_0) * pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0))) + 1.0) + -1.0;
} 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -1.7e+16) || !(y_46_im <= 3.75e-159)) {
tmp = ((Math.sin(t_0) * Math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0))) + 1.0) + -1.0;
} 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 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_im <= -1.7e+16) or not (y_46_im <= 3.75e-159): tmp = ((math.sin(t_0) * math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0))) + 1.0) + -1.0 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -1.7e+16) || !(y_46_im <= 3.75e-159)) tmp = Float64(Float64(Float64(sin(t_0) * (Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) ^ Float64(y_46_re / 2.0))) + 1.0) + -1.0); 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 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_im <= -1.7e+16) || ~((y_46_im <= 3.75e-159))) tmp = ((sin(t_0) * (((x_46_re * x_46_re) + (x_46_im * x_46_im)) ^ (y_46_re / 2.0))) + 1.0) + -1.0; 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -1.7e+16], N[Not[LessEqual[y$46$im, 3.75e-159]], $MachinePrecision]], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] + -1.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 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -1.7 \cdot 10^{+16} \lor \neg \left(y.im \leq 3.75 \cdot 10^{-159}\right):\\
\;\;\;\;\left(\sin t\_0 \cdot {\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)} + 1\right) + -1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -1.7e16 or 3.75e-159 < y.im Initial program 32.3%
exp-diff27.6%
exp-to-pow27.6%
hypot-define27.6%
*-commutative27.6%
exp-prod25.5%
fma-define25.5%
hypot-define58.8%
*-commutative58.8%
Simplified58.8%
Taylor expanded in y.im around 0 41.8%
unpow241.8%
unpow241.8%
hypot-undefine41.0%
Simplified41.0%
Taylor expanded in y.im around 0 31.8%
expm1-log1p-u27.7%
expm1-undefine39.7%
*-commutative39.7%
*-commutative39.7%
hypot-undefine40.2%
+-commutative40.2%
sqrt-pow240.2%
Applied egg-rr40.2%
sub-neg40.2%
log1p-undefine40.2%
rem-exp-log47.5%
*-commutative47.5%
metadata-eval47.5%
Simplified47.5%
if -1.7e16 < y.im < 3.75e-159Initial program 46.2%
exp-diff46.2%
exp-to-pow46.2%
hypot-define46.2%
*-commutative46.2%
exp-prod46.2%
fma-define46.2%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.im around 0 63.9%
unpow263.9%
unpow263.9%
hypot-undefine88.5%
Simplified88.5%
Taylor expanded in y.im around 0 54.4%
Taylor expanded in y.re around 0 56.3%
Final simplification51.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 -5400000000000.0) (not (<= y.im 5.6e-186)))
(* (sin t_0) (pow (+ (* x.re x.re) (* x.im x.im)) (/ y.re 2.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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -5400000000000.0) || !(y_46_im <= 5.6e-186)) {
tmp = sin(t_0) * pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
} 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -5400000000000.0) || !(y_46_im <= 5.6e-186)) {
tmp = Math.sin(t_0) * Math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
} 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 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_im <= -5400000000000.0) or not (y_46_im <= 5.6e-186): tmp = math.sin(t_0) * math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0)) 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -5400000000000.0) || !(y_46_im <= 5.6e-186)) tmp = Float64(sin(t_0) * (Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) ^ Float64(y_46_re / 2.0))); 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 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_im <= -5400000000000.0) || ~((y_46_im <= 5.6e-186))) tmp = sin(t_0) * (((x_46_re * x_46_re) + (x_46_im * x_46_im)) ^ (y_46_re / 2.0)); 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -5400000000000.0], N[Not[LessEqual[y$46$im, 5.6e-186]], $MachinePrecision]], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re / 2.0), $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 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -5400000000000 \lor \neg \left(y.im \leq 5.6 \cdot 10^{-186}\right):\\
\;\;\;\;\sin t\_0 \cdot {\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -5.4e12 or 5.59999999999999966e-186 < y.im Initial program 33.0%
exp-diff28.4%
exp-to-pow28.4%
hypot-define28.4%
*-commutative28.4%
exp-prod26.3%
fma-define26.3%
hypot-define58.9%
*-commutative58.9%
Simplified58.9%
Taylor expanded in y.im around 0 42.3%
unpow242.3%
unpow242.3%
hypot-undefine41.6%
Simplified41.6%
Taylor expanded in y.im around 0 31.8%
hypot-undefine40.5%
+-commutative40.5%
sqrt-pow240.5%
*-commutative40.5%
Applied egg-rr40.5%
if -5.4e12 < y.im < 5.59999999999999966e-186Initial program 45.6%
exp-diff45.6%
exp-to-pow45.6%
hypot-define45.6%
*-commutative45.6%
exp-prod45.6%
fma-define45.6%
hypot-define89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in y.im around 0 63.8%
unpow263.8%
unpow263.8%
hypot-undefine89.1%
Simplified89.1%
Taylor expanded in y.im around 0 54.9%
Taylor expanded in y.re around 0 56.9%
Final simplification47.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.re -37.0) (not (<= y.re 0.0004)))
(* (sin t_0) (pow x.im y.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_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -37.0) || !(y_46_re <= 0.0004)) {
tmp = sin(t_0) * pow(x_46_im, y_46_re);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
if ((y_46re <= (-37.0d0)) .or. (.not. (y_46re <= 0.0004d0))) then
tmp = sin(t_0) * (x_46im ** y_46re)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -37.0) || !(y_46_re <= 0.0004)) {
tmp = Math.sin(t_0) * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0;
}
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 <= -37.0) or not (y_46_re <= 0.0004): tmp = math.sin(t_0) * math.pow(x_46_im, y_46_re) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -37.0) || !(y_46_re <= 0.0004)) tmp = Float64(sin(t_0) * (x_46_im ^ y_46_re)); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_re <= -37.0) || ~((y_46_re <= 0.0004))) tmp = sin(t_0) * (x_46_im ^ y_46_re); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -37.0], N[Not[LessEqual[y$46$re, 0.0004]], $MachinePrecision]], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -37 \lor \neg \left(y.re \leq 0.0004\right):\\
\;\;\;\;\sin t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -37 or 4.00000000000000019e-4 < y.re Initial program 36.2%
exp-diff30.2%
exp-to-pow30.2%
hypot-define30.2%
*-commutative30.2%
exp-prod27.6%
fma-define27.6%
hypot-define58.6%
*-commutative58.6%
Simplified58.6%
Taylor expanded in y.im around 0 66.6%
unpow266.6%
unpow266.6%
hypot-undefine66.6%
Simplified66.6%
Taylor expanded in y.im around 0 64.9%
Taylor expanded in x.re around 0 48.0%
if -37 < y.re < 4.00000000000000019e-4Initial program 39.5%
exp-diff39.5%
exp-to-pow39.5%
hypot-define39.5%
*-commutative39.5%
exp-prod39.4%
fma-define39.4%
hypot-define81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in y.im around 0 38.0%
unpow238.0%
unpow238.0%
hypot-undefine55.8%
Simplified55.8%
Taylor expanded in y.im around 0 21.4%
Taylor expanded in y.re around 0 19.8%
Final simplification32.5%
(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.55e-27) (* 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.55e-27) {
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.55d-27) 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.55e-27) {
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.55e-27: 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.55e-27) 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.55e-27) 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.55e-27], 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.55 \cdot 10^{-27}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < 1.5499999999999999e-27Initial program 40.2%
exp-diff37.6%
exp-to-pow37.6%
hypot-define37.6%
*-commutative37.6%
exp-prod36.0%
fma-define36.0%
hypot-define72.8%
*-commutative72.8%
Simplified72.8%
Taylor expanded in y.im around 0 54.3%
unpow254.3%
unpow254.3%
hypot-undefine62.1%
Simplified62.1%
Taylor expanded in y.im around 0 40.7%
Taylor expanded in x.im around 0 32.6%
if 1.5499999999999999e-27 < x.im Initial program 31.1%
exp-diff27.8%
exp-to-pow27.8%
hypot-define27.8%
*-commutative27.8%
exp-prod27.8%
fma-define27.8%
hypot-define65.5%
*-commutative65.5%
Simplified65.5%
Taylor expanded in y.im around 0 40.4%
unpow240.4%
unpow240.4%
hypot-undefine56.2%
Simplified56.2%
Taylor expanded in y.im around 0 42.6%
Taylor expanded in x.re around 0 42.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (* y.re (atan2 x.im x.re)) (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) {
return (y_46_re * atan2(x_46_im, x_46_re)) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (y_46_re * Math.atan2(x_46_im, x_46_re)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return (y_46_re * math.atan2(x_46_im, x_46_re)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (hypot(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) tmp = (y_46_re * atan2(x_46_im, x_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\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}
\end{array}
Initial program 38.0%
exp-diff35.3%
exp-to-pow35.3%
hypot-define35.3%
*-commutative35.3%
exp-prod34.0%
fma-define34.0%
hypot-define71.1%
*-commutative71.1%
Simplified71.1%
Taylor expanded in y.im around 0 50.9%
unpow250.9%
unpow250.9%
hypot-undefine60.7%
Simplified60.7%
Taylor expanded in y.im around 0 41.1%
Taylor expanded in y.re around 0 41.1%
Final simplification41.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 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) {
return y_46_re * atan2(x_46_im, x_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 = y_46re * atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * Math.atan2(x_46_im, x_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * math.atan2(x_46_im, x_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 38.0%
exp-diff35.3%
exp-to-pow35.3%
hypot-define35.3%
*-commutative35.3%
exp-prod34.0%
fma-define34.0%
hypot-define71.1%
*-commutative71.1%
Simplified71.1%
Taylor expanded in y.im around 0 50.9%
unpow250.9%
unpow250.9%
hypot-undefine60.7%
Simplified60.7%
Taylor expanded in y.im around 0 41.1%
Taylor expanded in y.re around 0 13.2%
herbie shell --seed 2024107
(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)))))