[GiNaC-list] Simplification in GiNaC

abpetrov abpetrov at ufacom.ru
Fri Jan 6 17:52:32 CET 2017

       I recently wrote a simple program to learn some calculations
with GiNaC. This works, But I got some expression which automatically don't become simple. 
The question is:
What is the simplest way to get the expected answer - Ax here?

Best regards Petrov A.B.
Output for program:

Starting: ./test2
*** Exited normally ***



#include <iostream>
using namespace std;

using namespace GiNaC;

void calc_example(){
  realsymbol A("A"),m("m"),x("x");
  ex e = sqrt(A*m*pow(x,2))*sqrt(A/m);
  cout << e  << endl;

int main(int argc, char** argv)
	return 0;

More information about the GiNaC-list mailing list