Skip to content

Conversation

cgarling
Copy link
Contributor

@cgarling cgarling commented Aug 11, 2025

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Replaces the equivalent of sqrt(x^2 + y^2) with hypot(x, y) in BSplineInterpolation and BSplineApprox as hypot can be more accurate in some situations and is only marginally slower (~1 ns slower for Float64 arguments). Two tests broke locally due to very minor float changes -- I updated these tests and all now pass locally.

The methods that take u::AbstractArray have different expressions that look more like sqrt(x^2 + sum(y.^2)) which can't be replaced with hypot calls so I didn't touch those , e.g.,

for i in 2:n
s += ((t[i] - t[i - 1])^2 + sum((u[ax_u..., i] - u[ax_u..., i - 1]) .^ 2))
l[i - 1] = s
end

@ChrisRackauckas ChrisRackauckas merged commit 0e6c067 into SciML:master Aug 13, 2025
17 of 19 checks passed
@cgarling cgarling deleted the hypot branch August 13, 2025 11:37
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.

2 participants