Skip to content

add 'safe_power' engine function that sets 0^0 to 0 #200

@bbolker

Description

@bbolker

it would be convenient to have an engine function that computes x^y but always returns 0 if x==0. (We have a special case where we are computing 0^0, where C++ quite reasonably returns NaN; we know we want the answer to be 0 in this case.) I took a crack at this on a branch (with CppAD::CondExpLt), but am so far failing (perhaps because of some issue with vectorization? Not sure ...)

If this is not something @stevencarlislewalker can figure out quickly I might ask on the TMB list ...

(attn: @jfree-man)

Metadata

Metadata

Labels

engineComponent: C++ / TMB Engine

Type

No type

Projects

Status

📋 Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions