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

StackOverflowError for pow(::Float32, ::Float64) #47

Closed
torfjelde opened this issue Apr 21, 2021 · 2 comments
Closed

StackOverflowError for pow(::Float32, ::Float64) #47

torfjelde opened this issue Apr 21, 2021 · 2 comments

Comments

@torfjelde
Copy link
Contributor

pow(::Float32, ::Float64) results in a StackOverflowError due to the use of float in the default implementation:
https://github.com/mlubin/NaNMath.jl/blob/0fc4df8442fcefebe8efe490781fce5663c03b02/src/NaNMath.jl#L23-L25

Maybe there ought to be a promote here?

@mlubin
Copy link
Collaborator

mlubin commented Apr 21, 2021

That could work, feel free to open a PR.

torfjelde added a commit to torfjelde/DiffRules.jl that referenced this issue Dec 14, 2021
torfjelde added a commit to torfjelde/DiffRules.jl that referenced this issue Dec 14, 2021
torfjelde added a commit to torfjelde/NaNMath.jl that referenced this issue Dec 14, 2021
mlubin pushed a commit that referenced this issue Dec 16, 2021
* fix for #47

* added tests

* added promote to pow
@mlubin
Copy link
Collaborator

mlubin commented Dec 16, 2021

Closed by #50 and tagged a new release

@mlubin mlubin closed this as completed Dec 16, 2021
devmotion added a commit to JuliaDiff/DiffRules.jl that referenced this issue Jan 28, 2022
* fixed issues with return-type for several rules

* initial work on inferring return type using intermediate computations

* removed oftype where possible

* fixed stupid mistake

* missed one in fix of stupid mistake

* more fixes

* added tests for different types

* removed a couple of overdone oftypes

* moved a single paranthesis

* use irrationals to simplify type-promotion

* depend on IrrationalConstants.jl

* fixed tests

* actually fixed tests

* updated rules to use constants from IrrationalConstants

* Update src/rules.jl

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>

* reverted some changes from previous commit

* fixed a typo

* fixed typo

* fixed type-conversion in tests

* Apply suggestions from code review

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>

* reverse previous commit due to JuliaMath/NaNMath.jl#47

* reverse previous commit due to JuliaMath/NaNMath.jl#47

* drop qualifications from rules

* reverted unintended change to _abs_deriv

* interpolate _abs_deriv

* be explicit about imported irrationals

* fixed tests

* fixed numerical issues in tests by adopting some changes from #79

* relax rtol slightly since we're working with Float32 too here

* Update Project.toml

* test type of derivative for functions with 2 arguments

* fixed types of derivatives for mod, rem and different bessel functions

* use deg2rad

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>

* reverted changes to + and -

* remove duplicate rules

* add back whitespace

* reverted changes to bessel functions

* only test return-type having the correct promotion behavior

* only test type for 2 argument functions whose derivatives aren't NaN

* fixed rules of mod and rem

* make each rule its own testset for easier debugging

* reverted changes to multiple NaNMath rules

* use more explicit promotion in tests

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>

* check promotion of real instead of specific check for Complex

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>

* reverted unnecessary change

* reverted unnecessary changes

* dont check if AbstractFloat in tests

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
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

No branches or pull requests

2 participants