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

(re)Introduce scaling factor for mid #610

Merged
merged 3 commits into from
Jan 15, 2024

Conversation

Kolaru
Copy link
Collaborator

@Kolaru Kolaru commented Jan 5, 2024

I am looking into updating IntervalRootFinding.jl for v0.22.

One think that disappeared that we need is scaled_mid.

This PR reintroduces it by giving mid an optional argument.

Technically it makes the default mid a bit slower (4 flops and 1 division, instead of 2 flops). I can split the default if it is somehow very critical for someone.

The new formula looks weird, but that's what we need to pass the test suite.

@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (5909148) 83.50% compared to head (2dd229e) 84.07%.
Report is 3 commits behind head on master.

Files Patch % Lines
src/intervals/interval_operations/numeric.jl 88.23% 4 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #610      +/-   ##
==========================================
+ Coverage   83.50%   84.07%   +0.57%     
==========================================
  Files          24       24              
  Lines        2097     2091       -6     
==========================================
+ Hits         1751     1758       +7     
+ Misses        346      333      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Kolaru Kolaru requested a review from OlivierHnt January 5, 2024 16:30
@OlivierHnt
Copy link
Member

That's a good idea.

There probably were tests for scaled_mid that we can revive.

@OlivierHnt
Copy link
Member

One note: we should add a check that α is between 0 and 1.

Perhaps something like

0  α  1 || return throw(DomainError(mid, "α must be between 0 and 1"))

@Kolaru
Copy link
Collaborator Author

Kolaru commented Jan 15, 2024

I have added the domain check and some tests.

@OlivierHnt OlivierHnt merged commit 946493a into JuliaIntervals:master Jan 15, 2024
16 checks passed
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 this pull request may close these issues.

3 participants