Opened 11 years ago

Closed 11 years ago

# very simple basic sqrt simplification totally broken

Reported by: Owned by: was burcin blocker sage-4.3.4 basic arithmetic robertwb, mhansen sage-4.3.4.rc0 Burcin Erocal Mike Hansen N/A

### Description

```sage: a = 3/4
sage: b = a^(-1/2)
sage: b^2
12
```

But it should be 4/3.

Reported by Paul Nelson, a grad student at Caltech.

### comment:1 Changed 11 years ago by was

This serious bug is present in sage-4.0, but not in 3.4.2, so it was caused in the switch to Pynac.

### comment:2 Changed 11 years ago by jason

Even earlier than the square:

```sage: (3/4)^(-1/2)
6*sqrt(1/3)
sage: n((.75)^(-1/2))
1.15470053837925
sage: n(6*sqrt(1/3))
3.46410161513775
```

### comment:3 Changed 11 years ago by burcin

During the push for the switch, some code was added to simplify these cases (where the base and exponent are rational, but the result is not exact) further than what ginac can do. See `sage.rings.rational.rational_power_parts` for example.

I am taking a look at this right now, but I don't have much time, so I can't promise any results.

### comment:4 Changed 11 years ago by burcin

• Authors set to Burcin Erocal
• Component changed from symbolics to basic arithmetic
• Status changed from new to needs_review
• Summary changed from ** BLOCKER ** very simple basic sqrt simplification totally broken bad to very simple basic sqrt simplification totally broken

attachment:trac_8540-rational_power.patch fixes the problem, please review.

### comment:5 Changed 11 years ago by mhansen

• Reviewers set to Mike Hansen
• Status changed from needs_review to positive_review

Looks good.

### comment:6 Changed 11 years ago by mvngu

• Merged in set to sage-4.3.4.rc0
• Resolution set to fixed
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.