Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bug] Fix optimization of exp with negative exponent (#8398)
Issue: fixes #8269 ### Brief Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 7a8b410</samp> Fix the return type of exponent statements that are simplified by `alg_simp` and add a test case for this optimization. This improves the correctness and performance of code generation for exponent operations. ### Walkthrough <!-- copilot:walkthrough --> ### <samp>🤖 Generated by Copilot at 7a8b410</samp> * Simplify negative exponents by using reciprocal function ([link](https://github.com/taichi-dev/taichi/pull/8398/files?diff=unified&w=0#diff-77d8ca8e4dc6081988bd6dddb74bb9a5485af28ce3e0b43bc06d123256695513R282), [link](https://github.com/taichi-dev/taichi/pull/8398/files?diff=unified&w=0#diff-77d8ca8e4dc6081988bd6dddb74bb9a5485af28ce3e0b43bc06d123256695513R288)) - Set return type of new exponent statement to match original right-hand side ([link](https://github.com/taichi-dev/taichi/pull/8398/files?diff=unified&w=0#diff-77d8ca8e4dc6081988bd6dddb74bb9a5485af28ce3e0b43bc06d123256695513R282)) - Set return type of result statement to match original exponent statement ([link](https://github.com/taichi-dev/taichi/pull/8398/files?diff=unified&w=0#diff-77d8ca8e4dc6081988bd6dddb74bb9a5485af28ce3e0b43bc06d123256695513R288)) * Add test case for negative exponent simplification in `test_optimization.py` ([link](https://github.com/taichi-dev/taichi/pull/8398/files?diff=unified&w=0#diff-b8b031f0789413acece482512df4af5b8419a2a2dea3624b26114bbb9b57d334L156-R169)) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information