Consider the following 3 lines of code:
Reduce[1. Log[3 - x] + 2. Log[1 + x] == 2.1972245773362196, x]
Reduce[1. Log[3 - x] + 2. Log[1 + x] == 2.1972245773362196 && x < 2, x]
Reduce[1. Log[3 - x] + 2. Log[1 + x] == 2.19722 && x < 2, x]
Which give the following output (and warning about exact representation which I have not included here)
Reduce[1. Log[3 - x] + 2. Log[1 + x] == 2.19722, x]
x == 1.30278 || x == 2.
x == 1.30276
Is there something I can change so that these give results that are more in line?
- I am particularly interested in making the 2nd the the third agree (since x==2 does not satisfy x<2)
I realize this is likely an issue of precision. My difficulty is that the numbers (1.,2.,2.19722...) are coming from earlier parts of code (i.e. I am not manually entering such numbers).
Perhaps if I tell mathematica to work with a certain level of precision (somehow keep it exact, or maybe use SetPrecision?) the discrepancy will be resolved?
- If so, is there I way I can tell mathematica to set precision locally (only for part of my notebook)?