semi-analytical version