MATLAB precision
I do have a general precision floating point arithmetic toolbox in MATLAB, that does not require the symbolic toolbox. It is available on the File Exchange now. As an example, in 200 digits of precision...
>> X = hpf('1.2',200)
X =
1.2
>> X^723 - 2
ans =
1770275636625441478440184064843963160282702377364043536065.674784028
335311702907341138106304578079399191891193908698215227428501441099262538
4031886249461115861966367898404170725299823585166135087107488
If you wish to do all of your arithmetic in 200 digits of precision when HPF numbers are employed, then just specify that as the default.
>> DefaultNumberOfDigits 200
>> hpf('pi')
ans =
3.141592653589793238462643383279502884197169399375105820974944592307
816406286208998628034825342117067982148086513282306647093844609550582231
7253594081284811174502841027019385211055596446229489549303819
HPF is not a true variable precision tool by design since it works in a fixed number of digits. It is reasonably efficient up to a few tens of thousands of digits. So to get 100 digits of exp(pi), this takes about 1/4 of a second.
>> timeit(@() exp(hpf('pi',100)))
ans =
0.2643
Trig functions too. Here 1000 digits of the sin(pi). It should be zero of course.
>> tic,sin(hpf('pi',1000)),toc
ans =
0
Elapsed time is 0.201679 seconds.
You can perform variable-precision arithmetic using the Symbolic Math Toolbox in MATLAB. You should get nearly the same precision as a quadruple precision floating-point number if you use 34
as the number of significant digits for the vpa
function.
If you don't have access to the Symbolic Math Toolbox, I would check out the submission "Multiple Precision Toolbox for MATLAB" from Ben Barrowes on the MathWorks File Exchange.
Multiprecision Computing Toolbox for MATLAB has fast quadruple precision mode.
In particular, it is able to compute eigenvalues & vectors of 100 x 100 matrix by x70-x100 times faster than Symbolic Math Toolbox (using same quadruple precision).
See Fast Quadruple Precision Computations in MATLAB page for comparisons and details.
Besides suggested alternatives - Symbolic Math Toolbox and Ben Barrowes's library both have significant limitations, see my answer here.