- inifcns_trans.cpp: Added rules for atan(+/-1).
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Sun, 29 Oct 2000 18:15:51 +0000 (18:15 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Sun, 29 Oct 2000 18:15:51 +0000 (18:15 +0000)
ginac/inifcns_trans.cpp

index 734c0ecb945fa1aecb0e19fbfb8d0527bc787610..a66be1785de8c085b629593f8c76fcce30addd98 100644 (file)
@@ -583,13 +583,19 @@ static ex atan_eval(const ex & x)
                // atan(0) -> 0
                if (x.is_equal(_ex0()))
                        return _ex0();
+               // atan(1) -> Pi/4
+               if (x.is_equal(_ex1()))
+                       return _ex1_4()*Pi;
+               // atan(-1) -> -Pi/4
+               if (x.is_equal(_ex_1()))
+                       return _ex_1_4()*Pi;
                // atan(float) -> float
                if (!x.info(info_flags::crational))
                        return atan_evalf(x);
        }
        
        return atan(x).hold();
-}    
+}
 
 static ex atan_deriv(const ex & x, unsigned deriv_param)
 {