Skip to content

Conversation

@jeanchristopheruel
Copy link

@jeanchristopheruel jeanchristopheruel commented Dec 29, 2023

Summary

Attempt to fix issue #2993 -> pow<fvar<var>>(0, 0) causing NAN adjoint.

UPDATE
Having pow<fvar<var>>(0, 0) causing NAN adjoint is actually correct. The issue is instead pow<var>(0, 0) not causing NAN adjoint.

Tests

Added stan::test::expect_ad(f, 0.0, 0.0); to pow_part1_test.cpp

Side Effects

No, to the best of my knowledge

Release notes

Fix a bug with pow(0,0). The partials of pow(0,0) now behave as undefined, as expected.

Checklist

  • Copyright holder: (fill in copyright holder information)

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

@jeanchristopheruel jeanchristopheruel changed the title WIP: fix pow(fvar<var>{0}, 0) for mixed variables WIP: fix pow<fvar<var>>(0, 0) for mixed variables Dec 29, 2023
@jeanchristopheruel jeanchristopheruel changed the title WIP: fix pow<fvar<var>>(0, 0) for mixed variables fix pow<var>(0, 0) not causing NAN adjoint Jan 12, 2024
@jeanchristopheruel jeanchristopheruel changed the title fix pow<var>(0, 0) not causing NAN adjoint fix pow<var>(0, 0) not causing NAN adjoints Jan 12, 2024
@andrjohns
Copy link
Collaborator

Obsoleted by #3031 and #3033

@andrjohns andrjohns closed this Mar 21, 2024
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