[PATCH] remove duplicated functions from EFUPXS

5 views
Skip to first unread message

Qian Yun

unread,
Jun 10, 2026, 7:08:58 AM (3 days ago) Jun 10
to fricas-devel
I have verified from the generated lsp file that these
4 functions are not called. They are overwritten by
functions defined later in the source file.

- Qian

diff --git a/src/algebra/efupxs.spad b/src/algebra/efupxs.spad
index 0d44b27a..34ed64f4 100644
--- a/src/algebra/efupxs.spad
+++ b/src/algebra/efupxs.spad
@@ -153,12 +153,8 @@
cothIfCan upxs == applyIfCan(cothIfCan, upxs)
sechIfCan upxs == applyIfCan(sechIfCan, upxs)
cschIfCan upxs == applyIfCan(cschIfCan, upxs)
- asinhIfCan upxs == applyIfCan(asinhIfCan, upxs)
- acoshIfCan upxs == applyIfCan(acoshIfCan, upxs)
atanhIfCan upxs == applyIfCan(atanhIfCan, upxs)
acothIfCan upxs == applyIfCan(acothIfCan, upxs)
- asechIfCan upxs == applyIfCan(asechIfCan, upxs)
- acschIfCan upxs == applyIfCan(acschIfCan, upxs)

import from Fraction(Integer)

Waldek Hebisch

unread,
Jun 10, 2026, 5:27:56 PM (2 days ago) Jun 10
to fricas...@googlegroups.com
On Wed, Jun 10, 2026 at 07:08:53PM +0800, Qian Yun wrote:
> I have verified from the generated lsp file that these
> 4 functions are not called. They are overwritten by
> functions defined later in the source file.

Right, those 4 versions should not be used. But is seems that
there are other troubles related to those functions, like:

uP := UPXS(EXPR(INT), z, 0)
acsc(1/sin(z::uP))

>> Error detected within library code:
acsc of function with singularity

I am not sure if you want to look at this deeper. If not just commit
this fix.

> diff --git a/src/algebra/efupxs.spad b/src/algebra/efupxs.spad
> index 0d44b27a..34ed64f4 100644
> --- a/src/algebra/efupxs.spad
> +++ b/src/algebra/efupxs.spad
> @@ -153,12 +153,8 @@
> cothIfCan upxs == applyIfCan(cothIfCan, upxs)
> sechIfCan upxs == applyIfCan(sechIfCan, upxs)
> cschIfCan upxs == applyIfCan(cschIfCan, upxs)
> - asinhIfCan upxs == applyIfCan(asinhIfCan, upxs)
> - acoshIfCan upxs == applyIfCan(acoshIfCan, upxs)
> atanhIfCan upxs == applyIfCan(atanhIfCan, upxs)
> acothIfCan upxs == applyIfCan(acothIfCan, upxs)
> - asechIfCan upxs == applyIfCan(asechIfCan, upxs)
> - acschIfCan upxs == applyIfCan(acschIfCan, upxs)
>
> import from Fraction(Integer)
>
> --
> You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/fricas-devel/e795410d-3ead-49bb-a8f6-e9aca55e8154%40gmail.com.

--
Waldek Hebisch

Qian Yun

unread,
Jun 10, 2026, 7:16:50 PM (2 days ago) Jun 10
to fricas...@googlegroups.com
On 6/11/26 5:27 AM, Waldek Hebisch wrote:
> On Wed, Jun 10, 2026 at 07:08:53PM +0800, Qian Yun wrote:
>> I have verified from the generated lsp file that these
>> 4 functions are not called. They are overwritten by
>> functions defined later in the source file.
>
> Right, those 4 versions should not be used. But is seems that
> there are other troubles related to those functions, like:
>
> uP := UPXS(EXPR(INT), z, 0)
> acsc(1/sin(z::uP))
>
> >> Error detected within library code:
> acsc of function with singularity
>
> I am not sure if you want to look at this deeper. If not just commit
> this fix.
>
Is it related that at z=0, the function value need to be computed
via limit?

- Qian

Waldek Hebisch

unread,
Jun 10, 2026, 7:50:02 PM (2 days ago) Jun 10
to fricas...@googlegroups.com
There is loose connection. But main thing is that various special
definition of power series operations try to compute result when
it makes sense, even if naive definition fails. We have
'csc(y) = 1/sin(y)' so to compute 'acsc(z)' we essentially should
do 'asin(1/z)' which leads to quite different conditions than
current code.

I actually started looking at this because normally we prefer
general definition othere special cases. So why we need special
'acoshIfCan'? We need it because we need special version
of 'acosh' to correctly handle things like 'acosh(1 + z)' (which
needs square root). Such special handling is needed for most
of inverse trigonometric functions and most of inverse hyperbolic
functions. And then I noticed that condition in 'acsc' and
few others looks fishy.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages