%% Faster Calculations of Jacobi Elliptic Integrals by Changing Tolerance
% The default value of tol is eps. Find the run time with the default value for arbitrary M using tic and toc. Increase tol by a factor of 1000 and find the run time. Compare the run times.

tic
ellipj(0.253,0.937)
toc
tic
ellipj(0.253,0.937,eps*1000)
toc

% ellipj runs significantly faster when tolerance is significantly increased.
% Copyright 2015 The MathWorks, Inc.