various bugs

Bugs

Modérateur : xcasadmin

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

various bugs

Message par lukamar » jeu. juil. 27, 2017 11:07 pm

Hi Bernard,

I've noticed few bugs in the current version of Xcas (stable branch), which are listed below.

1. When I try to solve limit in Example 61 in http://math.cmu.edu/~bkell/lhopital.pdf using the command

Code : Tout sélectionner

assume(a>0); limit((sqrt(2*a^3*x-x^4)-a*root(3,a^2*x))/(a-root(4,a*x^3)),x=a)
I get the result 0. But this is wrong, as the correct result should be 16a/9 (which is given by Maxima, for example).

2. The function "plotarea" does not work for straight lines. When I enter, for example, plotarea(x,x=1..2), i get the following error message.

Code : Tout sélectionner

"Project-Id-Version: giac 0.9.0
Report-Msgid-Bugs-To: 
POT-Creation-Date: 2017-07-17 11:09+0200
PO-Revision-Date: 2010-06-30 10:24+0200
Last-Translator: parisse <bernard.parisse@ujf-grenoble.fr>
Language-Team: English
Language: 
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Plural-Forms: nplurals=2; plural=(n != 1);
 Error: Bad Argument Value"
3. When I type

Code : Tout sélectionner

%{1,2,3%} minus %{1,2,3%}
I get the correct answer %{NULL%}, i.e. the empty set. But when I type

Code : Tout sélectionner

%{cos(k*pi/6-pi/3)$(k=1..100)%} minus %{cos(k*pi/6+pi/3)$(k=1..100)%}
I get a set containing 1, which is incorrect (the above sets should be equal).

4. The function "plotinequation" sometimes does not fill the resulting area although it is expected to do so. For example, a circle will be filled only if its radius is not an integer. The command

Code : Tout sélectionner

plotinequation(x^2+y^2<=3)
works fine, but the command

Code : Tout sélectionner

plotinequation(x^2+y^2<=4)
only outlines the solution.

5. The unit prefix "micro" is not working.

6. (This is maybe not a bug). When I define F:=Int(x^2,x), I get integral of x^2, as expected ("Int" is an inert function). But when F is part of some subsequent command, the integral gets evaluated, for example when I try to do variable substitution with "subs". It would be nice to get unevaluated integral to show the result of the substitution. Is it possible somehow?

parisse
Messages : 4901
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: various bugs

Message par parisse » lun. juil. 31, 2017 7:09 am

lukamar a écrit :Hi Bernard,

I've noticed few bugs in the current version of Xcas (stable branch), which are listed below.

1. When I try to solve limit in Example 61 in http://math.cmu.edu/~bkell/lhopital.pdf using the command

Code : Tout sélectionner

assume(a>0); limit((sqrt(2*a^3*x-x^4)-a*root(3,a^2*x))/(a-root(4,a*x^3)),x=a)
I get the result 0. But this is wrong, as the correct result should be 16a/9 (which is given by Maxima, for example).
This is a problem of 0 recognition after substitution of x by a the system does not see that the denominator is 0, it requires some simplifications: in theory I could run simplify but then I would not be able to solve some other tests because it would take too long. I can probably fix this one if the change does not have side effects (my regression tests are ok, but perhaps geogebra regression tests will not pass), but I won't be able to fix all examples of that kind.
2. The function "plotarea" does not work for straight lines. When I enter, for example, plotarea(x,x=1..2), i get the following error message.

Code : Tout sélectionner

"Project-Id-Version: giac 0.9.0
Report-Msgid-Bugs-To: 
POT-Creation-Date: 2017-07-17 11:09+0200
PO-Revision-Date: 2010-06-30 10:24+0200
Last-Translator: parisse <bernard.parisse@ujf-grenoble.fr>
Language-Team: English
Language: 
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Plural-Forms: nplurals=2; plural=(n != 1);
 Error: Bad Argument Value"
Fixed in source. The bug occured because there is code in plot to detect lines.
3. When I type

Code : Tout sélectionner

%{1,2,3%} minus %{1,2,3%}
I get the correct answer %{NULL%}, i.e. the empty set. But when I type

Code : Tout sélectionner

%{cos(k*pi/6-pi/3)$(k=1..100)%} minus %{cos(k*pi/6+pi/3)$(k=1..100)%}
I get a set containing 1, which is incorrect (the above sets should be equal).
Fixed. That was because cos(2*pi/6-pi/3) was not immediatly recognized to be 1.
4. The function "plotinequation" sometimes does not fill the resulting area although it is expected to do so. For example, a circle will be filled only if its radius is not an integer. The command

Code : Tout sélectionner

plotinequation(x^2+y^2<=3)
works fine, but the command

Code : Tout sélectionner

plotinequation(x^2+y^2<=4)
only outlines the solution.
Seems to be related to <= tests, if I modify the default discretization (xmax->xmax*(1+1e-6)) it works, I will do that because I don't want to introduce bugs by modifying the tests.
5. The unit prefix "micro" is not working.
Indeed, but I have no idea how to fix that. Replacing micro by µ does not work.
6. (This is maybe not a bug). When I define F:=Int(x^2,x), I get integral of x^2, as expected ("Int" is an inert function). But when F is part of some subsequent command, the integral gets evaluated, for example when I try to do variable substitution with "subs". It would be nice to get unevaluated integral to show the result of the substitution. Is it possible somehow?
Yes, by preventing further evaluation of F with eval, for example subst(eval(F,1),x=t^2)

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: various bugs

Message par lukamar » lun. juil. 31, 2017 7:44 pm

Great! Thank you for the fixes.
parisse a écrit :Indeed, but I have no idea how to fix that. Replacing micro by µ does not work.
The only constructive idea I have to offer is to use letter 'u'. It's as close as it gets...
parisse a écrit :Yes, by preventing further evaluation of F with eval, for example subst(eval(F,1),x=t^2)
Thanks for the tip!

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: various bugs

Message par lukamar » jeu. déc. 28, 2017 1:05 pm

Maybe replacing letter µ in prog.cc (at 2 places total) with "\u03BC" would help to recognize "micro" prefix? I suspect an encoding problem... can't test it myself as I have problems with compiling Giac on my system.

parisse
Messages : 4901
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: various bugs

Message par parisse » jeu. déc. 28, 2017 8:11 pm

Seems to work, thanks!

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: various bugs

Message par lukamar » sam. déc. 30, 2017 10:55 am

I'm glad that it worked. The unit scaling system is finally fully functional :)
Some constants are highlighted and mentioned in the documentation, but they does not seem to be defined: _twopi_, _angl_, _I0_ and _q_. Last one can be obtained approximately with mksa(1/(_kq_/_k_)), however.
What's the problem with _degreeF, it is commented out in the code?

Répondre