Result of asind changed between R2016b and R2019b
1 view (last 30 days)
Show older comments
I noticed that the result of the 'asind' function changed slightly for some input values when I upgraded from R2016b to R2019b.
For example, in R2016b:
>> format long
>> asind(0.7)
ans =
44.427004000805702
In R2019b:
>> format long
>> asind(0.7)
ans =
44.427004000805695
I realize this is a tiny difference, but I didn't expect it. I searched the release notes for everything between these versions and didn't find anything relevant. Did I overlook something, or does behavior like this change from version to version without mention?
0 Comments
Accepted Answer
Steven Lord
on 19 May 2020
I'm not 100% certain offhand but I suspect this is related to the change in sind and cosd in release R2019a described in bug report 1839169.
More Answers (1)
James Tursa
on 19 May 2020
Edited: James Tursa
on 19 May 2020
This is a bit strange. I would have expected the later version to be better, but it appears to be worse:
>> version -release
ans =
'2017b'
>> double(asind(vpa(0.7)))
ans =
44.427004000805702 % Symbolic Toolbox answer converted to double
>> asind(0.7)
ans =
44.427004000805702 % Double function agrees
>> sind(ans)-0.7
ans =
0 % Matches desired result to last bit
But for the later version:
>> version -release
ans =
'2019b'
>> double(asind(vpa(0.7)))
ans =
44.427004000805702 % Symbolic Toolbox answer converted to double
>> asind(0.7)
ans =
44.427004000805695 % Double function does not agree
>> sind(ans)-0.7
ans =
-1.110223024625157e-16 % Does not match desired result to last bit
That bug report indicates the "fix" for the exact degree cases is to use R2019a or later, but these results seem to indicate that the later version is not the better one for this isolated example. Maybe in a wide range of testing the later version is better overall. Maybe to get the "exact" degree cases to come out as desired there were side effects for other cases. I don't know what the story is here as I haven't looked into it in any depth.
Maybe drop another note to the technical team ...
2 Comments
See Also
Categories
Find more on Trigonometry in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!