Help for this page
if ( $y[i] <= $y ) { if ( $y < $y[$j] ) { ... # the same process .. }
if ( ( $y[$i] - $y ) * ( $y - $y[$j] ) > 0 ) { # process