function for cubic equation fcc
function for cubic equation Sc