In my code I have a function, F, that depends on several parameters, say a,b,c: F(a,b,c). I need to give a grid of values to a,b and c to obtain the value of F.
My grid of values are decimal numbers. For example, a goes from 0.99 to -0.99 at intervals of 0.1. Same for b and c.
Problem: when I use say a=0.95 I obtain a different result than for a=95/100.
Here is a specific example where it matters:
F>= 0 always (mathematically this is true)
F(95/100,85/100,75/100)=0 (this I can easily prove mathematically)
BUT when I use decimal numbers instead I get
I don't know if this is relevant, but one case where I detected this issue is when I use the Log function:
I have that F(0.2,0.4,0.5)=1. while F(2/10,4/10,5/10)=1 Thus, when I use decimals I get Log(1.)<0 but Log(1)=0 for when I use fractions
I've been reading a lot on mathematica precision and the difference between having 1. vs 1
What I'm asking from you is a suggestion on how to keep using decimals and getting the proper answer.