.is_real() function provides wrong answer
I was trying to find the inflection points of a function by finding the zeros of its second derivative:
f(x) = e^x/(x^2+1)
ddf = diff(df, x, 2)
inflection_points = solve(ddf == 0, x)
show(inflection_points[2])
inflection_points[2].rhs().is_real()
The first two zeros are complex roots. The third root is a real one, and the function .is_real() returns a 'false', as can be seen by executing the above code. The fourth root is correctly found to be real. Is this an error of the function? If no, is there another test that can be performed in order to determine if a number is real?