return NAN on gamma failure