]> www.ginac.de Git - ginac.git/commitdiff
Add test cases for improved abs(arg).
authorRichard Kreckel <kreckel@ginac.de>
Thu, 23 Apr 2015 20:33:52 +0000 (22:33 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Thu, 23 Apr 2015 20:33:52 +0000 (22:33 +0200)
Exam the evaluations abs(Âħsqrt(p)) -> sqrt(p) for p > 0.

check/exam_inifcns.cpp

index a0acb2de8af183d1f1094b06c7d9f506e5c37b6b..bd7168ed704f328ffd774794d80ea913d22df392 100644 (file)
@@ -232,6 +232,12 @@ static unsigned inifcns_consist_abs()
        if (!abs(pow(p,a+I*b)).eval().is_equal(pow(p,a)))
                ++result;
 
        if (!abs(pow(p,a+I*b)).eval().is_equal(pow(p,a)))
                ++result;
 
+       if (!abs(sqrt(p)).eval().is_equal(sqrt(p)))
+               ++result;
+
+       if (!abs(-sqrt(p)).eval().is_equal(sqrt(p)))
+               ++result;
+
        // also checks that abs(p)=p
        if (!abs(pow(p,a+I*b)).eval().is_equal(pow(p,a)))
                ++result;
        // also checks that abs(p)=p
        if (!abs(pow(p,a+I*b)).eval().is_equal(pow(p,a)))
                ++result;