I think I have found a good enough solution:
by using "sign" from ElementaryFunctionSign,
it's already imported by IR2F.

I also find a new problem: IntegrationResult doesn't
even track the independent variable!

diff --git a/src/algebra/irexpand.spad b/src/algebra/irexpand.spad
index 3e1ca4f7..7ed8ea5a 100644
--- a/src/algebra/irexpand.spad
+++ b/src/algebra/irexpand.spad
@@ -104,6 +104,12 @@
 -- they differ by a constant so it's ok to do it from an IR
     tantrick(a, b) ==
       retractIfCan(a)@Union(Q, "failed") case Q => 2 * atan(-b/a)
+      sa := sign a
+      sb := sign b
+      if sa case Z and sb case "failed" then return 2 * atan(-b/a)
+      if sb case Z and sa case "failed" then return 2 * atan(a/b)
+      -- if sa case "failed" and sb case "failed" then
+      --     print("potentially noncontinuous"::OutputForm)
       2 * atan(a/b)

 -- transforms i log((a + i b) / (a - i b)) into a sum of real


On Thu, Feb 2, 2017 at 6:24 PM, oldk1331 <[email protected]> wrote:
> A related problem with continuity:
>
> atan(A/B) and -atan(B/A), they differ by a constant, but
> their continuity is different, if A has no sign change
> (always positive), then it's better to be put in denominator.
> I think function "tantrick" can utilize that.
>
> This is a big source of discontinuity, and my solution
> mentioned in previous post will make many discontinous
> function continous and vice versa, I don't think this
> will be a problem?

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to