You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: create_all_precisions.m
    path of file: ./repos/prima/benchmark/rescue_idz/norma/matlab/setup_tools
    
    the code of the file until where you have to start completion: function create_all_precisions(options_or_directory)
%CREATE_ALL_PRECISIONS creates `all_precisions.m` under the directory containing this script
% according to `options_or_directory`. `all_precisions.m` should return a cell array containing
% the names of all the precisions ('double', 'single', 'quadruple') available for the Fortran
% solvers in this package. It is created in the following way.
%
% 0. We assume that 'double' is always available.
%
% 1. If `options_or_directory` is a string, then it will be interpreted as the full path to
% a directory. The return of `all_precisions.m` will reflect the precisions available under this
% directory for ALL the solvers (i.e., the return of `all_solvers()`). The availability is
% determined by `isavailable(directory, precision)`.
%
% 2. If `options_or_directory` is a structure (or empty), then it will be interpreted as compilation
% options. The return of `all_precisions.m` will reflect the precisions available after the compilation.


    
function create_all_precisions(options_or_directory)
%CREATE_ALL_PRECISIONS creates `all_precisions.m` under the directory containing this script
% according to `options_or_directory`. `all_precisions.m` should return a cell array containing
% the names of all the precisions ('double', 'single', 'quadruple') available for the Fortran
% solvers in this package. It is created in the following way.
%
% 0. We assume that 'double' is always available.
%
% 1. If `options_or_directory` is a string, then it will be interpreted as the full path to
% a directory. The return of `all_precisions.m` will reflect the precisions available under this
% directory for ALL the solvers (i.e., the return of `all_solvers()`). The availability is
% determined by `isavailable(directory, precision)`.
%
% 2. If `options_or_directory` is a structure (or empty), then it will be interpreted as compilation
% options. The return of `all_precisions.m` will reflect the precisions available after the compilation.

% Default values for the availability of 'single' and 'quadruple'. They are used only if
% `options_or_directory` is a structure (i.e., it is indeed the compilation options).
single_precision = true;
quadruple_precision = false;

callstack = dbstack;
funname = callstack(1).name; % Name of the current function

% Parse the inputs.

% Move the existing version of `all_precisions.m` to `all_precisions.bak`.
mfiledir = fileparts(mfilename('fullpath'));  % The directory where this file resides.
allprec = 'all_precisions';
allprec_file = fullfile(mfiledir, [allprec, '.m']);
allprec_file_bak = fullfile(mfiledir, [allprec, '.bak']);
if exist(allprec_file_bak, 'file')
    % Remove `allprec_file_bak` if it exists. This is necessary. Otherwise, `allprec_file` may be
    % restored incorrectly in case of failure in the sequel.
    delete(allprec_file_bak);
end