Fibonacci sequence by recursive algorithm fail
04-21-2015, 04:00 PM
Post: #11
 DrD Senior Member Posts: 1,133 Joined: Feb 2014
RE: Fibonacci sequence by recursive algorithm fail
(04-21-2015 02:20 PM)compsystems Wrote:
(04-21-2015 01:57 PM)DrD Wrote:  I think a case could be made that a CAS program is not a good construct for this kind of algorithm. Personally, I think that CAS programs are better suited for CAS exclusive purposes (remaining within the CAS environment).

Just to use one type CAS program if the output is symbolic is obligatory, if only numerical output is optional

For example the following code can not code as HOME program

Code:
#CAS      printSymbolic Algebraic ():=      BEGIN          // versión 0.0.1 April 14 2015 for HP-Prime by compSystems          print; //© Clear Terminal Window (I/O)          print( "hpPrime Terminal View, Symbolic Algebraic Printing" );          print( "" );          print( "Expr1:" ); f(x):=x^3-2*x^2+1*x-1;          print( x^3-2*x^2+1*x-1 );          print( f(x) );                    print( "" );          print( "Expr2:" );          print( x^3-2*x^2+1*x-1 | x=y );          print( f(y) );                    print( "" );          print( "Press any key to continue" ); freeze; wait;          print( "Expr3:" ); g(x):=1/(x+3);          print( g(x) );                    print( "Expr4:" );          print( "f(g(x))=" );          print( f(g(x)) );                    print( "g(f(x))=" );          print( g(f(x)) );                     print( "Expr4:");          print( (x^4-x^3-6*x^2+11*x-6)/x^6+(x^3-6*x^2+11*x-6 | x=y) );          return "Done"      END;  #end

For me it is not completely clear what you are trying to do. However, I synthesized your larger program into just this fragment, which (I think) is what you may be asserting, and it IS in HOME mode. The general idea is interaction with string / expression / number. You can accomplish the rest of your program with similar workflow:

Code:
 EXPORT Algy() BEGIN   local x:=3;  //  Just making an example here // versión 0.0.1 April 14 2015 for HP-Prime by compSystems     print(); //© Clear Terminal Window (I/O)   print("hpPrime Terminal View, Symbolic Algebraic Printing");   print("");   //  <<  Cut larger portion of your program to only Expr1 fragment >>   //  <<  You can build on this theme, if it is suitable.                      >>   //  <<  I think this may be the general idea you're after(?)            >>   Expr1:="x^3-2*x^2+1*x-1";    print(Expr1+ " "+" = "+EXPR(Expr1));  // EXPR is in help doc's   //  Of course, you can perform ANY defined operation(s), the above is just an example.   return "Done"; END;
 « Next Oldest | Next Newest »

 Messages In This Thread Fibonacci sequence by recursive algorithm fail - compsystems - 04-20-2015, 06:42 PM RE: Fibonacci sequence by recursive algorithm fail - Tim Wessman - 04-20-2015, 07:57 PM RE: Fibonacci sequence by recursive algorithm fail - Gerald H - 04-21-2015, 05:49 AM RE: Fibonacci sequence by recursive algorithm fail - compsystems - 04-20-2015, 09:26 PM RE: Fibonacci sequence by recursive algorithm fail - Didier Lachieze - 04-20-2015, 09:58 PM RE: Fibonacci sequence by recursive algorithm fail - Bill_G - 04-20-2015, 11:45 PM RE: Fibonacci sequence by recursive algorithm fail - Gerald H - 04-21-2015, 05:13 AM RE: Fibonacci sequence by recursive algorithm fail - brickviking - 10-04-2015, 09:10 PM RE: Fibonacci sequence by recursive algorithm fail - Alberto Candel - 04-21-2015, 12:25 AM RE: Fibonacci sequence by recursive algorithm fail - DrD - 04-21-2015, 01:57 PM RE: Fibonacci sequence by recursive algorithm fail - Joe Horn - 04-22-2015, 02:37 AM RE: Fibonacci sequence by recursive algorithm fail - Marcus von Cube - 04-22-2015, 10:20 AM RE: Fibonacci sequence by recursive algorithm fail - compsystems - 04-21-2015, 02:20 PM RE: Fibonacci sequence by recursive algorithm fail - DrD - 04-21-2015 04:00 PM RE: Fibonacci sequence by recursive algorithm fail - DrD - 04-22-2015, 12:41 PM RE: Fibonacci sequence by recursive algorithm fail - compsystems - 04-23-2015, 02:21 AM RE: Fibonacci sequence by recursive algorithm fail - parisse - 04-23-2015, 06:44 AM RE: Fibonacci sequence by recursive algorithm fail - compsystems - 04-23-2015, 02:09 PM RE: Fibonacci sequence by recursive algorithm fail - parisse - 04-23-2015, 06:58 PM RE: Fibonacci sequence by recursive algorithm fail - compsystems - 04-24-2015, 08:37 PM RE: Fibonacci sequence by recursive algorithm fail - parisse - 04-25-2015, 06:12 AM RE: Fibonacci sequence by recursive algorithm fail - MikeOShea - 10-04-2015, 05:33 AM RE: Fibonacci sequence by recursive algorithm fail - cyrille de brébisson - 10-05-2015, 06:03 AM RE: Fibonacci sequence by recursive algorithm fail - parisse - 10-05-2015, 11:23 AM

User(s) browsing this thread: 1 Guest(s)