Остання редакція: 2026-11-18
Анотація
У роботі досліджено проблему втрати точності під час обчислення коренів квадратних рівнянь із використанням арифметики з плаваючою крапкою. Проведено порівняння стандартного та чисельно стійкішого способів обчислення меншого кореня. Для п'яти тестових рівнянь визначено відносні похибки результатів та проаналізовано їхню залежність від значення коефіцієнта. Встановлено, що використання математично еквівалентних формул може призводити до різної точності обчислень. Запропоновано враховувати цю особливість під час тестування програмних реалізацій чисельних алгоритмів.
APPLICATION OF MATHEMATICAL METHODS FOR TESTING COMPUTATIONAL ALGORITHMS
Abstract:
The paper investigates the problem of accuracy loss when calculating the roots of quadratic equations using floating-point arithmetic. A comparison of the standard and a more numerically stable method for calculating the smaller root is performed. Relative errors are determined for five test equations, and their dependence on the coefficient value is analyzed. The results show that mathematically equivalent formulas may produce different computational accuracy. The study proposes taking this feature into account when testing software implementations of numerical algorithms.
Ключові слова
Посилання
1. Stewart D. E. Numerical Analysis: A Graduate Course. Cham: Springer, 2022. URL: https://doi.org/10.1007/978-3-031 08121-7 (дата звернення: 16.11.2026).
2. Yan S., Zhu H. Metamorphic Testing on Scientific Programs for Solving Second-Order Elliptic Differential Equations. Software Testing, Verification and Reliability. Опубліковано онлайн 22 грудня 2024 р. URL: https://doi.org/10.1002/stvr.1912 (дата звернення: 17.11.2026).
3. ISO/IEC/IEEE 60559:2020. Floating-point arithmetic. 2020.
4. Harder D. W. Approximating Solutions to the Quadratic Equation. University of Waterloo, 2025. URL: https://ece.uwaterloo.ca/~dwharder/nm/Lecture_materials/pdfs/ECE_204_6_1_Approximating_solutions_to_the_quadratic_equation. pdf (дата звернення: 17.11.2026).