From 84e6538290cbd2b13b755254c62689a404ce91b4 Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Thu, 23 Apr 2015 22:33:52 +0200 Subject: [PATCH] Add test cases for improved abs(arg). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Exam the evaluations abs(±sqrt(p)) -> sqrt(p) for p > 0. --- check/exam_inifcns.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/check/exam_inifcns.cpp b/check/exam_inifcns.cpp index a0acb2de..bd7168ed 100644 --- a/check/exam_inifcns.cpp +++ b/check/exam_inifcns.cpp @@ -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(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; -- 2.49.0