X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=check%2Fexam_inifcns.cpp;h=994aa3444d6cf6e16ed2fd321897a433d3de4f17;hb=4e1e7c6547dafc0b0f8695f9eced2591ae816a31;hp=9c014a14b701e79c320afe2626ca91daf6b96151;hpb=1602530f716ba1d425a0667b897182b99c374823;p=ginac.git diff --git a/check/exam_inifcns.cpp b/check/exam_inifcns.cpp index 9c014a14..994aa344 100644 --- a/check/exam_inifcns.cpp +++ b/check/exam_inifcns.cpp @@ -4,7 +4,7 @@ * functions. */ /* - * GiNaC Copyright (C) 1999-2009 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2011 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ using namespace std; static unsigned inifcns_consist_trans() { using GiNaC::asin; using GiNaC::acos; + using GiNaC::asinh; using GiNaC::acosh; using GiNaC::atanh; unsigned result = 0; symbol x("x"); @@ -124,6 +125,7 @@ static unsigned inifcns_consist_trans() * exists in closed form and check if it's ok. */ static unsigned inifcns_consist_gamma() { + using GiNaC::tgamma; unsigned result = 0; ex e; @@ -170,6 +172,7 @@ static unsigned inifcns_consist_gamma() static unsigned inifcns_consist_psi() { using GiNaC::log; + using GiNaC::tgamma; unsigned result = 0; symbol x; @@ -216,11 +219,35 @@ static unsigned inifcns_consist_zeta() return result; } +static unsigned inifcns_consist_abs() +{ + unsigned result = 0; + realsymbol a("a"), b("b"), x("x"), y("y"); + possymbol p("p"); + + if (!abs(exp(x+I*y)).eval().is_equal(exp(x))) + ++result; + + 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; + + if (!abs(pow(x+I*y,a)).eval().is_equal(pow(abs(x+I*y),a))) + ++result; + + // it is not necessary a simplification if the following is really evaluated + if (!abs(pow(x+I*y,a+I*b)).eval().is_equal(abs(pow(x+I*y,a+I*b)))) + ++result; + +} + static unsigned inifcns_consist_various() { unsigned result = 0; symbol n; - ex e; if ( binomial(n, 0) != 1 ) { clog << "ERROR: binomial(n,0) != 1" << endl; @@ -240,6 +267,7 @@ unsigned exam_inifcns() result += inifcns_consist_gamma(); cout << '.' << flush; result += inifcns_consist_psi(); cout << '.' << flush; result += inifcns_consist_zeta(); cout << '.' << flush; + result += inifcns_consist_abs(); cout << '.' << flush; result += inifcns_consist_various(); cout << '.' << flush; return result;