#85 no exact result sin(%pi/12)

open
nobody
None
5
2010-08-21
2010-07-17
Anonymous
No

Maxima doesn't count exact result of sin(%pi/12) or cos(%pi/12), etc. despite the fact it's simple. It is (sqrt(3)-1)/2*sqrt(2) - or (in other form): (sqrt(6)-sqrt(2))/4.

Discussion

  • Raymond Toy
    Raymond Toy
    2010-07-17

    This is really a feature request, not a bug.

    Having said that, I have some code to handle this and other cases like %pi/3/2^m and %pi/5/2^m.

     

  • Anonymous
    2010-08-10

    There is also a problem in numerical evaluation of sin(%pi/6) and cos(%pi/3):

    (%i1) sin(%pi/6),numer;
    (%o1) .4999999999999999
    (%i2) cos(%pi/3),numer;
    (%o2) .5000000000000001

    Why aren't they 0.5? It is not a big error, but it should be fixed

     
  • Raymond Toy
    Raymond Toy
    2010-08-10

    They are not exactly 0.5 because of the way they're computed. %pi/6 and %pi/3 are converted to double-floats and the Lisp function cl:sin and cl:cos are called to compute the result.

    Try float(sin(%pi/6)) and float(cos(%pi/3)). These return exactly 0.5 because maxima simplifies sin(%pi/6) to 1/2, and float converts that to a float.

     

  • Anonymous
    2010-08-11

    Thank you!

     
  • Dieter Kaiser
    Dieter Kaiser
    2010-08-21

    • labels: 871857 -->
     
  • Dieter Kaiser
    Dieter Kaiser
    2010-08-21

    As written in a posting in this thread, this is a feature request.
    Moving this bug report to the tracker "feature requests".
    Dieter Kaiser