ChainRules.jl
                                
                                 ChainRules.jl copied to clipboard
                                
                                    ChainRules.jl copied to clipboard
                            
                            
                            
                        Optimize power rule
* is often faster than /.
The hard part was getting all the weird edge cases to work. If introducing extra branches like if isinteger(p), you may need to expand the list of test cases to check both halves.
@YingboMa are you going to add the missing test so we can merge this?