A time-fractional diffusion equation with variable coefficients and Caputo derivative of order α∈(0,1)\documentclass[12pt]{minimal}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{mathrsfs}
\usepackage{upgreek}
\setlength{\oddsidemargin}{-69pt}
\begin{document}$$\alpha \in (0,1)$$\end{document} is considered. Recently, some S-type, i.e., S1, S2, and S3, formulae have been established with high-order accuracy for approximating the Caputo derivative. These formulas are based on B-splines of degree l with the global (l+1-α)\documentclass[12pt]{minimal}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{mathrsfs}
\usepackage{upgreek}
\setlength{\oddsidemargin}{-69pt}
\begin{document}$$(l+1-\alpha )$$\end{document}-order accuracy. On the other hand, the typical solution of such diffusion equations has weak regularity near the initial time. In this paper, we aim to establish a new finite-difference method based on the transformed S2 discretization, called the S2-FD method, dealing with this singularity of the solution. We analyze the stability and convergence of the proposed S2-FD scheme for some problems with smooth/nonsmooth solutions. We also indicate the stability of the classic S2-FD method for smooth solutions. It is also proved that both have the global convergence of order 3-α\documentclass[12pt]{minimal}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{mathrsfs}
\usepackage{upgreek}
\setlength{\oddsidemargin}{-69pt}
\begin{document}$$3-\alpha $$\end{document}. The obtained results are confirmed by some numerical examples.