Skip to content

Add half-angle transformations #32389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
EmmanuelCharpentier mannequin opened this issue Aug 17, 2021 · 21 comments · Fixed by #38466
Closed

Add half-angle transformations #32389

EmmanuelCharpentier mannequin opened this issue Aug 17, 2021 · 21 comments · Fixed by #38466

Comments

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Aug 17, 2021

In some circumstances (e.g. integration),
it may be useful to rewrite

  • expressions in sin(x), cos(x), etc.
    as expressions in tan(x/2),
  • expressions in sinh(x), cosh(x), etc.
    as expressions in tanh(x/2)

This ticket implements a method
for this transformation.

CC: @slel

Component: symbolics

Author: Emmanuel Charpentier, Samuel Lelièvre

Branch/Commit: u/slelievre/32389 @ a60e101

Reviewer: Samuel Lelièvre, Emmanuel Charpentier

Issue created by migration from https://trac.sagemath.org/ticket/32389

@EmmanuelCharpentier EmmanuelCharpentier mannequin added this to the sage-9.5 milestone Aug 17, 2021
@EmmanuelCharpentier
Copy link
Mannequin Author

EmmanuelCharpentier mannequin commented Aug 17, 2021

Branch: u/charpent/half_angle

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 17, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

2f7d665Half_angle : documentation.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 17, 2021

Commit: 2f7d665

@EmmanuelCharpentier
Copy link
Mannequin Author

EmmanuelCharpentier mannequin commented Aug 17, 2021

comment:3

This passes ptestlong without any new failure.

==> needs_review, if only to activate patchbots.

@EmmanuelCharpentier
Copy link
Mannequin Author

EmmanuelCharpentier mannequin commented Aug 17, 2021

Author: Emmanuel Charpentier

@EmmanuelCharpentier
Copy link
Mannequin Author

EmmanuelCharpentier mannequin commented Aug 18, 2021

comment:5

pycode and blocks fail : minor mistakes. needs_work

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 18, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

0f61904Half-angle : fix minor lint squabbles.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 18, 2021

Changed commit from 2f7d665 to 0f61904

@EmmanuelCharpentier
Copy link
Mannequin Author

EmmanuelCharpentier mannequin commented Aug 18, 2021

comment:7

needs_work to start the patchbots.

@slel

This comment has been minimized.

@slel
Copy link
Member

slel commented Aug 18, 2021

Reviewer: Samuel Lelièvre

@slel
Copy link
Member

slel commented Aug 18, 2021

comment:8

This is a good thing to add.

I rebased on Sage 9.4.rc2 and added a commit with:

  • changes from \| to | in FriCAS output reverted:
    they break tests for me
  • some refactoring for readability of code ​and examples
    • use half for Integer(1)/Integer(2)
      (also makes lines shorter)
    • less parentheses, brackets and backslashes
      in the all(...) test
    • make trig_expand example more compelling
      by naming a and b
  • some reformatting, in particular :: and
    ....: ​for example and test blocks
  • minor rephrasing, fix spacing and a typo

Set to positive review if you agree with these changes.

@slel
Copy link
Member

slel commented Aug 18, 2021

Changed commit from 0f61904 to a60e101

@slel
Copy link
Member

slel commented Aug 18, 2021

New commits:

aa9339aHalf_angle : code (not yet commented).
a9e702cHalf_angle : documentation.
b5899f7Half-angle : fix minor lint squabbles.
a60e10132389: Improve formatting

@slel
Copy link
Member

slel commented Aug 18, 2021

Changed branch from u/charpent/half_angle to u/slelievre/32389

@EmmanuelCharpentier
Copy link
Mannequin Author

EmmanuelCharpentier mannequin commented Aug 18, 2021

comment:10

Replying to @slel:

This is a good thing to add.

Indeed... sympy's and giac integrators use this often.

I rebased on Sage 9.4.rc2 and added a commit with:

  • changes from \| to | in FriCAS output reverted:
    they break tests for me

??? Not for me. Go figure...

  • some refactoring for readability of code ​and examples
    • use half for Integer(1)/Integer(2)
      (also makes lines shorter)

Smart. I should have thought of this, I didn't...

  • less parentheses, brackets and backslashes
    in the all(...) test
  • make trig_expand example more compelling
    by naming a and b
  • some reformatting, in particular :: and
    ....: ​for example and test blocks

I'm still struggling with ResStructuredText (too much markup syntaxes : LaTeX, Markdown, Org, Oxygen, WikiFormatting and now this...). Thanks a lot !

  • minor rephrasing, fix spacing and a typo

Set to positive review if you agree with these changes.

Thanks ! I do.

BTW : you should be co-author, but I'm almost sure that Trac will balk at the same name in Author and Reviewer fields.

In the same spirit (probably more useful), you may be interested in my attempt to #10038 (demoivre/exponentialize).

@slel
Copy link
Member

slel commented Aug 18, 2021

comment:11

The FriCAS output can be a different ticket.
Maybe it depends on the version of FriCAS.

Trac won't mind us being co-authors and
co-reviewers of the ticket. It's frequent.

Regarding #10038, I saw you pushed a branch
and I'm planning to look at it soon.

@slel
Copy link
Member

slel commented Aug 18, 2021

Changed author from Emmanuel Charpentier to Emmanuel Charpentier, Samuel Lelièvre

@slel
Copy link
Member

slel commented Aug 18, 2021

Changed reviewer from Samuel Lelièvre to Samuel Lelièvre, Emmanuel Charpentier

@slel slel changed the title Half angle transformation Add half-angle transformations Aug 18, 2021
@slel
Copy link
Member

slel commented Aug 19, 2021

comment:12

The FriCAS output problem might be fixed by #32279
(see also #32379).

@vbraun
Copy link
Member

vbraun commented Oct 19, 2021

comment:13

Merge conflict

@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Apr 2, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
vbraun pushed a commit to vbraun/sage that referenced this issue Aug 9, 2024
sagemathgh-38466: introduce half-angle transformations
    
tentative to replay sagemath#32389

it will fix sagemath#32389

### 📝 Checklist

- [ ] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.
    
URL: sagemath#38466
Reported by: Frédéric Chapoton
Reviewer(s): Travis Scrimshaw
@mkoeppe mkoeppe added this to the sage-10.5 milestone Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants