Skip to content

Conversation

rayomaz
Copy link

@rayomaz rayomaz commented Sep 7, 2025

Nice toolbox! Suggesting an extension to be able to handle erf from SpecialFunctions.jl. After testing, bounds look good on my end ;)

@mykelk
Copy link
Member

mykelk commented Sep 7, 2025

Awesome! Are you able to bring in my most recent commit to main so that we can rerun the CI to ensure everything passes?

@rayomaz
Copy link
Author

rayomaz commented Sep 10, 2025

Great! Made a commit to match your latest CI file version. I belief the workflow should pass

@chelseas
Copy link
Collaborator

I appreciate the PR but this needs a little cleanup. E.g., this isn't needed if the convexity is properly set in get_regions_unary:

    if d2f_zeros === nothing && convex === nothing
        if f_x_expr isa Expr && f_x_expr.head == :call && f_x_expr.args[1] == :erf
            if ub <= 0
                d2f_zeros = Float64[]; convex = true       # erf convex on (-∞,0]
            elseif lb >= 0
                d2f_zeros = Float64[]; convex = false      # erf concave on [0,∞)
            else
                d2f_zeros = [0.0]; convex = nothing        # mixed across 0
            end
        end
    end
    ```
    
    

@chelseas
Copy link
Collaborator

Also, why goes get_symbols have to support erf?

And why is this necessary?

   # robust resolution: try current scope, then SpecialFunctions
    fun = try
        eval(:($f))
    catch
        getfield(SpecialFunctions, f)
    end

If SpecialFunctions is loaded, eval should handle it.

And this appears to be unfinished?

   function find_bounds_for_function(func::Symbol, range)
    if func == :erf
        # Evaluate erf over interval range using interval arithmetic
        return erf(range)
    elseif func in special_func
        # existing logic
    else
        error("Unsupported function: $func")
    end
end

@mykelk
Copy link
Member

mykelk commented Sep 20, 2025

Also it looks like a conflict needs to be resolved due to a previous PR that was merged. Thanks for the PR!

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