Make a function quad_sol() that solves a given quadratic equation. For example, to solve \[2x^2+5x-3=0,\] the function takes three coefficients \(2\), \(5\), and \(-3\) and quad_sol(2, 5, -3) should return the roots \(0.5\) and \(-3\). Make sure that quad_sol(a, b, c) can take care of the case when \(a = 0\) (where the given equation is in fact linear). Also quad_sol should be able to handle the cases of imaginary roots and double root by returning a sentence like No real roots and There is a double root 2. Some examples follow:
quad_sol(1, 2, 1)
## [1] "There is a double root -1"
quad_sol(2, 5, -3)
## [1] "There are two real roots 0.5 and -3"
quad_sol(2, 5, 13)
## [1] "No real roots"
quad_sol(0, 3, 11)
## [1] "It has a single root -3.66666666666667"
quad_sol(0, 3, 0)
## [1] "It has a single root 0"
quad_sol(0, 0, 1)
## [1] "No solutions"