+ 1

Two expressions are equal, but in GNU Octave it says thay are not equal, what is problem here?

This is text from Octave comand prompt: octave:7> power(cos(x/2),2) ans = 0.9045 octave:8> (tan(x)+sin(x))/(2*tan(x)) ans = 0.9045 octave:9> power(cos(x/2),2)==(tan(x)+sin(x))/(2*tan(x)) ans = 0

3rd Sep 2021, 8:35 PM
MPolo
MPolo - avatar
2 Respuestas
3rd Sep 2021, 10:46 PM
Simon Sauter
Simon Sauter - avatar
+ 1
Mathematically speaking, the two functions are not the same: the domain of the first is all R, while the domain of the second excludes the points x = pi/2+k*pi for all k in Z Because of the tan(x) at the denominator You could say the second is a restriction of the first ... Or it could be a floating-point approximation issue
3rd Sep 2021, 10:43 PM
Angelo
Angelo - avatar