Quadratic equations =================== Write and save the following functions into the same file named ``quadratic.py``. #. :py:func:`real_roots` that takes three parameters ``a``, ``b`` and ``c``, corresponding to the coefficients of a quadratic equation :math:`y=ax^2+bx+c` with two different real roots, and returns its roots. See the following examples: .. literalinclude:: quadratic1.txt :language: python3 :lines: 5-8 .. note:: More tests are provided in the :download:`quadratic1.txt` file. #. :py:func:`has_real_roots` that takes three parameters ``a``, ``b`` and ``c``, corresponding to the coefficients of a quadratic equation :math:`y=ax^2+bx+c`, and retuns ``True`` if the quadratic equation has real roots and ``False`` otherwise. See the following examples: .. literalinclude:: quadratic2.txt :language: python3 :lines: 5-8 .. note:: More tests are provided in the :download:`quadratic2.txt` file. #. :py:func:`is_a_root` that takes five parameters ``a``, ``b``, ``c`` corresponding to the coefficients of a quadratic equation :math:`y=ax^2+bx+c`, ``x`` corresponding to a candidate root ``x``, and ``eps`` corresponding to a tolerance. This function returns ``True`` if ``x`` is a root of the quadratic equation taking into account the given tolerance, i. e., when ``abs(y) <= eps``, and ``False`` otherwise. See the following examples: .. literalinclude:: quadratic3.txt :language: python3 :lines: 12-25 .. note:: More tests are provided in the :download:`quadratic3.txt` file. .. rubric:: Solutions A solution of these functions is provided in the :download:`quadratic.py` file.