Result of asind changed between R2016b and R2019b

1 Ansicht (letzte 30 Tage)
Michael
Michael am 19 Mai 2020
Kommentiert: Michael am 19 Mai 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?

Akzeptierte Antwort

Steven Lord
Steven Lord am 19 Mai 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 Kommentar
Michael
Michael am 19 Mai 2020
That does look like a plausible cause for this change. Thank you for pointing that out.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

James Tursa
James Tursa am 19 Mai 2020
Bearbeitet: James Tursa am 19 Mai 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 Kommentare
Walter Roberson
Walter Roberson am 19 Mai 2020
Maple says 44.4270040008057037
Michael
Michael am 19 Mai 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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Trigonometry finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by