0 Members and 2 Guests are viewing this topic.
:A→B
:#Axiom(CPLXMATH) .varA could be complex:Select("varA")→Select("varB") .Select( is in the 2nd List Ops menu:solve() .optional but suggested, frees used memory
:A+B→C
:#Axiom(CPLXMATH) .varA or varB could be complex:solve(ᵀ+,Select("varA"),Select("varB"))→Select("varC") .solve( is on the Math Math menu:solve() .optional, but suggested - frees used memory
:L₁∗A→L₂
:#Axiom(CPLXMATH) .L₁ or L₂ could be complex lists:solve(ᵀ∗,Select("L₁"),Select("varA"))→Select("L₂"):solve() .optional but suggested, frees used memory
:L₁(42)‒A→L₂(42)
:#Axiom(CPLXMATH) ... see above:solve(ᵀ‒,Select("L₁",42),Select("varA"))→Select("L₂",42):solve() ... see above
:42→dim(L₁)
:#Axiom(CPLXMATH) ...you know:dim("L₁",42) .notice the slight difference in syntax
:{5,5}→dim([A]):For(A,1,5):For(B,1,5):10A+B→[A](A,B):End:End
:#Axiom(REALMATH) .only real numbers used AND no arbitrary variable access:Buff(9)→GDB1 .a temp floating point - they are 9 bytes large:dim("[A]",5,5):For(A,1,5) .remember, A and B are still Axe variables:For(B,1,5):A∗10+B→float{GDB1} .load temp with A∗10+B converted to a floating point:GDB1→Select("[A]",A,B) .see, I didn't forget matrix support:solve() .especially important inside loops:End:End
:#Axiom(REALMATH) .see above:"[A]"→Str1:[008100000000000000]→GDB1 .floating point zero, prepared for 2 digit numbers:dim(Str1,5,5):For(A,1,5):For(B,1,5):A∗16+B→{GDB1+2} .A and B are between 0 and 10 exclusive, treat as bcd digits:GDB1→Select(Str1,A,B):End:solve() .delete temp memory at least moderately often (~100 bytes at this point!):End
:(-B+√(B²‒4AC))/(2A)→C:(-B‒√(B²‒4AC))/(2A)→D
:#Axiom(CPLXMATH) .obviously:Buff(9)→GDB2 .declare constants:Buff(9)→GDB4:2→float{GDB2} .initialize constants:4→float{GDB4}:solve(ᵀ/,solve(ᵀ+,solve(ᵀ-,Select("varB")),solve(ᵀ√(,solve(ᵀ‒,solve(ᵀ²,Select("varB")),solve(ᵀ∗,GDB4,solve(ᵀ∗,Select("varA"),Select("varB")))))),solve(ᵀ∗,GDB2,Select("varA")))→Select("varC"):solve():solve(ᵀ/,solve(ᵀ‒,solve(ᵀ-,Select("varB")),solve(ᵀ√(,solve(ᵀ‒,solve(ᵀ²,Select("varB")),solve(ᵀ∗,GDB4,solve(ᵀ∗,Select("varA"),Select("varB")))))),solve(ᵀ∗,GDB2,Select("varA")))→Select("varC"):solve()
:#Axiom(CPLXMATH) .obviously:Buff(9)→GDB2 .declare constants:Buff(9)→GDB4:2→float{GDB2} .initialize constants:4→float{GDB4}:Select("varA")→A .yes you can do that:Select("varB")→B:Select("varC")→C:solve(ᵀ√(,solve(ᵀ‒,solve(ᵀ²,B),solve(ᵀ∗,GDB4,solve(ᵀ∗,A,C))))→D:solve(ᵀ-,B)→B .pre-calculate stuff:solve(ᵀ∗,GDB2,A)→A:solve(ᵀ/,solve(ᵀ+,B,D),A)→Select("varD"):solve(ᵀ/,solve(ᵀ‒,B,D),A)→Select("varE"):solve()
:(-B+{1,-1}√(B²+i²4AC))/(2A)
:#Axiom(CPLXMATH):[015D]"TEMP"→Str1LT .[015D] must be used instead of the ᴸ before a list in the current version of Axe:[0C80200000000000000C8000000000000000]→GDB2 .still 2, but complex:[0C80400000000000000C8000000000000000]→GDB4 .complex floating point 4:Select("varA")→A:Select("varB")→B:Select("varC")→C:solve(ᵀ√(,solve(ᵀ‒,solve(ᵀ²,B),solve(ᵀ∗,GDB4,solve(ᵀ∗,A,C))))→C .we don't need C anymore:solve(ᵀ-,B)→B .pre-calculate stuff:solve(ᵀ∗,GDB2,A)→A:DelVar Str1LT .Delete ᴸTemp in case it already exists:solve(ᵀ/,solve(ᵀ+,B,C),A)→Select(Str1LT,1):solve(ᵀ/,solve(ᵀ‒,B,C),A)→Select(Str1LT,2):Select(Str1LT)→Select("varAns") .yep, that's right:DelVar Str1LT .no one needs ᴸTemp anymore:solve() .we are done
Unfortunately, you cannot re-define current Axe tokens in Axioms which is why you're getting that error, you can only overwrite unused tokens.
Perhaps I should release the routine I made to convert a string to a real and store it in a real var, so it would make this even easier to use this library, as it doesn't require knowledge of the FP format.
Quote from: FinaleTI on October 25, 2011, 07:51:21 pmPerhaps I should release the routine I made to convert a string to a real and store it in a real var, so it would make this even easier to use this library, as it doesn't require knowledge of the FP format.This Axiom doesn't either, does it?
* Qwerty.55 checks the posting dateI was planning on asking for help with floating point in Axe tonight. Awesome timing.