Skip to content
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

missed optimization: acos(1-x) -> 2 * asin(sqrt(x/2)) [on 0 <= x < 0.5?] #323

Closed
jepler opened this issue Aug 7, 2020 · 3 comments
Closed
Labels
rules Where Herbie seems unaware of an important rule

Comments

@jepler
Copy link

jepler commented Aug 7, 2020

Source: personal investigation in 2014, inspiration from freebsd math library

image

http://herbie.uwplse.org/demo/8a0cc529ad30320a1d61220a6aefb0d36298cb3c.4ba6b6e49c51088fa31e3dbc4e15bf82b3c31626/graph.html

@pavpanchekha
Copy link
Contributor

Huh, that's an interesting rewrite, thanks for the suggestion. I'll think about how best to add this.

(Herbie has a list of rewrite rules it knows about, and I could add this directly, but I'm thinking about whether there's maybe some way to break this down into simpler steps that could be useful elsewhere.)

@pavpanchekha pavpanchekha added the rules Where Herbie seems unaware of an important rule label Sep 28, 2020
@pavpanchekha
Copy link
Contributor

Herbie still doesn't handle this one well, and frankly we have no clear plans to make Herbie much better at trig, so I'm going to add this to our benchmark suite (#521) and close this issue.

@jepler
Copy link
Author

jepler commented Nov 28, 2022

That's fine! I reported this while kicking the tires of herbie but it's not actually vexing me in my real life.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rules Where Herbie seems unaware of an important rule
Projects
None yet
Development

No branches or pull requests

2 participants