
(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 19 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 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.im (log (hypot x.im x.re)))))
(t_2 (log (hypot x.re x.im)))
(t_3 (exp (- (* y.re t_2) t_0)))
(t_4 (* t_3 (fabs t_1)))
(t_5 (* y.re (atan2 x.im x.re))))
(if (<= y.im -3.7e+105)
t_4
(if (<= y.im -3.4e+73)
(* t_3 (sin (+ t_5 (* y.im (log x.im)))))
(if (<= y.im -1.9e+27)
t_4
(if (<= y.im 1e-81)
(*
(sin (fma t_2 y.im t_5))
(/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0)))
(if (or (<= y.im 3.3e+114) (not (<= y.im 4e+164)))
(* t_3 t_1)
(* t_3 (sin t_5)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_2 = log(hypot(x_46_re, x_46_im));
double t_3 = exp(((y_46_re * t_2) - t_0));
double t_4 = t_3 * fabs(t_1);
double t_5 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -3.7e+105) {
tmp = t_4;
} else if (y_46_im <= -3.4e+73) {
tmp = t_3 * sin((t_5 + (y_46_im * log(x_46_im))));
} else if (y_46_im <= -1.9e+27) {
tmp = t_4;
} else if (y_46_im <= 1e-81) {
tmp = sin(fma(t_2, y_46_im, t_5)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0));
} else if ((y_46_im <= 3.3e+114) || !(y_46_im <= 4e+164)) {
tmp = t_3 * t_1;
} else {
tmp = t_3 * sin(t_5);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_2 = log(hypot(x_46_re, x_46_im)) t_3 = exp(Float64(Float64(y_46_re * t_2) - t_0)) t_4 = Float64(t_3 * abs(t_1)) t_5 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -3.7e+105) tmp = t_4; elseif (y_46_im <= -3.4e+73) tmp = Float64(t_3 * sin(Float64(t_5 + Float64(y_46_im * log(x_46_im))))); elseif (y_46_im <= -1.9e+27) tmp = t_4; elseif (y_46_im <= 1e-81) tmp = Float64(sin(fma(t_2, y_46_im, t_5)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.0))); elseif ((y_46_im <= 3.3e+114) || !(y_46_im <= 4e+164)) tmp = Float64(t_3 * t_1); else tmp = Float64(t_3 * sin(t_5)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(y$46$re * t$95$2), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.7e+105], t$95$4, If[LessEqual[y$46$im, -3.4e+73], N[(t$95$3 * N[Sin[N[(t$95$5 + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.9e+27], t$95$4, If[LessEqual[y$46$im, 1e-81], N[(N[Sin[N[(t$95$2 * y$46$im + t$95$5), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, 3.3e+114], N[Not[LessEqual[y$46$im, 4e+164]], $MachinePrecision]], N[(t$95$3 * t$95$1), $MachinePrecision], N[(t$95$3 * N[Sin[t$95$5], $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := e^{y.re \cdot t_2 - t_0}\\
t_4 := t_3 \cdot \left|t_1\right|\\
t_5 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -3.7 \cdot 10^{+105}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y.im \leq -3.4 \cdot 10^{+73}:\\
\;\;\;\;t_3 \cdot \sin \left(t_5 + y.im \cdot \log x.im\right)\\
\mathbf{elif}\;y.im \leq -1.9 \cdot 10^{+27}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y.im \leq 10^{-81}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_2, y.im, t_5\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_0 + 1}\\
\mathbf{elif}\;y.im \leq 3.3 \cdot 10^{+114} \lor \neg \left(y.im \leq 4 \cdot 10^{+164}\right):\\
\;\;\;\;t_3 \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \sin t_5\\
\end{array}
\end{array}
if y.im < -3.69999999999999985e105 or -3.4000000000000002e73 < y.im < -1.90000000000000011e27Initial program 40.0%
Simplified72.3%
add-cube-cbrt70.7%
Applied egg-rr70.7%
unpow270.7%
add-cube-cbrt72.3%
fma-udef72.3%
*-commutative72.3%
sin-sum75.5%
add-sqr-sqrt35.8%
fabs-sqr35.8%
add-sqr-sqrt75.5%
add-sqr-sqrt35.8%
Applied egg-rr80.5%
unpow280.5%
rem-sqrt-square80.5%
fma-def80.5%
*-commutative80.5%
*-commutative80.5%
hypot-def46.9%
unpow246.9%
unpow246.9%
+-commutative46.9%
fma-def46.9%
unpow246.9%
unpow246.9%
hypot-def80.5%
Simplified80.5%
Taylor expanded in y.im around inf 46.9%
+-commutative46.9%
unpow246.9%
unpow246.9%
hypot-def80.5%
hypot-def46.9%
unpow246.9%
unpow246.9%
+-commutative46.9%
unpow246.9%
unpow246.9%
hypot-def80.5%
Simplified80.5%
if -3.69999999999999985e105 < y.im < -3.4000000000000002e73Initial program 44.4%
Simplified68.9%
Taylor expanded in x.re around 0 78.0%
if -1.90000000000000011e27 < y.im < 9.9999999999999996e-82Initial program 44.1%
exp-diff44.1%
+-rgt-identity44.1%
+-rgt-identity44.1%
exp-to-pow44.1%
hypot-def44.1%
*-commutative44.1%
exp-prod43.4%
fma-def43.4%
hypot-def84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in y.im around 0 85.7%
if 9.9999999999999996e-82 < y.im < 3.3000000000000001e114 or 4e164 < y.im Initial program 42.6%
Simplified80.3%
add-cube-cbrt77.4%
Applied egg-rr77.4%
Taylor expanded in y.re around 0 47.6%
+-commutative47.6%
unpow247.6%
unpow247.6%
hypot-def82.1%
hypot-def47.6%
unpow247.6%
unpow247.6%
+-commutative47.6%
unpow247.6%
unpow247.6%
hypot-def82.1%
Simplified82.1%
if 3.3000000000000001e114 < y.im < 4e164Initial program 20.1%
Simplified41.4%
Taylor expanded in y.im around 0 87.0%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (log (hypot x.re x.im)))
(t_3 (* (atan2 x.im x.re) y.im))
(t_4 (* (exp (- (* t_1 y.re) t_3)) (sin (+ (* t_1 y.im) t_0))))
(t_5 (exp (- (* y.re t_2) t_3)))
(t_6 (cbrt (fma t_2 y.im t_0))))
(if (<= t_4 2.0)
(* t_5 (sin (pow t_6 3.0)))
(if (<= t_4 INFINITY)
(* t_5 (sin (* y.im (log (hypot x.im x.re)))))
(* t_5 (sin (* t_6 (expm1 (log1p (pow t_6 2.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 t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = log(hypot(x_46_re, x_46_im));
double t_3 = atan2(x_46_im, x_46_re) * y_46_im;
double t_4 = exp(((t_1 * y_46_re) - t_3)) * sin(((t_1 * y_46_im) + t_0));
double t_5 = exp(((y_46_re * t_2) - t_3));
double t_6 = cbrt(fma(t_2, y_46_im, t_0));
double tmp;
if (t_4 <= 2.0) {
tmp = t_5 * sin(pow(t_6, 3.0));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = t_5 * sin((t_6 * expm1(log1p(pow(t_6, 2.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)) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = log(hypot(x_46_re, x_46_im)) t_3 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_4 = Float64(exp(Float64(Float64(t_1 * y_46_re) - t_3)) * sin(Float64(Float64(t_1 * y_46_im) + t_0))) t_5 = exp(Float64(Float64(y_46_re * t_2) - t_3)) t_6 = cbrt(fma(t_2, y_46_im, t_0)) tmp = 0.0 if (t_4 <= 2.0) tmp = Float64(t_5 * sin((t_6 ^ 3.0))); elseif (t_4 <= Inf) tmp = Float64(t_5 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(t_5 * sin(Float64(t_6 * expm1(log1p((t_6 ^ 2.0)))))); 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[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$4 = N[(N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Exp[N[(N[(y$46$re * t$95$2), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[Power[N[(t$95$2 * y$46$im + t$95$0), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[t$95$4, 2.0], N[(t$95$5 * N[Sin[N[Power[t$95$6, 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(t$95$5 * 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$5 * N[Sin[N[(t$95$6 * N[(Exp[N[Log[1 + N[Power[t$95$6, 2.0], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_4 := e^{t_1 \cdot y.re - t_3} \cdot \sin \left(t_1 \cdot y.im + t_0\right)\\
t_5 := e^{y.re \cdot t_2 - t_3}\\
t_6 := \sqrt[3]{\mathsf{fma}\left(t_2, y.im, t_0\right)}\\
\mathbf{if}\;t_4 \leq 2:\\
\;\;\;\;t_5 \cdot \sin \left({t_6}^{3}\right)\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t_5 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_5 \cdot \sin \left(t_6 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left({t_6}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < 2Initial program 82.7%
Simplified82.7%
fma-udef82.7%
hypot-udef82.7%
*-commutative82.7%
add-cube-cbrt85.3%
pow385.5%
hypot-udef85.5%
*-commutative85.5%
fma-udef85.5%
*-commutative85.5%
Applied egg-rr85.5%
if 2 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < +inf.0Initial program 60.9%
Simplified60.9%
add-cube-cbrt47.8%
Applied egg-rr47.8%
Taylor expanded in y.re around 0 73.9%
+-commutative73.9%
unpow273.9%
unpow273.9%
hypot-def73.9%
hypot-def73.9%
unpow273.9%
unpow273.9%
+-commutative73.9%
unpow273.9%
unpow273.9%
hypot-def73.9%
Simplified73.9%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 0.0%
Simplified77.5%
add-cube-cbrt78.9%
Applied egg-rr78.9%
expm1-log1p-u82.9%
Applied egg-rr82.9%
Final simplification83.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2
(*
(exp (- (* t_1 y.re) t_0))
(sin (+ (* t_1 y.im) (* y.re (atan2 x.im x.re)))))))
(if (<= t_2 2e-36)
t_2
(*
(exp (- (* y.re (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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((t_1 * y_46_re) - t_0)) * sin(((t_1 * y_46_im) + (y_46_re * atan2(x_46_im, x_46_re))));
double tmp;
if (t_2 <= 2e-36) {
tmp = t_2;
} else {
tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * 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 t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = Math.exp(((t_1 * y_46_re) - t_0)) * Math.sin(((t_1 * y_46_im) + (y_46_re * Math.atan2(x_46_im, x_46_re))));
double tmp;
if (t_2 <= 2e-36) {
tmp = t_2;
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - t_0)) * 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): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) t_2 = math.exp(((t_1 * y_46_re) - t_0)) * math.sin(((t_1 * y_46_im) + (y_46_re * math.atan2(x_46_im, x_46_re)))) tmp = 0 if t_2 <= 2e-36: tmp = t_2 else: tmp = math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - t_0)) * 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) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = Float64(exp(Float64(Float64(t_1 * y_46_re) - t_0)) * sin(Float64(Float64(t_1 * y_46_im) + Float64(y_46_re * atan(x_46_im, x_46_re))))) tmp = 0.0 if (t_2 <= 2e-36) tmp = t_2; else tmp = Float64(exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * 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) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); t_2 = exp(((t_1 * y_46_re) - t_0)) * sin(((t_1 * y_46_im) + (y_46_re * atan2(x_46_im, x_46_re)))); tmp = 0.0; if (t_2 <= 2e-36) tmp = t_2; else tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * 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_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 2e-36], t$95$2, N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * 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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{t_1 \cdot y.re - t_0} \cdot \sin \left(t_1 \cdot y.im + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;t_2 \leq 2 \cdot 10^{-36}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - 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 (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < 1.9999999999999999e-36Initial program 83.3%
if 1.9999999999999999e-36 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 9.7%
Simplified74.5%
add-cube-cbrt73.6%
Applied egg-rr73.6%
Taylor expanded in y.re around 0 11.8%
+-commutative11.8%
unpow211.8%
unpow211.8%
hypot-def71.9%
hypot-def11.8%
unpow211.8%
unpow211.8%
+-commutative11.8%
unpow211.8%
unpow211.8%
hypot-def71.9%
Simplified71.9%
Final simplification76.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (cbrt (fma t_1 y.im t_0)))
(t_3 (exp (- (* y.re t_1) (* (atan2 x.im x.re) y.im)))))
(if (<= x.im -1.8e-75)
(*
t_3
(sin
(*
t_2
(expm1
(log1p (pow (cbrt (- t_0 (* y.im (log (/ -1.0 x.im))))) 2.0))))))
(* t_3 (sin (* t_2 (pow t_2 2.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 t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = cbrt(fma(t_1, y_46_im, t_0));
double t_3 = exp(((y_46_re * t_1) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_im <= -1.8e-75) {
tmp = t_3 * sin((t_2 * expm1(log1p(pow(cbrt((t_0 - (y_46_im * log((-1.0 / x_46_im))))), 2.0)))));
} else {
tmp = t_3 * sin((t_2 * pow(t_2, 2.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)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = cbrt(fma(t_1, y_46_im, t_0)) t_3 = exp(Float64(Float64(y_46_re * t_1) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_im <= -1.8e-75) tmp = Float64(t_3 * sin(Float64(t_2 * expm1(log1p((cbrt(Float64(t_0 - Float64(y_46_im * log(Float64(-1.0 / x_46_im))))) ^ 2.0)))))); else tmp = Float64(t_3 * sin(Float64(t_2 * (t_2 ^ 2.0)))); 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.8e-75], N[(t$95$3 * N[Sin[N[(t$95$2 * N[(Exp[N[Log[1 + N[Power[N[Power[N[(t$95$0 - N[(y$46$im * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Sin[N[(t$95$2 * N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := \sqrt[3]{\mathsf{fma}\left(t_1, y.im, t_0\right)}\\
t_3 := e^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.im \leq -1.8 \cdot 10^{-75}:\\
\;\;\;\;t_3 \cdot \sin \left(t_2 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left({\left(\sqrt[3]{t_0 - y.im \cdot \log \left(\frac{-1}{x.im}\right)}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \sin \left(t_2 \cdot {t_2}^{2}\right)\\
\end{array}
\end{array}
if x.im < -1.8e-75Initial program 37.1%
Simplified78.4%
add-cube-cbrt78.0%
Applied egg-rr78.0%
expm1-log1p-u87.1%
Applied egg-rr87.1%
Taylor expanded in x.im around -inf 41.7%
unpow1/383.9%
+-commutative83.9%
mul-1-neg83.9%
unsub-neg83.9%
*-commutative83.9%
Simplified83.9%
if -1.8e-75 < x.im Initial program 43.2%
Simplified78.3%
add-cube-cbrt79.3%
Applied egg-rr79.3%
Final simplification80.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(t_2 (cbrt t_1))
(t_3 (exp (- (* y.re t_0) (* (atan2 x.im x.re) y.im)))))
(if (<= x.im 2e+96)
(* t_3 (sin (pow t_2 3.0)))
(if (<= x.im 3.9e+176)
(*
t_3
(sin
(*
(expm1 (log1p (pow t_2 2.0)))
(cbrt (* 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 = fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = cbrt(t_1);
double t_3 = exp(((y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_im <= 2e+96) {
tmp = t_3 * sin(pow(t_2, 3.0));
} else if (x_46_im <= 3.9e+176) {
tmp = t_3 * sin((expm1(log1p(pow(t_2, 2.0))) * cbrt((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 = fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = cbrt(t_1) t_3 = exp(Float64(Float64(y_46_re * t_0) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_im <= 2e+96) tmp = Float64(t_3 * sin((t_2 ^ 3.0))); elseif (x_46_im <= 3.9e+176) tmp = Float64(t_3 * sin(Float64(expm1(log1p((t_2 ^ 2.0))) * cbrt(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[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[t$95$1, 1/3], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, 2e+96], N[(t$95$3 * N[Sin[N[Power[t$95$2, 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 3.9e+176], N[(t$95$3 * N[Sin[N[(N[(Exp[N[Log[1 + N[Power[t$95$2, 2.0], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision] * N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $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 := \mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := \sqrt[3]{t_1}\\
t_3 := e^{y.re \cdot t_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.im \leq 2 \cdot 10^{+96}:\\
\;\;\;\;t_3 \cdot \sin \left({t_2}^{3}\right)\\
\mathbf{elif}\;x.im \leq 3.9 \cdot 10^{+176}:\\
\;\;\;\;t_3 \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left({t_2}^{2}\right)\right) \cdot \sqrt[3]{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 x.im < 2.0000000000000001e96Initial program 46.1%
Simplified79.3%
fma-udef79.3%
hypot-udef46.1%
*-commutative46.1%
add-cube-cbrt45.6%
pow346.1%
hypot-udef81.1%
*-commutative81.1%
fma-udef81.1%
*-commutative81.1%
Applied egg-rr81.1%
if 2.0000000000000001e96 < x.im < 3.9000000000000001e176Initial program 40.9%
Simplified68.0%
add-cube-cbrt81.0%
Applied egg-rr81.0%
expm1-log1p-u90.1%
Applied egg-rr90.1%
Taylor expanded in y.re around 0 26.8%
unpow1/359.0%
+-commutative59.0%
unpow259.0%
unpow259.0%
hypot-def95.4%
hypot-def59.0%
unpow259.0%
unpow259.0%
+-commutative59.0%
unpow259.0%
unpow259.0%
hypot-def95.4%
Simplified95.4%
if 3.9000000000000001e176 < x.im Initial program 0.0%
Simplified79.1%
Final simplification82.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (- (* y.re t_1) (* (atan2 x.im x.re) y.im)))))
(if (<= y.im -4.5e+165)
(* t_2 (fabs (sin (* y.im (log (hypot x.im x.re))))))
(if (<= y.im 9e+116)
(* t_2 (log1p (expm1 (sin (fma t_1 y.im t_0)))))
(* t_2 (sin 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 t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(((y_46_re * t_1) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_im <= -4.5e+165) {
tmp = t_2 * fabs(sin((y_46_im * log(hypot(x_46_im, x_46_re)))));
} else if (y_46_im <= 9e+116) {
tmp = t_2 * log1p(expm1(sin(fma(t_1, y_46_im, t_0))));
} else {
tmp = t_2 * sin(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)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = exp(Float64(Float64(y_46_re * t_1) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_im <= -4.5e+165) tmp = Float64(t_2 * abs(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))))); elseif (y_46_im <= 9e+116) tmp = Float64(t_2 * log1p(expm1(sin(fma(t_1, y_46_im, t_0))))); else tmp = Float64(t_2 * sin(t_0)); 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -4.5e+165], N[(t$95$2 * N[Abs[N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9e+116], N[(t$95$2 * N[Log[1 + N[(Exp[N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.im \leq -4.5 \cdot 10^{+165}:\\
\;\;\;\;t_2 \cdot \left|\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right|\\
\mathbf{elif}\;y.im \leq 9 \cdot 10^{+116}:\\
\;\;\;\;t_2 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin t_0\\
\end{array}
\end{array}
if y.im < -4.4999999999999996e165Initial program 39.3%
Simplified72.1%
add-cube-cbrt76.3%
Applied egg-rr76.3%
unpow276.3%
add-cube-cbrt72.1%
fma-udef72.1%
*-commutative72.1%
sin-sum75.7%
add-sqr-sqrt36.4%
fabs-sqr36.4%
add-sqr-sqrt75.7%
add-sqr-sqrt40.0%
Applied egg-rr86.5%
unpow286.5%
rem-sqrt-square86.5%
fma-def86.5%
*-commutative86.5%
*-commutative86.5%
hypot-def47.1%
unpow247.1%
unpow247.1%
+-commutative47.1%
fma-def47.1%
unpow247.1%
unpow247.1%
hypot-def86.5%
Simplified86.5%
Taylor expanded in y.im around inf 47.1%
+-commutative47.1%
unpow247.1%
unpow247.1%
hypot-def86.5%
hypot-def47.1%
unpow247.1%
unpow247.1%
+-commutative47.1%
unpow247.1%
unpow247.1%
hypot-def86.5%
Simplified86.5%
if -4.4999999999999996e165 < y.im < 9.00000000000000032e116Initial program 42.3%
Simplified82.6%
add-cube-cbrt81.5%
Applied egg-rr81.5%
unpow281.5%
add-cube-cbrt82.6%
expm1-log1p-u69.6%
expm1-log1p-u82.6%
fma-udef82.6%
*-commutative82.6%
sin-sum83.7%
Applied egg-rr82.6%
if 9.00000000000000032e116 < y.im Initial program 38.7%
Simplified64.2%
Taylor expanded in y.im around 0 77.5%
Final simplification82.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(t_2 (exp (- (* y.re t_0) (* (atan2 x.im x.re) y.im)))))
(if (<= x.im 5.5e+149)
(* t_2 (sin (pow (cbrt t_1) 3.0)))
(* t_2 (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 = fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = exp(((y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_im <= 5.5e+149) {
tmp = t_2 * sin(pow(cbrt(t_1), 3.0));
} else {
tmp = t_2 * 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 = fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = exp(Float64(Float64(y_46_re * t_0) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_im <= 5.5e+149) tmp = Float64(t_2 * sin((cbrt(t_1) ^ 3.0))); else tmp = Float64(t_2 * 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[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, 5.5e+149], N[(t$95$2 * N[Sin[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * 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 := \mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := e^{y.re \cdot t_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.im \leq 5.5 \cdot 10^{+149}:\\
\;\;\;\;t_2 \cdot \sin \left({\left(\sqrt[3]{t_1}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin t_1\\
\end{array}
\end{array}
if x.im < 5.49999999999999999e149Initial program 46.6%
Simplified78.6%
fma-udef78.6%
hypot-udef46.6%
*-commutative46.6%
add-cube-cbrt46.6%
pow346.6%
hypot-udef81.2%
*-commutative81.2%
fma-udef81.2%
*-commutative81.2%
Applied egg-rr81.2%
if 5.49999999999999999e149 < x.im Initial program 0.0%
Simplified75.8%
Final simplification80.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (- (* y.re t_0) (* (atan2 x.im x.re) y.im))))
(t_2 (* y.re (atan2 x.im x.re))))
(if (<= y.im -7.5e+165)
(* t_1 (fabs (sin (* y.im (log (hypot x.im x.re))))))
(if (<= y.im 4.2e+113)
(* t_1 (sin (fma t_0 y.im t_2)))
(* t_1 (sin t_2))))))
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 = exp(((y_46_re * t_0) - (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_im <= -7.5e+165) {
tmp = t_1 * fabs(sin((y_46_im * log(hypot(x_46_im, x_46_re)))));
} else if (y_46_im <= 4.2e+113) {
tmp = t_1 * sin(fma(t_0, y_46_im, t_2));
} else {
tmp = t_1 * sin(t_2);
}
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 = exp(Float64(Float64(y_46_re * t_0) - 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_im <= -7.5e+165) tmp = Float64(t_1 * abs(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))))); elseif (y_46_im <= 4.2e+113) tmp = Float64(t_1 * sin(fma(t_0, y_46_im, t_2))); else tmp = Float64(t_1 * sin(t_2)); 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[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -7.5e+165], N[(t$95$1 * N[Abs[N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.2e+113], N[(t$95$1 * N[Sin[N[(t$95$0 * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{y.re \cdot t_0 - \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.im \leq -7.5 \cdot 10^{+165}:\\
\;\;\;\;t_1 \cdot \left|\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right|\\
\mathbf{elif}\;y.im \leq 4.2 \cdot 10^{+113}:\\
\;\;\;\;t_1 \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, t_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin t_2\\
\end{array}
\end{array}
if y.im < -7.49999999999999996e165Initial program 39.3%
Simplified72.1%
add-cube-cbrt76.3%
Applied egg-rr76.3%
unpow276.3%
add-cube-cbrt72.1%
fma-udef72.1%
*-commutative72.1%
sin-sum75.7%
add-sqr-sqrt36.4%
fabs-sqr36.4%
add-sqr-sqrt75.7%
add-sqr-sqrt40.0%
Applied egg-rr86.5%
unpow286.5%
rem-sqrt-square86.5%
fma-def86.5%
*-commutative86.5%
*-commutative86.5%
hypot-def47.1%
unpow247.1%
unpow247.1%
+-commutative47.1%
fma-def47.1%
unpow247.1%
unpow247.1%
hypot-def86.5%
Simplified86.5%
Taylor expanded in y.im around inf 47.1%
+-commutative47.1%
unpow247.1%
unpow247.1%
hypot-def86.5%
hypot-def47.1%
unpow247.1%
unpow247.1%
+-commutative47.1%
unpow247.1%
unpow247.1%
hypot-def86.5%
Simplified86.5%
if -7.49999999999999996e165 < y.im < 4.1999999999999998e113Initial program 42.3%
Simplified82.6%
if 4.1999999999999998e113 < y.im Initial program 38.7%
Simplified64.2%
Taylor expanded in y.im around 0 77.5%
Final simplification82.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.im (log (hypot x.im x.re)))))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (- (* y.re t_1) (* (atan2 x.im x.re) y.im))))
(t_3 (* t_2 (fabs t_0)))
(t_4 (* y.re (atan2 x.im x.re))))
(if (<= y.im -3.7e+105)
t_3
(if (<= y.im -3.4e+73)
(* t_2 (sin (+ t_4 (* y.im (log x.im)))))
(if (<= y.im -1.5e+26)
t_3
(if (<= y.im 1.62e-81)
(* (sin (fma t_1 y.im t_4)) (pow (hypot x.re x.im) y.re))
(if (or (<= y.im 5e+118) (not (<= y.im 4.4e+163)))
(* t_2 t_0)
(* t_2 (sin t_4)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(((y_46_re * t_1) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = t_2 * fabs(t_0);
double t_4 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -3.7e+105) {
tmp = t_3;
} else if (y_46_im <= -3.4e+73) {
tmp = t_2 * sin((t_4 + (y_46_im * log(x_46_im))));
} else if (y_46_im <= -1.5e+26) {
tmp = t_3;
} else if (y_46_im <= 1.62e-81) {
tmp = sin(fma(t_1, y_46_im, t_4)) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if ((y_46_im <= 5e+118) || !(y_46_im <= 4.4e+163)) {
tmp = t_2 * t_0;
} else {
tmp = t_2 * sin(t_4);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = exp(Float64(Float64(y_46_re * t_1) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = Float64(t_2 * abs(t_0)) t_4 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -3.7e+105) tmp = t_3; elseif (y_46_im <= -3.4e+73) tmp = Float64(t_2 * sin(Float64(t_4 + Float64(y_46_im * log(x_46_im))))); elseif (y_46_im <= -1.5e+26) tmp = t_3; elseif (y_46_im <= 1.62e-81) tmp = Float64(sin(fma(t_1, y_46_im, t_4)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif ((y_46_im <= 5e+118) || !(y_46_im <= 4.4e+163)) tmp = Float64(t_2 * t_0); else tmp = Float64(t_2 * sin(t_4)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Abs[t$95$0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.7e+105], t$95$3, If[LessEqual[y$46$im, -3.4e+73], N[(t$95$2 * N[Sin[N[(t$95$4 + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.5e+26], t$95$3, If[LessEqual[y$46$im, 1.62e-81], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$4), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, 5e+118], N[Not[LessEqual[y$46$im, 4.4e+163]], $MachinePrecision]], N[(t$95$2 * t$95$0), $MachinePrecision], N[(t$95$2 * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := t_2 \cdot \left|t_0\right|\\
t_4 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -3.7 \cdot 10^{+105}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.im \leq -3.4 \cdot 10^{+73}:\\
\;\;\;\;t_2 \cdot \sin \left(t_4 + y.im \cdot \log x.im\right)\\
\mathbf{elif}\;y.im \leq -1.5 \cdot 10^{+26}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.im \leq 1.62 \cdot 10^{-81}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_4\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{+118} \lor \neg \left(y.im \leq 4.4 \cdot 10^{+163}\right):\\
\;\;\;\;t_2 \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin t_4\\
\end{array}
\end{array}
if y.im < -3.69999999999999985e105 or -3.4000000000000002e73 < y.im < -1.49999999999999999e26Initial program 40.0%
Simplified72.3%
add-cube-cbrt70.7%
Applied egg-rr70.7%
unpow270.7%
add-cube-cbrt72.3%
fma-udef72.3%
*-commutative72.3%
sin-sum75.5%
add-sqr-sqrt35.8%
fabs-sqr35.8%
add-sqr-sqrt75.5%
add-sqr-sqrt35.8%
Applied egg-rr80.5%
unpow280.5%
rem-sqrt-square80.5%
fma-def80.5%
*-commutative80.5%
*-commutative80.5%
hypot-def46.9%
unpow246.9%
unpow246.9%
+-commutative46.9%
fma-def46.9%
unpow246.9%
unpow246.9%
hypot-def80.5%
Simplified80.5%
Taylor expanded in y.im around inf 46.9%
+-commutative46.9%
unpow246.9%
unpow246.9%
hypot-def80.5%
hypot-def46.9%
unpow246.9%
unpow246.9%
+-commutative46.9%
unpow246.9%
unpow246.9%
hypot-def80.5%
Simplified80.5%
if -3.69999999999999985e105 < y.im < -3.4000000000000002e73Initial program 44.4%
Simplified68.9%
Taylor expanded in x.re around 0 78.0%
if -1.49999999999999999e26 < y.im < 1.62000000000000008e-81Initial program 44.1%
exp-diff44.1%
+-rgt-identity44.1%
+-rgt-identity44.1%
exp-to-pow44.1%
hypot-def44.1%
*-commutative44.1%
exp-prod43.4%
fma-def43.4%
hypot-def84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in y.im around 0 85.7%
if 1.62000000000000008e-81 < y.im < 4.99999999999999972e118 or 4.39999999999999973e163 < y.im Initial program 42.6%
Simplified80.3%
add-cube-cbrt77.4%
Applied egg-rr77.4%
Taylor expanded in y.re around 0 47.6%
+-commutative47.6%
unpow247.6%
unpow247.6%
hypot-def82.1%
hypot-def47.6%
unpow247.6%
unpow247.6%
+-commutative47.6%
unpow247.6%
unpow247.6%
hypot-def82.1%
Simplified82.1%
if 4.99999999999999972e118 < y.im < 4.39999999999999973e163Initial program 20.1%
Simplified41.4%
Taylor expanded in y.im around 0 87.0%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* y.re (log (hypot x.re x.im))) (* (atan2 x.im x.re) y.im)))))
(if (or (<= y.re -7.5e-149) (and (not (<= y.re 5e-69)) (<= y.re 8.2e+17)))
(* t_0 (sin (* y.re (atan2 x.im x.re))))
(* 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(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((y_46_re <= -7.5e-149) || (!(y_46_re <= 5e-69) && (y_46_re <= 8.2e+17))) {
tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * 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 t_0 = Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((y_46_re <= -7.5e-149) || (!(y_46_re <= 5e-69) && (y_46_re <= 8.2e+17))) {
tmp = t_0 * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * 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): t_0 = math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if (y_46_re <= -7.5e-149) or (not (y_46_re <= 5e-69) and (y_46_re <= 8.2e+17)): tmp = t_0 * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 * 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) t_0 = exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if ((y_46_re <= -7.5e-149) || (!(y_46_re <= 5e-69) && (y_46_re <= 8.2e+17))) tmp = Float64(t_0 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * 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) t_0 = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im))); tmp = 0.0; if ((y_46_re <= -7.5e-149) || (~((y_46_re <= 5e-69)) && (y_46_re <= 8.2e+17))) tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = t_0 * 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_] := Block[{t$95$0 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -7.5e-149], And[N[Not[LessEqual[y$46$re, 5e-69]], $MachinePrecision], LessEqual[y$46$re, 8.2e+17]]], N[(t$95$0 * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $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(\mathsf{hypot}\left(x.re, x.im\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -7.5 \cdot 10^{-149} \lor \neg \left(y.re \leq 5 \cdot 10^{-69}\right) \land y.re \leq 8.2 \cdot 10^{+17}:\\
\;\;\;\;t_0 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\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.re < -7.49999999999999995e-149 or 5.00000000000000033e-69 < y.re < 8.2e17Initial program 41.6%
Simplified79.9%
Taylor expanded in y.im around 0 81.0%
if -7.49999999999999995e-149 < y.re < 5.00000000000000033e-69 or 8.2e17 < y.re Initial program 41.2%
Simplified77.1%
add-cube-cbrt75.5%
Applied egg-rr75.5%
Taylor expanded in y.re around 0 41.3%
+-commutative41.3%
unpow241.3%
unpow241.3%
hypot-def76.5%
hypot-def41.3%
unpow241.3%
unpow241.3%
+-commutative41.3%
unpow241.3%
unpow241.3%
hypot-def76.5%
Simplified76.5%
Final simplification78.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (log (hypot x.re x.im))))
(if (<= y.im -1.95e+129)
(* (fabs t_0) (exp (* (atan2 x.im x.re) (- y.im))))
(if (or (<= y.im -3.5e+24) (not (<= y.im 350.0)))
(* (exp (- (* y.re t_1) (* (atan2 x.im x.re) y.im))) (sin t_0))
(* (sin (fma t_1 y.im t_0)) (pow (hypot x.re 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_im <= -1.95e+129) {
tmp = fabs(t_0) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if ((y_46_im <= -3.5e+24) || !(y_46_im <= 350.0)) {
tmp = exp(((y_46_re * t_1) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
} else {
tmp = sin(fma(t_1, y_46_im, t_0)) * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_im <= -1.95e+129) tmp = Float64(abs(t_0) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif ((y_46_im <= -3.5e+24) || !(y_46_im <= 350.0)) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)); else tmp = Float64(sin(fma(t_1, y_46_im, t_0)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.95e+129], N[(N[Abs[t$95$0], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, -3.5e+24], N[Not[LessEqual[y$46$im, 350.0]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 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}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -1.95 \cdot 10^{+129}:\\
\;\;\;\;\left|t_0\right| \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.im \leq -3.5 \cdot 10^{+24} \lor \neg \left(y.im \leq 350\right):\\
\;\;\;\;e^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t_0\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -1.9499999999999999e129Initial program 40.6%
Simplified76.2%
Taylor expanded in y.im around 0 67.7%
Taylor expanded in y.re around 0 57.1%
*-commutative57.1%
distribute-rgt-neg-in57.1%
Simplified57.1%
*-commutative57.1%
add-sqr-sqrt35.4%
sqrt-unprod62.5%
pow262.5%
Applied egg-rr62.5%
*-commutative62.5%
unpow262.5%
rem-sqrt-square78.7%
Simplified78.7%
if -1.9499999999999999e129 < y.im < -3.5000000000000002e24 or 350 < y.im Initial program 39.0%
Simplified68.2%
Taylor expanded in y.im around 0 67.6%
if -3.5000000000000002e24 < y.im < 350Initial program 43.5%
exp-diff43.5%
+-rgt-identity43.5%
+-rgt-identity43.5%
exp-to-pow43.5%
hypot-def43.5%
*-commutative43.5%
exp-prod42.9%
fma-def42.9%
hypot-def84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in y.im around 0 86.1%
Final simplification77.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 (log (hypot x.re x.im)))
(t_3 (exp (- (* y.re t_2) (* (atan2 x.im x.re) y.im)))))
(if (<= y.im -1.1e+26)
(* t_3 (fabs t_1))
(if (<= y.im 440.0)
(* (sin (fma t_2 y.im t_0)) (pow (hypot x.re x.im) y.re))
(* 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double t_2 = log(hypot(x_46_re, x_46_im));
double t_3 = exp(((y_46_re * t_2) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_im <= -1.1e+26) {
tmp = t_3 * fabs(t_1);
} else if (y_46_im <= 440.0) {
tmp = sin(fma(t_2, y_46_im, t_0)) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = t_3 * 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 = sin(t_0) t_2 = log(hypot(x_46_re, x_46_im)) t_3 = exp(Float64(Float64(y_46_re * t_2) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_im <= -1.1e+26) tmp = Float64(t_3 * abs(t_1)); elseif (y_46_im <= 440.0) tmp = Float64(sin(fma(t_2, y_46_im, t_0)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64(t_3 * 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[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(y$46$re * t$95$2), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.1e+26], N[(t$95$3 * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 440.0], N[(N[Sin[N[(t$95$2 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * t$95$1), $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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := e^{y.re \cdot t_2 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.1 \cdot 10^{+26}:\\
\;\;\;\;t_3 \cdot \left|t_1\right|\\
\mathbf{elif}\;y.im \leq 440:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_2, y.im, t_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot t_1\\
\end{array}
\end{array}
if y.im < -1.10000000000000004e26Initial program 40.5%
Simplified71.9%
Taylor expanded in y.im around 0 62.8%
add-sqr-sqrt29.4%
sqrt-unprod65.5%
pow265.5%
*-commutative65.5%
Applied egg-rr65.5%
*-commutative65.5%
unpow265.5%
rem-sqrt-square71.1%
Simplified71.1%
if -1.10000000000000004e26 < y.im < 440Initial program 43.1%
exp-diff43.1%
+-rgt-identity43.1%
+-rgt-identity43.1%
exp-to-pow43.1%
hypot-def43.1%
*-commutative43.1%
exp-prod42.5%
fma-def42.5%
hypot-def84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in y.im around 0 85.4%
if 440 < y.im Initial program 38.8%
Simplified69.8%
Taylor expanded in y.im around 0 72.8%
Final simplification78.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (/ -1.0 x.re))))
(if (<= x.re -1.12e-100)
(* (exp (- (* y.re (- t_2)) t_0)) (sin (- t_1 (* y.im t_2))))
(* (exp (- (* y.re (log (hypot x.re x.im))) t_0)) (sin t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -1.12e-100) {
tmp = exp(((y_46_re * -t_2) - t_0)) * sin((t_1 - (y_46_im * t_2)));
} else {
tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * sin(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.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -1.12e-100) {
tmp = Math.exp(((y_46_re * -t_2) - t_0)) * Math.sin((t_1 - (y_46_im * t_2)));
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - t_0)) * Math.sin(t_1);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.log((-1.0 / x_46_re)) tmp = 0 if x_46_re <= -1.12e-100: tmp = math.exp(((y_46_re * -t_2) - t_0)) * math.sin((t_1 - (y_46_im * t_2))) else: tmp = math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - t_0)) * math.sin(t_1) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(Float64(-1.0 / x_46_re)) tmp = 0.0 if (x_46_re <= -1.12e-100) tmp = Float64(exp(Float64(Float64(y_46_re * Float64(-t_2)) - t_0)) * sin(Float64(t_1 - Float64(y_46_im * t_2)))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * sin(t_1)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = log((-1.0 / x_46_re)); tmp = 0.0; if (x_46_re <= -1.12e-100) tmp = exp(((y_46_re * -t_2) - t_0)) * sin((t_1 - (y_46_im * t_2))); else tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * sin(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $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$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -1.12e-100], N[(N[Exp[N[(N[(y$46$re * (-t$95$2)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 - N[(y$46$im * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\frac{-1}{x.re}\right)\\
\mathbf{if}\;x.re \leq -1.12 \cdot 10^{-100}:\\
\;\;\;\;e^{y.re \cdot \left(-t_2\right) - t_0} \cdot \sin \left(t_1 - y.im \cdot t_2\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - t_0} \cdot \sin t_1\\
\end{array}
\end{array}
if x.re < -1.11999999999999996e-100Initial program 39.0%
Simplified82.9%
Taylor expanded in x.re around -inf 81.2%
+-commutative81.2%
mul-1-neg81.2%
*-commutative81.2%
unsub-neg81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in x.re around -inf 80.0%
associate-*r*80.0%
neg-mul-180.0%
Simplified80.0%
if -1.11999999999999996e-100 < x.re Initial program 42.4%
Simplified76.1%
Taylor expanded in y.im around 0 61.0%
Final simplification67.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* y.re (log (hypot x.re x.im))) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re -2.2e-156)
(* t_0 (sin (* y.im (- (log (/ -1.0 x.re))))))
(* t_0 (sin (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -2.2e-156) {
tmp = t_0 * sin((y_46_im * -log((-1.0 / x_46_re))));
} else {
tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= -2.2e-156) {
tmp = t_0 * Math.sin((y_46_im * -Math.log((-1.0 / x_46_re))));
} else {
tmp = t_0 * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if x_46_re <= -2.2e-156: tmp = t_0 * math.sin((y_46_im * -math.log((-1.0 / x_46_re)))) else: tmp = t_0 * math.sin((y_46_re * math.atan2(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(hypot(x_46_re, x_46_im))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= -2.2e-156) tmp = Float64(t_0 * sin(Float64(y_46_im * Float64(-log(Float64(-1.0 / x_46_re)))))); else tmp = Float64(t_0 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im))); tmp = 0.0; if (x_46_re <= -2.2e-156) tmp = t_0 * sin((y_46_im * -log((-1.0 / x_46_re)))); else tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -2.2e-156], N[(t$95$0 * N[Sin[N[(y$46$im * (-N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq -2.2 \cdot 10^{-156}:\\
\;\;\;\;t_0 \cdot \sin \left(y.im \cdot \left(-\log \left(\frac{-1}{x.re}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if x.re < -2.1999999999999999e-156Initial program 43.0%
Simplified81.6%
Taylor expanded in x.re around -inf 79.4%
+-commutative79.4%
mul-1-neg79.4%
*-commutative79.4%
unsub-neg79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.re around 0 74.3%
distribute-lft-neg-in72.1%
Simplified74.3%
if -2.1999999999999999e-156 < x.re Initial program 40.4%
Simplified76.4%
Taylor expanded in y.im around 0 60.7%
Final simplification65.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)) (t_1 (- (log (/ -1.0 x.re)))))
(if (<= x.re -3.2e-100)
(* (exp (- (* y.re t_1) t_0)) (sin (* y.im t_1)))
(*
(exp (- (* y.re (log (hypot x.re x.im))) t_0))
(sin (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = -log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -3.2e-100) {
tmp = exp(((y_46_re * t_1) - t_0)) * sin((y_46_im * t_1));
} else {
tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = -Math.log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -3.2e-100) {
tmp = Math.exp(((y_46_re * t_1) - t_0)) * Math.sin((y_46_im * t_1));
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - t_0)) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = -math.log((-1.0 / x_46_re)) tmp = 0 if x_46_re <= -3.2e-100: tmp = math.exp(((y_46_re * t_1) - t_0)) * math.sin((y_46_im * t_1)) else: tmp = math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - t_0)) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(-log(Float64(-1.0 / x_46_re))) tmp = 0.0 if (x_46_re <= -3.2e-100) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - t_0)) * sin(Float64(y_46_im * t_1))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = -log((-1.0 / x_46_re)); tmp = 0.0; if (x_46_re <= -3.2e-100) tmp = exp(((y_46_re * t_1) - t_0)) * sin((y_46_im * t_1)); else tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = (-N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision])}, If[LessEqual[x$46$re, -3.2e-100], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := -\log \left(\frac{-1}{x.re}\right)\\
\mathbf{if}\;x.re \leq -3.2 \cdot 10^{-100}:\\
\;\;\;\;e^{y.re \cdot t_1 - t_0} \cdot \sin \left(y.im \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - t_0} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if x.re < -3.20000000000000017e-100Initial program 39.0%
Simplified82.9%
Taylor expanded in x.re around -inf 81.2%
+-commutative81.2%
mul-1-neg81.2%
*-commutative81.2%
unsub-neg81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in x.re around -inf 80.0%
associate-*r*80.0%
neg-mul-180.0%
Simplified80.0%
Taylor expanded in y.re around 0 74.2%
distribute-lft-neg-in74.2%
Simplified74.2%
if -3.20000000000000017e-100 < x.re Initial program 42.4%
Simplified76.1%
Taylor expanded in y.im around 0 61.0%
Final simplification65.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)) (t_1 (- (log (/ -1.0 x.re)))))
(if (<= x.re -1e-308)
(* (exp (- (* y.re t_1) t_0)) (sin (* y.im t_1)))
(* (sin (* y.re (atan2 x.im x.re))) (exp (- (* y.re (log 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = -log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -1e-308) {
tmp = exp(((y_46_re * t_1) - t_0)) * sin((y_46_im * t_1));
} else {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_re)) - 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) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = -log(((-1.0d0) / x_46re))
if (x_46re <= (-1d-308)) then
tmp = exp(((y_46re * t_1) - t_0)) * sin((y_46im * t_1))
else
tmp = sin((y_46re * atan2(x_46im, x_46re))) * exp(((y_46re * log(x_46re)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = -Math.log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -1e-308) {
tmp = Math.exp(((y_46_re * t_1) - t_0)) * Math.sin((y_46_im * t_1));
} else {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = -math.log((-1.0 / x_46_re)) tmp = 0 if x_46_re <= -1e-308: tmp = math.exp(((y_46_re * t_1) - t_0)) * math.sin((y_46_im * t_1)) else: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(-log(Float64(-1.0 / x_46_re))) tmp = 0.0 if (x_46_re <= -1e-308) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - t_0)) * sin(Float64(y_46_im * t_1))); else tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * exp(Float64(Float64(y_46_re * log(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 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = -log((-1.0 / x_46_re)); tmp = 0.0; if (x_46_re <= -1e-308) tmp = exp(((y_46_re * t_1) - t_0)) * sin((y_46_im * t_1)); else tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * log(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = (-N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision])}, If[LessEqual[x$46$re, -1e-308], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := -\log \left(\frac{-1}{x.re}\right)\\
\mathbf{if}\;x.re \leq -1 \cdot 10^{-308}:\\
\;\;\;\;e^{y.re \cdot t_1 - t_0} \cdot \sin \left(y.im \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.re - t_0}\\
\end{array}
\end{array}
if x.re < -9.9999999999999991e-309Initial program 42.9%
Simplified80.9%
Taylor expanded in x.re around -inf 76.9%
+-commutative76.9%
mul-1-neg76.9%
*-commutative76.9%
unsub-neg76.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in x.re around -inf 71.3%
associate-*r*71.3%
neg-mul-171.3%
Simplified71.3%
Taylor expanded in y.re around 0 67.3%
distribute-lft-neg-in67.3%
Simplified67.3%
if -9.9999999999999991e-309 < x.re Initial program 39.9%
Simplified76.0%
Taylor expanded in y.im around 0 57.7%
Taylor expanded in x.im around 0 51.9%
*-commutative51.9%
Simplified51.9%
Final simplification59.2%
(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 -0.00126) (not (<= y.re 6e-10)))
(* (sin t_0) (pow (hypot x.im x.re) y.re))
(* t_0 (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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -0.00126) || !(y_46_re <= 6e-10)) {
tmp = sin(t_0) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -0.00126) || !(y_46_re <= 6e-10)) {
tmp = Math.sin(t_0) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * 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 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_re <= -0.00126) or not (y_46_re <= 6e-10): tmp = math.sin(t_0) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * 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(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -0.00126) || !(y_46_re <= 6e-10)) tmp = Float64(sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-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 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_re <= -0.00126) || ~((y_46_re <= 6e-10))) tmp = sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0 * 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -0.00126], N[Not[LessEqual[y$46$re, 6e-10]], $MachinePrecision]], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -0.00126 \lor \neg \left(y.re \leq 6 \cdot 10^{-10}\right):\\
\;\;\;\;\sin t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -0.00126000000000000005 or 6e-10 < y.re Initial program 36.1%
Simplified73.7%
Taylor expanded in y.im around 0 73.0%
Taylor expanded in y.im around 0 67.1%
*-commutative67.1%
unpow267.1%
unpow267.1%
hypot-def67.9%
Simplified67.9%
if -0.00126000000000000005 < y.re < 6e-10Initial program 47.0%
Simplified83.3%
Taylor expanded in y.im around 0 52.5%
Taylor expanded in y.re around 0 52.5%
*-commutative52.5%
distribute-rgt-neg-in52.5%
Simplified52.5%
Final simplification60.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (* y.re (atan2 x.im x.re)) (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) {
return (y_46_re * atan2(x_46_im, x_46_re)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
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)) * exp((atan2(x_46im, x_46re) * -y_46im))
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)) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
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.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))
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)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) 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)) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}
\end{array}
Initial program 41.3%
Simplified78.3%
Taylor expanded in y.im around 0 63.1%
Taylor expanded in y.re around 0 38.2%
*-commutative38.2%
distribute-rgt-neg-in38.2%
Simplified38.2%
Final simplification38.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (* y.re (atan2 x.im x.re)) (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) {
return (y_46_re * atan2(x_46_im, x_46_re)) * exp((atan2(x_46_im, x_46_re) * y_46_im));
}
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)) * exp((atan2(x_46im, x_46re) * y_46im))
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)) * Math.exp((Math.atan2(x_46_im, x_46_re) * y_46_im));
}
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.exp((math.atan2(x_46_im, x_46_re) * y_46_im))
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)) * exp(Float64(atan(x_46_im, x_46_re) * y_46_im))) 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)) * exp((atan2(x_46_im, x_46_re) * y_46_im)); 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}
\end{array}
Initial program 41.3%
Simplified78.3%
Taylor expanded in y.im around 0 63.1%
Taylor expanded in y.re around 0 38.2%
*-commutative38.2%
distribute-rgt-neg-in38.2%
Simplified38.2%
expm1-log1p-u17.4%
expm1-udef17.4%
add-sqr-sqrt9.0%
sqrt-unprod14.4%
sqr-neg14.4%
sqrt-unprod5.9%
add-sqr-sqrt10.3%
Applied egg-rr10.3%
expm1-def10.3%
expm1-log1p13.7%
*-commutative13.7%
Simplified13.7%
Final simplification13.7%
herbie shell --seed 2023171
(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)))))