Skip to content

Commit

Permalink
[giac] fix for rsolve(u(n+2)=3*u(n+1)+2*u(n),u(n),[u(1)=4,u(2)=14])
Browse files Browse the repository at this point in the history
git-svn-id: https://dev.geogebra.org/svn/trunk/geogebra/giac@70115 23ce0884-8a58-47d3-bc5c-ddf1cd5b9f9e
  • Loading branch information
bernard.parisse committed May 16, 2023
1 parent f50ceef commit 3b9a8f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/giac/cpp/csturm.cc
Expand Up @@ -3108,7 +3108,7 @@ void add(mpfr_t & rr,mpfr_t & ri,const gen & Pi,int nbits,long & loss,long & siz

// find r=P(x) and r1=diff(P)(x)
// returns largest number of bits of mantissa in intermediate computations
long horner2_mpfr(const vdbl & P,dbl x,dbl & r,dbl & r1,int nbits,long & size,bool pdiff){
long horner2_mpfr(const vdbl & P,const dbl & x,dbl & r,dbl & r1,int nbits,long & size,bool pdiff){
if (P.empty())
return 0;
long loss=0;
Expand Down Expand Up @@ -3740,7 +3740,7 @@ int aberth_mpfr(const vdbl & P0,bool realpoly,int & nbits,int N,double eps,vdbl
){
for (size_t j=0;j<R.size();++j){
R[j] += dr;
if (!isolate)
if (!isolate && eps>1e-14)
R[j]=evalf_double(R[j],1,contextptr);
}
return 2;
Expand Down
2 changes: 1 addition & 1 deletion src/giac/cpp/solve.cc
Expand Up @@ -4323,7 +4323,7 @@ namespace giac {
vecteur B,R(x);
gen rep;
if (A.size()==2 && x.size()==2){
gen a00=A[0][0];
gen a00=A[0][0]; a00=simplify(a00,contextptr);
if (is_zero(a00,contextptr))
B=makevecteur(A[1],A[0]);
else
Expand Down
2 changes: 1 addition & 1 deletion src/giac/cpp/usual.cc
Expand Up @@ -7564,7 +7564,7 @@ namespace giac {
if (a2.type==_INT_)
return a1.eval(a2.val,contextptr);
a1=eval(a1,eval_level(contextptr),contextptr);
if (a2.type==_STRNG && a2._STRNGptr->size()==4){
if (a1.type==_STRNG && a2.type==_STRNG && a2._STRNGptr->size()==4){
const char * ptr=a2._STRNGptr->c_str();
if (ptr[0]=='a' && ptr[1]=='s' && ptr[2]=='m' && ptr[3]==platform_type && a1.type==_STRNG){
const char * ptr=a1._STRNGptr->c_str();
Expand Down

0 comments on commit 3b9a8f2

Please sign in to comment.