This question is best suited for the Computational Science site. However, there are a few points you should think about.
First, the integration range is the intersection of (-oo, -eV-gap) U (-eV+gap, +oo) and (-oo, -gap) U (gap, +oo) . Two cases are possible:
- if
eV < 2*gap , then the permissible energy values are in (-oo, -eV-gap) U (gap, +oo) ; - if
eV > 2*gap , then the permissible energy values are in (-oo, -eV-gap) U (-eV+gap, -gap) U (gap, +oo) .
Secondly, you work in an area with very low temperatures. At t equal to 0.02 K, the denominator in the Boltzmann factor is 1.7 meV, and the energy gap is 400 meV. In this case, the exponent is huge for positive energies and soon goes beyond the double-precision floating-point numbers used by Python. Since this is the minimum positive energy possible, things will not improve at higher energies. At negative energies, the value will always be very close to zero. Note that at this temperature, the Fermi-Dirac distribution has a very sharp edge and resembles the reflected theta function. At E = gap you will have exp(E/kT) approximately 6.24E + 100. You can go out of range if E/kT > 709.78 or E > 3.06*gap .
Nevertheless, it makes no sense to go to such energies, since at this temperature the difference between the two Fermi functions very quickly becomes zero outside the interval
[-eV, 0] , which completely falls inside the gap for a given temperature, when
V < (2*gap)/e (0.8 mV). Therefore, one would expect that the current would be very close to zero when the bias voltage is less than 0.8 mV. When it is greater than 0.8 mV, then the main value of the integral would be obtained from the integrand in
(-eV+gap, -gap) , although some nonzero value would come from the region near the singularity at the point
E = gap , and some singularity at
E = -eV-gap . You should not avoid features in DoS, otherwise you will not get the expected gaps (vertical lines) on curve I (V) (image taken from
Wikipedia ):

Rather, you should get equivalent approximate expressions in the neighborhood of each feature and integrate them instead.
As you can see, there are many special cases for the value of the integrand, and you must consider all of them when calculating numerically. If you do not want to do this, you should probably refer to another mathematical package, such as Maple or Mathematica. They have much more complex numerical integration procedures and can directly process your formula.
Please note that this is not an attempt to answer your question, but rather a very long comment that does not fit in any comment field.