login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Evaluation may lead to spurious division by zero. This problem is not limited to FriCAS, in fact it is general mathematical fact which limits what computers (and people) can do. Simplest example is x/x. When we plug in nonzero number for x we get 1. However, plugging in 0 leads to division by 0. So, the expression x/x defines function different from 1, namely 0 is not in the domain of function defined by x/x. For rational functions we can easily limit the problem by canceling common divisors. FriCAS expression domain is doing this auitomatically:

fricas
(1) -> sin(x)/sin(x)

\label{eq1}1(1)
Type: Expression(Integer)

Even for rational function we may still get into trouble in more complicated situations. Consider x/(x +y). Evaluation this at x = 0, y = 0 in one step, that is as 'eval(x/(x + y), [x = 0, y = 0]?)' leads to division by zero. OTOH evaluating in two steps gives value, but this value depends on order of evaluation, first setting y to 0 we get 1, while first setting x to 0 gives 0:

fricas
eval(x/(x + y), [y = 0])

\label{eq2}1(2)
Type: Fraction(Polynomial(Integer))
fricas
eval(x/(x + y), [x = 0])

\label{eq3}0(3)
Type: Fraction(Polynomial(Integer))

Problem becomes more complicated when we consider algebraic expression. Take differential form dx/\sqrt{x^3 - 1}. This form have no singularities on curve with equation y^2 = x^3 - 1. More precisely, to give well-defined meaning to square root we consider this curve. Then y is square root of x^3 - 1 and our form is dx/y. In (x, y) coordinates we have singularity when y=0 (and another singularity at infinity). However, in different coordinates we can get nonsingular expression at any given point. But we can not get coordinates good for all points: for any fixed coordinate system there will be singular points, even though for any point we can choose coordinate system with no singularity at this point.

Algebraic expressions require care and computations may be tedious, but at least in theory we can avoid division by 0. However, in general it is undecidable if a mathematical expression gives 0 as a value. One approach to this difficulty is to divide only by expressions which are known to be non-zero. Applied naively this would severly limit possible computations. FriCAS uses somewhat different approach: computations are normally done in domains where we can decide if an expression is zero. However, such domain may be different from domain intended by user. For example, in most operations FriCAS treats Dirac delta "function" as transcendental quantity. This allows computations which would make no sense from point of view of analysis. But if final result is sensible (in partucular does not lead to division by Dirac delta), then it is analytically correct.

Similar approach deals with branches of multivalued functions: FriCAS works with algebraic (or transcendental) extentions (fields). If element of an extention is zero, then it is zero under any analytic interpretation (any choice of branches). But specific choices of branches can lead to more equalities. Still, if final result does not lead to division by zero, then it is correct at least for some choice of branches.




  Subject:   Be Bold !!
  ( 15 subscribers )  
Please rate this page: