bool foo(constdouble a, constdouble b, constdouble g){
return a <= b ?(b - a <= PI && a <= g && g <= b)||(b - a > PI &&(b <= g || g <= a)):(a - b <= PI && b <= g && g <= a)||(a - b > PI &&(a <= g || g <= b));
return l <= g && g <= r || l <= g && r < l || g <= r && r < l;
}
int main(){
cout<< boolalpha <<"Case 1 Pass: "<< bar(PI /4.0, 3.0* PI /4.0, PI /2.0)<<' '<< foo(PI /4.0, 3.0* PI /4.0, PI /2.0)<<' '<< foo(3.0* PI /4.0, PI /4.0, PI /2.0)<< endl;
cout<<"Case 1 Fail: "<< bar(PI /4.0, 3.0* PI /4.0, PI)<<' '<< foo(PI /4.0, 3.0* PI /4.0, PI)<<' '<< foo(3.0* PI /4.0, PI /4.0, PI)<< endl;
cout<<"Case 2 Pass: "<< bar(7.0* PI /4.0, PI /2.0, PI /4.0)<<' '<< foo(7.0* PI /4.0, PI /2.0, PI /4.0)<<' '<< foo(PI /2.0, 7.0* PI /4.0, PI /4.0)<< endl;
cout<<"Case 2 Fail: "<< bar(7.0* PI /4.0, PI /2.0, PI)<<' '<< foo(7.0* PI /4.0, PI /2.0, PI)<<' '<< foo(PI /2.0, 7.0* PI /4.0, PI)<< endl;
cout<<"Case 3 Pass: "<< bar(3.0* PI /2.0, PI /4.0, 7.0* PI /4.0)<<' '<< foo(3.0* PI /2.0, PI /4.0, 7.0* PI /4.0)<<' '<< foo(3.0* PI /2.0, PI /4.0, 7.0* PI /4.0)<< endl;
cout<<"Case 3 Fail: "<< bar(3.0* PI /2.0, PI /4.0, PI)<<' '<< foo(3.0* PI /2.0, PI /4.0, PI)<<' '<< foo(3.0* PI /2.0, PI /4.0, PI)<< endl;