On 8/25/08, Andrej Vodopivec <andrej.vodopivec at gmail.com> wrote:
> I think this is a bugfix. I now have a patch which changes this:
>
> (%i2) asin(sin(x));
> (%o2) x
> (%i3) asin(sin(10));
> (%o3) 10
> (%i4) asin(sin(10.0));
> (%o4) -.5752220392306202
> (%i5) asin(cos(%pi^2));
> (%o5) asin(cos(%pi^2))
>
> into
>
> (%i1) asin(sin(x));
> (%o1) asin(sin(x))
> (%i2) asin(sin(10));
> (%o2) 3*%pi-10
> (%i3) asin(sin(10.0));
> (%o3) -.5752220392306202
> (%i4) float(%o2);
> (%o4) -.5752220392306207
> (%i5) asin(cos(%pi^2));
> (%o5) %pi^2-(7*%pi)/2
>
> In the first example %o2 and %o3 are wrong because triginverses is set to all.
OK by me to commit the patch. Disclaimer: I haven't thought too hard about this.
As always, please include test cases.
Does the asin(sin(x)) attempt to consult the asksign database?
It would be nice to see
assume(-%pi <= x, x <= %pi); asin(sin(x)); => x
best
Robert Dodier