I have the following values for x[[i]]
, y[[i]]
and A[[i,j]]
:
x[[1]] = 4/5
x[[2]] = 31/39
y[[1]] = 2/5
y[[2]] = 145/357
A[[1,1]] = 62243/100000
A[[1,2]] = 3239/6250
A[[1,3]] = 17631/25000
I want to compute the value of an expression, specifically
A[[1, 3]] - A[[1, 1]]*x[[i]] - A[[1, 2]]*y[[i]]
So what I do is:
For[i = 1, i < 3, i++,
error[[i]] = N[A[[1, 3]] - A[[1, 1]]*x[[i]] - A[[1, 2]]*y[[i]], 100];
]
error
So I get:
error[[1]] = 0
error[[2]] = -1.6871363930187...1687*10^-6
.
But this is wrong since the correct result for the 1st loop is error[[1]] = -27/2500
. The strange thing here is that if I compute (5*17361 - 62243 - 8*3239) / 125000
, which is practically the same operation, I get the correct result. What can I do to get the correct result? I used the N
with precision of 100 digits, but obviously it is not working, FullForm
neither.