This question appears nearly identical to your last question but the the truncation (according to your code) being between 1/b and 1/a although your text (as with the previous question) gives the interval being between a and b.
I used 1/b and 1/a because I want to find the reciprocal of truncated exponential distribution. I already found theoretical results of the reciprocal and validated them by numerical examples, but this code is giving me different results.
I appreciate any help.