I'm performing a line search as part of a quasi-Newton BFGS algorithm. In one step of the line search I use a cubic interpolation to move closer to the local minimizer.
Let $f : R \rightarrow R, f \in C^1$ be the function of interest. I want to find an $x^*$ such that $f'(x^*) \approx 0$.
Let $f(x_k)$, $f'(x_k)$, $f(x_{k+1})$ and $f'(x_{k+1})$ be known. Also assume $0\le x_k<x^*<x_{k+1}$. I fit a cubic polynomial $Q(x)=ax^3+bx^2+cx+d$ so that $Q(0)=f(x_k)$, $Q'(0)=f'(x_k)$, $Q(x_{k+1}-x_{k})=f(x_{k+1})$ and $Q'(x_{k+1}-x_{k})=f'(x_{k+1})$.
I solve the quadratic equation: $(1): Q'(x^*-x_k) = 0$ for my sought $x^*$ using the closed form solution.
The above works well in most cases, except when $f(x)=\mathcal{O}(x^2)$ as the the closed form solution for $(1)$ divides by $a$ which becomes very close to or exactly $0$.
My solution is to look at $a$ and if it is "too small" simply take the closed form solution for the minimizer of the quadratic polynomial $Q_2(x)=bx^2+cx+d$ for which I already have the coefficients $b,c,d$ from the earlier fit to $Q(x)$.
My question is: How do I devise a good test for when to take the quadratic interpolation over the cubic? The naive approach to test for $a \equiv 0$ is bad due to numerical reasons so I'm looking at $|a| < \epsilon\tau$ where $\epsilon$ is the machine precision, but I'm unable to decide a good $\tau$ that's scale invariant of $f$.
Bonus question: Are there any numerical issues with using the coefficients, $b,c,d$, from the failed cubic fit or should I perform a new quadratic fit with appropriate way of calculating the coefficients?
Edit for clarification: In my question $f$ is actually what is commonly referred to as $\phi(\alpha)=f(\bar{x}_k+\alpha \bar{p_k})$ in literature. I just simplified the question formulation. The optimization problem I'm solving is non-linear in 6 dimensions. And I'm well aware that Wolfe conditions are enough for BFGS line search hence stating that I was interested in $f'(x^*) \approx 0$; I'm looking for something that'll satisfy strong Wolfe conditions and taking the minimizer of the cubic approximation is a good step along the way.
The question was not about BFGS, but rather how to determine when the cubic coefficient is small enough that a quadratic approximation is more appropriate.
Edit 2: Update notation, equations are unchanged.