A method for drilling a borehole penetrating the earth using a drill rig that operates a drill string having a bottomhole assembly disposed thereon, the BHA including a borehole survey sensor, a drilling performance sensor and a lithology sensor, the method characterized by: inputting into a processor (i) drilling parameters as a function of depth used to drill one or more offset boreholes, (ii) rate of penetration as a function of depth using the drilling parameters for the one or more offset boreholes, and (iii) one or more lithologies as a function of depth for the one or more offset boreholes; identifying, using the processor, those drilling parameters that correspond to a rate of penetration that meets or exceeds a selected ROP threshold for each input lithology to provide identified drilling parameters; correlating a borehole plan comprising a borehole path to be drilled and one or more assumed lithologies as a function of depth to the one or more lithologies of the one or more offset boreholes using the processor; sending the identified drilling parameters to a drill rig controller for each of the assumed lithologies in the borehole plan; drilling the borehole with the drill rig using the identified drilling parameters that provide the ROP that meets or exceeds the selected ROP threshold for each of the one or more assumed lithologies in the borehole plan; receiving borehole survey information from the borehole survey sensor, the survey information having a borehole trajectory including depth of the borehole being drilled; cross-checking the lithology assumed in the drilling parameters with the survey information based on depth; and comparing the ROP assumed by the identified drilling parameters to the actual ROP sensed by a drill rig sensor and updating the drilling parameters being used when a difference between the assumed ROP and the actual ROP exceeds a threshold value, wherein the updated drilling parameters are based on a lithology different from the lithology assumed in the borehole plan. inputting into a processor (i) drilling parameters as a function of depth used to drill one or more offset boreholes, (ii) rate of penetration as a function of depth using the drilling parameters for the one or more offset boreholes, and (iii) one or more lithologies as a function of depth for the one or more offset boreholes; identifying, using the processor, those drilling parameters that correspond to a rate of penetration that meets or exceeds a selected ROP threshold for each input lithology to provide identified drilling parameters; correlating a borehole plan comprising a borehole path to be drilled and one or more assumed lithologies as a function of depth to the one or more lithologies of the one or more offset boreholes using the processor; sending the identified drilling parameters to a drill rig controller for each of the assumed lithologies in the borehole plan; drilling the borehole with the drill rig using the identified drilling parameters that provide the ROP that meets or exceeds the selected ROP threshold for each of the one or more assumed lithologies in the borehole plan; receiving borehole survey information from the borehole survey sensor, the survey information having a borehole trajectory including depth of the borehole being drilled; cross-checking the lithology assumed in the drilling parameters with the survey information based on depth; and comparing the ROP assumed by the identified drilling parameters to the actual ROP sensed by a drill rig sensor and updating the drilling parameters being used when a difference between the assumed ROP and the actual ROP exceeds a threshold value, wherein the updated drilling parameters are based on a lithology different from the lithology assumed in the borehole plan.