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

acos unsound in TR #1423

Open
jbclements opened this issue Dec 31, 2024 · 2 comments · May be fixed by #1428
Open

acos unsound in TR #1423

jbclements opened this issue Dec 31, 2024 · 2 comments · May be fixed by #1428

Comments

@jbclements
Copy link
Contributor

Per the discussion in

https://racket.discourse.group/t/acos-behaves-differently-on-s-1-0-in-tr/3453

... it appears there is a soundness problem around the use of flacos to implement acos in TR. Specifically, this program, constructed by @usaoc , demonstrates that a term with type Flonum can produce a complex number:

#lang typed/racket/base #:no-optimize
(ann (acos 1.5) Flonum) ; result is 0.0+0.9624236501192069i, not a flonum

Many thanks to @usaoc and Shawn Wagner for identifying the underlying issue.

@racket-discourse-github-bot

This issue has been mentioned on Racket Discourse. There might be relevant details there:

https://racket.discourse.group/t/acos-behaves-differently-on-s-1-0-in-tr/3453/5

samth added a commit to samth/typed-racket that referenced this issue Jan 16, 2025
These can produce complex results for flonum inputs.

Closes racket#1423.
@samth samth linked a pull request Jan 16, 2025 that will close this issue
@samth
Copy link
Member

samth commented Jan 16, 2025

Unfortunately, fixing this exposes problems in a number of other libraries. In particular, some math library operations will have different and more limited types (they were of course wrong before).

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

Successfully merging a pull request may close this issue.

3 participants