#20074: QQbar cleaning 2
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.1
      Component:  number fields      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/20074                 |  362a67b966045c2a89192df890a73e87e8354f84
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Description changed by vdelecroix:

Old description:

> We further simplify QQbar code by:
> - using python operator to indentify binary operators instead of strings.
> In other words we replace `'+'` by `operator.add`, `'-'` by
> `operator.sub`, etc
> - writing only one function `binop` instead of `addsub` and `muldiv`.
> - removing the methods `kind`,  `is_exact`, `is_rational`,
> `is_field_element` of descriptors and instead use the class themselves
> - removing the method `rational_value` and directly access the `_value`
> attribute
> - detect unions earlier in the code to avoid constructing `ANBinaryExpr`
>
> As a consequence of the last items, we have exactification detected
> earlier
> {{{
> sage: sqrt17 = QQbar(17).sqrt()
> sage: sqrt19 = QQbar(19).sqrt()
> sage: (sqrt17 + sqrt19).exactify()
> sage: sqrt17 * sqrt19 + sqrt17 - sqrt19 * sqrt17 - sqrt17
> 0
> }}}
> Instead of `0.?e-17` on the current beta. See also the better output in
> doctests from the commit `012ae18`.
>
> follow up: #19955

New description:

 We further simplify QQbar code by:
 - using python operator to indentify binary operators instead of strings.
 In other words we replace `'+'` by `operator.add`, `'-'` by
 `operator.sub`, etc
 - writing only one function `binop` instead of `addsub` and `muldiv`.
 - removing the methods `kind`,  `is_exact`, `is_rational`,
 `is_field_element` of descriptors and instead use the class themselves
 - removing the method `rational_value` and directly access the `_value`
 attribute
 - detect unions earlier in the code to avoid constructing `ANBinaryExpr`

 As a consequence of the last items, we have exactification detected
 earlier
 {{{
 sage: sqrt17 = QQbar(17).sqrt()
 sage: sqrt19 = QQbar(19).sqrt()
 sage: (sqrt17 + sqrt19).exactify()
 sage: sqrt17 * sqrt19 + sqrt17 - sqrt19 * sqrt17 - sqrt17
 0
 }}}
 Instead of `0.?e-17` on the current beta. See also the better output in
 doctests from the commit `7fa8ed4`.

 follow up: #19955

--

--
Ticket URL: <http://trac.sagemath.org/ticket/20074#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to