re #10642 Added an optional Dideal parameter and adjusted formula