%% Create Symbolic Numbers
% Convert numeric values to symbolic numbers or expressions. Use sym on subexpressions instead of the entire expression for better accuracy. Using sym on entire expressions is inaccurate because MATLAB first converts the expression to a floating-point number, which loses accuracy. sym cannot always recover this lost accuracy.

inaccurate1 = sym(1/1234567)
accurate1 = 1/sym(1234567)
inaccurate2 = sym(sqrt(1234567))
accurate2 = sqrt(sym(1234567))
inaccurate3 = sym(exp(pi))
accurate3 = exp(sym(pi))

%
% Copyright 2019 The MathWorks, Inc.