HP Forums
Integral crash - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Integral crash (/thread-19385.html)



Integral crash - Albert Chan - 01-06-2023 04:18 PM

∫(sec(x), x = 0 .. pi/6) = gd-1(pi/6) = asinh(tan(pi/6)) ≈ 0.549306

However, when I try to "fold" it, XCas crashes.

XCas> 2*cos(pi/12)* ∫(cos(pi/12-x) / (cos(x)*cos(pi/6-x)), x = 0 .. pi/12)

Tested on XCas 1.9.0-22 (win32)      → CRASH

Interestingly, XCas 1.5.0-63 (win32) (old version), does not have problem with this.

I wonder if latest HP Prime, with code based from XCas, will fail too ...


RE: Integral crash - rawi - 01-06-2023 05:11 PM

I tried the original formula as well as the "folded" formula with the physical calculator (G1 and G2, both version 2.1.14603 from Dec. 2021) and all worked quite well. If you put a decimal point after each number you immediately get the result 0.549306, if you do not, you get a strange expression but if you evaluate it you get the same result.
So there seems to be no problem with the physical calculators and the software version from Dec. 2021.


RE: Integral crash - Albert Chan - 01-06-2023 06:31 PM

Thanks rawi,

That narrowed down the bug from Dec 2021 to Sep 2022 (latest XCas 1.9.0-22)

while we are at it, there is an annoying bug, which old XCas 1.5.0 does not have.

XCas> plot([sin(x), cos(x)], x = 0 .. 2*pi, color=[blue, red])
XCas> plot([sin(x), cos(x)], x = 0 .. 2*pi, legend=["sin", "cos"])

1st plot, both curves are drawn in blue
2nd plot, both curves have legend ["sin"

To make the curves match color/legend, we have to put both in.

XCas> plot([sin(x), cos(x)], x = 0 .. 2*pi, color=[blue,red], legend=["sin", "cos"])


RE: Integral crash - parisse - 01-06-2023 06:53 PM

1.9.0-31 is the latest version, and the integral is correct there.
I'll have a look at plot ASAP. I made changes so that plot can guess a parametric plot as argument, this might be the reason. If you run plotfunc instead that should work.


RE: Integral crash - Albert Chan - 01-06-2023 08:17 PM

Hi, parisse

I downloaded XCas 1.9.0-31 (mingw), it work! Thanks!
XCas 32-bits version is still 1.9.0-22 though (when will it catch up 64-bits versions?)

Bonus, result is a lot less messy than expected

XCas> 2*cos(pi/12)* ∫(cos(pi/12-x) / (cos(x)*cos(pi/6-x)), x = 0 .. pi/12)

\(\displaystyle -
\frac{\left(\sqrt{2}+\sqrt{6}\right) \left(-\sqrt{2} \ln \left(\frac{\sqrt{2}}{2}\right)+\sqrt{2} \ln \left(\frac{\sqrt{6}}{2}\right)+\sqrt{6} \ln \left(\frac{\sqrt{2}}{2}\right)-\sqrt{6} \ln \left(\frac{\sqrt{6}}{2}\right)\right)}
{4}\)

XCas> simplify(ans())      → (-ln(2)+ln(6))/2
XCas> simplify(ans())      → ln(3)/2

Also, plotfunc for plot fixed the color/legend issues.
What is the difference between the two?


RE: Integral crash - Albert Chan - 01-06-2023 10:18 PM

Latest XCas version 1.9.0-31, changed string default color.
It went from "Hello, world" to "Hello, world"

I tried cfg color menu, but there does not seems to a way to switch it back.


RE: Integral crash - Albert Chan - 01-08-2023 07:45 PM

XCas 1.9.0.31 (mingw), if I run anything, say 1 Enter

Ctrl-Q (to quit), Enter, escape, Enter, escape

I get this repeated message, and the system hang.

*** bug in PARI/GP (Segmentation Fault), please report ***


RE: Integral crash - parisse - 01-08-2023 10:10 PM

Indeed, this will be fixed in 1.9.0-37.
(BTW, you should probably create an account on Xcas forum to report that kind of bugs)