cancel
Showing results for 
Search instead for 
Did you mean: 
Magnus512
Level 3
55 34 0 2
Message 1 of 7
1,201
Flag Post

Solved!

Simplify and trigsimplify function HP Prime

HP Recommended
HP Prime

The simplify functions are related to XCAS software ? Can you implement the trigsimplify function ?

0 Kudos
Tags (1)
6 REPLIES 6
Tim_Wessman
Level 8
Level 8
747 744 121 187
Message 2 of 7
Flag Post
HP Recommended

I am not sure what you are requesting. Basically all the rewriting/simplification commands availiable are already included in Prime.

TW

Although I work for the HP calculator group as a head developer of the HP Prime, the views and opinions I post here are my own.
0 Kudos
Magnus512
Author
Level 3
55 34 0 2
Message 3 of 7
Flag Post
HP Recommended

I'm just saying that if XCAS is not being develped by you just implemented, and if we have the lastest version of xcas, why we don't have all the CAS commands aviable, just that 🙂 

0 Kudos
Tim_Wessman
Level 8
Level 8
747 744 121 187
Message 4 of 7
Flag Post
HP Recommended

Licensing - that code is not licensed for our use as it currently stands. Take a look at the xcode source.

 

That being said, all that is really happening is "try a bunch of already existing commands and see if one looks "shorter" then others". Would take me about 5 minutes to make my own, but that is not a priority at the moment.

 

 

 

 

 // find simplest between some trig simplifications, by Luka Marohnić
  gen _trigsimplify(const gen & g,GIAC_CONTEXT) {
    if (g.type==_STRNG && g.subtype==-1) return g;
    vecteur can(1,_simplify(g,contextptr));
    can.push_back(_texpand(can.back(),contextptr));
    can.push_back(_tcollect(can.back(),contextptr));
    for (int i=1;i<3;++i) {
        can.push_back(_trigtan(can[i],contextptr));
        can.push_back(_trigsin(can[i],contextptr));
        can.push_back(_trigcos(can[i],contextptr));
        can.push_back(_tlin(can[i],contextptr));
    }
    int n=can.size();
    for (int i=0;i<n;++i) {
        can.push_back(_tcollect(can[i],contextptr));
    }
    n=can.size();
    for (int i=0;i<n;++i) {
        can.push_back(_trigtan(can[i],contextptr));
    }
    gen simplest=g;
    int len=taille(g,0);
    for (const_iterateur it=can.begin();it!=can.end();++it) {
        int c=taille(*it,len);
        if (c<len) {
            simplest=*it;
            len=c;
        }
    }
    return simplest;
  }
  static const char _trigsimplify_s []="trigsimplify";
  static define_unary_function_eval (__trigsimplify,&_trigsimplify,_trigsimplify_s);
  define_unary_function_ptr5(at_trigsimplify,alias_at_trigsimplify,&__trigsimplify,0,true)

TW

Although I work for the HP calculator group as a head developer of the HP Prime, the views and opinions I post here are my own.
0 Kudos
Tags (1)
Magnus512
Author
Level 3
55 34 0 2
Message 5 of 7
Flag Post
HP Recommended

I get it, so you are using free software for your calculator but you can't implement the code because the license, and because there are other priorities.

0 Kudos
Tim_Wessman
Level 8
Level 8
747 744 121 187
Message 6 of 7
Flag Post
HP Recommended

Correct esentially.

 

There are parts of xcas that cannot be used due to either GPL licensing and the nature of the embedded firmware of Prime, unknown licensing, or that there simply isn't time to document and test them because they are such limited value for the return. 

 

This is an example of a command that really isn't doing anything "smart" and simply doing a brute force "is it shorter" check to determin if it is "simpler". Mathematically it isn't simplified in that sense and doesn't have a real definition. 

TW

Although I work for the HP calculator group as a head developer of the HP Prime, the views and opinions I post here are my own.
Magnus512
Author
Level 3
55 34 0 2
Message 7 of 7
Flag Post
HP Recommended

So any plans to have CAS and Home settings separate ? 

0 Kudos
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation