MATLAB Answers

Result of asind changed between R2016b and R2019b

1 view (last 30 days)
Michael
Michael on 19 May 2020
Commented: Michael on 19 May 2020
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

Sign in to comment.

Accepted Answer

Steven Lord
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.

  1 Comment

Michael
Michael on 19 May 2020
That does look like a plausible cause for this change. Thank you for pointing that out.

Sign in to comment.

More Answers (1)

James Tursa
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

Michael
Michael on 19 May 2020
I noticed that there are values which will invert back to their original value exactly in R2016b but not in R2019b, and there are others which invert in R2019b but not in R2016b.
R2019b:
>> y = 0.743148279360506;
>> sind(asind(y)) - y
ans =
0
R2016b:
>> y = 0.743148279360506;
>> sind(asind(y)) - y
ans =
1.110223024625157e-16
And as you pointed out, 0.7 is an example in the other direction.

Sign in to comment.

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!