Fix scalar_logistic_function overflow for complex inputs.
For complex inputs, direct comparison to inf
often fails for large
inputs because (inf + inf*j) != (inf + 0*j)
. We instead need to
extract the real value and compare that to inf
.
Updated the array_cwise test to catch this issue.