Friday, 5 February 2016

Graphing Mode - Tablet

TLCalc V1.19.0 introduced full tablet support for graphing and table view of plots. It basically combines the screens of FX Manager, Plot view and Table view into one screen (or one of plot and table view if screen space is limited). This mode is only available on Android tablets with OS version 4.2 or higher.


The tablet mode arranges the FX Manager on the left hand side and the plot and table view on the right. Plots are added by pressing the [+] button. Once you have completed modifying the plot, tap on the card header to close the card. Closing the card applies the changes and the plot and table will update to show the updated plot (provided the plot data is valid). The buttons at the top can be used to hide the table or plot like so:


Plot + FX Manager view (table hidden)




Table + FX Manager view (plot hidden)




Plot + table + FX Manager view (unavailable on smaller tablets)


Apart from this, the behaviour is exact same as phone mode.

It should be intuitive enough to play around although a more detailed guide for phone mode is available here.


Saturday, 9 January 2016

Improved Answer Accuracy

When you try to reuse an answer from past calculations, TLCalc will first check to see if the answer was stored internally, and if not, TLCalc will reconstruct the value from the text. Restoring the value from text is less accurate as the internal values are stored with more decimal places than the text form. The text it reconstructs from is actually the text you see so the lower you set the number of decimal places to format in settings, the larger the rounding error when reusing past values (if the values aren't stored internally). Note that this does not affect variables and the insert ANS command which are always stored internally.

Storing the answers internally increases memory usage so 3 modes are offered:
  • Store no answers: no answers are stored and consequently has minimal memory usage. This is the only mode available pre V1.19.0.
  • Store constants only: only store answers if they evaluate to a constant like 2+3i. Values like matrices and expressions (2x) are not stored. This is the default mode. 
  • Store all answers: all answers are stored.

The retain answer mode setting is found the Main Calculator Settings screen

Note that if you reduce the type of answers to retain such as from Store all answers to Store constants only, the internal answers are not cleared from memory until you exit and restart the app. Once the answers are removed though, the loss is permanent and only the values available by reconstructing from text becomes available.

Extra info: when you tap on a history item to toggle between rectangular and polar output, you can test whether the answer is stored internally or not. If the answer is stored internally, toggling the output type will retain the answer in black. If the answer is not stored internally, the text once toggled goes grey. When toggling answers without the internal value available, you may notice the value deviate from the original value significantly if you cycle many times. In the image below, the retain answer mode is store constants only and so 2x is not stored internally and greyed out after toggling.

Tuesday, 5 January 2016

TLCalc Intersection Finder Limitations

You don't need to read this in order to use the intersection finding capability of TLCalc but you might be interested in some of the quirky behaviour or inner workings of it.

TLCalc offers the unique feature of being able to find intersections between functions, polar plots, parametric plots and even between plots of different types, but there are some limitations. These limitations are that:

  • it runs fairly slowly (the search is done in the background so it's less noticeable)
  • it has medium accuracy (expect 5-9 significant figures)
  • it has low stability (if you move the plots around, you will notice that some intersections get missed out, even if they were found earlier) and
  • plots which come very close together (closer than 0.00001) may be mistaken as intersections.

The limitations are due to algorithm which must optimise two independent and non-linear variables and I haven't found a good way to do this yet. Despite these limitations, the current one does reasonably well and you can find pretty much any intersection between different plots if you don't need super high accuracy and if you spend a second panning the plot around until the intersection you want gets picked up.

In V1.19.0, an intersection finder was added specifically for functions. This finder was the old finder from V1.15.1 which was much faster, more accurate and had much better stability than the generic finder (expect at least 9 significant figures of accuracy and zero misses). This finder replaces the generic finder when the intersection is between two functions which are in terms of the same variables. I.e. finding the intersections between f(x) and f(y) will use the generic finder with less accuracy. The obvious limitation is that the finder from V1.15.1 only works for functions.

You may be wondering whether implicit plots and statistical plots will be included in the future. Intersection of statistical plots is useless for all but the line and scatter plot, but even then, it doesn't really make any sense (intersection between discrete and continuous data is not something that is normally required). The implicit plot is also not available because I haven't found a way to do this yet. I haven't even implemented a way to do tracing of implicit plots (this is another 2 variable optimisation problem except this time I don't have a slope that is dependent on a single variable to work with which means my current algorithm is useless for this task).

Wednesday, 30 December 2015

TLCalc Hamburger Menu

The main calculator menu was getting rather crowded so the navigation options have now been moved to the hamburger menu.

    

The 3 dashes icon on the top left is used to open the hamburger menu (alternatively, you can swipe from the left).

You can now adjust the angle mode anywhere using the angle mode toggle. The angle mode is RAD when on and DEG when off (the labels don't fit in the Android Lollipop themed switches so unfortunately you'll have to remember this).

The different modes of TLCalc can be switched between easily by tapping on the mode you would like to use. You can also add a short-cut to your home screen to directly access that mode by tapping on the bookmark icon.

Note: TLScript is still in development and is not intended for use although you can play around with it if you wish.

Wednesday, 14 October 2015

Order of Operations

Brackets ( and ) are used for grouping expressions and changing the order of operation. This calculator evaluates the expression following the rules of BODMAS (Wikipedia link).

The specific order of operation for TLCalc is defined as below:
  1. Brackets: (, [ 
  2. Negate (-) 
  3. Angle (@), factorial (!) and Exponential (E)
  4. Power (^)
  5. Permutation (nPr) and combination (nCr)
  6. Multiplication (*), division (/) and modulus (%)
  7. Addition (+) and subtraction (-) (or negate if first term)
  8. Comparators (>, >=, <, <=)
  9. Equality (==, !=)
  10. AND (&&)
  11. OR (||), XOR (|^) and IMPLIES (=>)
Items with higher priority are evaluated first with items on the same level being evaluated from left to right. E.g. 2^3nPr2%3 = ((2^3)nPr2)%3 .

Tip: Always use brackets if in doubt.

WARNING: The order of operation was drastically changed in V1.18.0. The changes were made to make TLCalc more closely reflect the order of operations used in other calculators and programming languages such as C and Java. Note that in all versions, BODMAS is always adhered to.

Technical extra for those that are curious:
You may notice that the minus sign (-) is located in 2 places in the order of operations list. The parse will parse the '-' sign with lowest priority first. For example:
  -2^2 is interpreted as -(2^2) because negate has a lower priority (of 7) than power (4) while
  --2^2 is interpreted as -((-2)^2) since the first minus is parsed under priority 7 (like before) and the second is parsed under priority 2. The second minus is applied only to the 2 because the second minus has higher priority than power so the second minus is applied before the power and the power is applied before the first minus.   Confusing? Use brackets and you won't be.

Monday, 7 September 2015

Custom Functions

In the Insert dialog (press [fx...] when in main calculator mode), tap on [Add FX...].



Fill in the details. Tap on [?] to obtain more information about each field.

[Add FX] will create the function.

Custom functions are used just like any other functions.

Tap on [x] in the Insert dialog to remove unwanted custom functions.

Custom functions can also be created using the fxdef command.

Calculator Precision

A tolerance of ± 0.005 is used when determining how close a value is to an integer. I.e. 3.001! = 6 but 3.008! = NaN. The same tolerance is also used for comparisons. I.e. 3.034>=3.037 = 1  and 3.034==3.037 = 1 since they are within 0.005 of each other thus they are considered equal to each other.

You can bypass this behaviour for comparisons by multiplying the input by a large value such as 1E9 to ensure deviations are pushed outside tolerances. Make sure the result is within the range of a double which is (2 - 2-52) * 21023.

The tolerance is currently set at compile time and cannot be adjusted.