Closed dschwen closed 2 years ago
std::pow(ADReal(-1), 2);
fails, too. Actually any whole number fails. Fractions will probably fail, too, but for different reasons...
Fraction should fail right?
but for different reasons...
maeaning: the right reasons
Power of one should be a no op.
You mean an identity, right? Just testing whether the exponent is 1 is already an op.
I'm having some trouble replicating this. Could you try out https://github.com/roystgnr/MetaPhysicL/tree/pow_negative_with_int and see if the new tests work or fail for you? Could you let me know what container you've got configured for the gradients in your ADReal? Those new tests are with NumberArray; maybe there's something that works there but fails with a sparse gradient?
@roystgnr this fails with DualNumber<Real, Real>
, too.
CI can't seem to replicate the problem with gcc 9.4, gcc 7.5, or clang 5.0.2. If those new tests in https://github.com/libMesh/MetaPhysicL/pull/22 fail for you then let me know as much as you can about your environment? If they pass for you then see if you can add one that fails?
This was closed by libMesh/MetaPhysicL#22
ADReal being any
DualNumber<Real, *>
(Real being double). Power of one should be a no op. Floating point exception is unexpected.