A C++ equation solver that parses and evaluates mathematical expressions with a single variable (x).
It finds and approximates one root within a given range using scanning and binary search.
Expression Parsing: Supports +, -, *, /, and power (^).
Floating-Point Support: Handles decimal values.
Root Finding: Locates one root within a specified range.
Binary Search: Approximates the root with good precision.
Instead of brute-force search, the project uses the bisection method (binary search on the function range) after detecting a valid interval. Why it’s better:
- Reduces complexity to O(log n) instead of O(n^2)
- Much faster than linear scanning
Before applying bisection, the program scans the range with a fixed step to find a sign change interval. Why it’s better:
- Prevents running binary search on invalid ranges
- Reduces unnecessary function evaluations
- Improves overall efficiency
User enters an equation equal to 0.
User provides a range (l, r).
Program scans the range to find a valid interval.
Binary search is applied to approximate the root.
You can just download the file "fx.exe" and run it