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

Wrong results for sigmoid function #846

Closed
dendibakh opened this issue Jun 10, 2024 · 1 comment
Closed

Wrong results for sigmoid function #846

dendibakh opened this issue Jun 10, 2024 · 1 comment

Comments

@dendibakh
Copy link

First of all, thank you for the incredible tool!
Learned about it on HackerNews.
I tried to find a substitute for the sigmoid function:

(FPCore (x)
  :name "1/(1+pow(E,-x))"
  :pre (and (<= -1e9 x 1e9))
  (/ 1 (+ 1 (pow E (- x)))))

The tool suggests 0.5+x*0.25, saying it has 21.4x speedup and is 96.9% accurate, which I think is wrong. It is a bad approximation of sigmoid function.

@pavpanchekha
Copy link
Contributor

Right... what's going on is that this is a good approximation, near 0, but Herbie isn't adding a branch. I'm closing this as a duplicate of #742 but please know that we're thinking about the issue. (In the next release, we hope to modify the UI to make the issue easier to avoid, and in the future we plan to explicitly track approximation steps like this one so we can correctly detect when we're using them outside the relevant range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants