-
Notifications
You must be signed in to change notification settings - Fork 96
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
better trigonometric functions' implementation #1559
base: main
Are you sure you want to change the base?
better trigonometric functions' implementation #1559
Conversation
Pull Request Test Coverage Report for Build 5152Details
💛 - Coveralls |
2ad2022
to
90a0ef9
Compare
90a0ef9
to
3cc82ee
Compare
|
3cc82ee
to
22e45b1
Compare
@@ -0,0 +1,770 @@ | |||
// Copyright 2025 International Digital Economy Academy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the copyright for fdlibm
explicitly requires that the copyright notice should be preserved.
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
It would be better that the copyright header be reserved for translated functions,
just like what rust do:
https://github.com/rust-lang/libm/blob/a89add35ebda33250cfeec0fdd942ea43a758120/src/math/acos.rs#L4-L9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much! This is a very, very helpful point. We'll go back to work when we get back from the Chinese New Year break.
b8b0f39
to
e70d3e2
Compare
e70d3e2
to
f32edd5
Compare
This PR aims to address the issue raised in #1488, where inconsistencies in trigonometric functions were identified. The current implementation shows deviations from JavaScript V8 and glibc, which could lead to precision-related issues in the future.
To resolve this, I have implemented custom versions of
sin
,cos
, andtan
based on the well-established fdlibm library. These implementations have undergone extensive testing in the Moonbit-Math repository, demonstrating high consistency with JavaScript V8's results.References:
update in 01/31/25, add
asin
,acos
,atan
,atan2
.