MantisBT - Community
View Issue Details
0000902Community[OCCT] OCCT:Foundation Classespublic2002-10-25 11:242011-12-15 17:54
emo 
vtn 
normaltrivial 
closedfixed 
All
 
[OCCT] 5.1.0 
0000902: bad derivative
This bug has been added by Jacques Leroy at
http://www.opencascade.org/forumorg/bug.php?bug_id=88&f=8 [^] .

in ~/src/Expr/Expr_Exponential.cxx

the Derivative() method:

Handle(Expr_GeneralExpression) Expr_Exponential::Derivative (const Handle
(Expr_NamedUnknown)& X) const
{
  if (!Contains(X)) {
    return new Expr_NumericValue(0.0);
  }
  Handle(Expr_GeneralExpression) myexp = Operand();
  Handle(Expr_GeneralExpression) myder = myexp->Derivative(X);
  Handle(Expr_Product) resu = Expr::CopyShare(myexp) * myder;
  return resu->ShallowSimplified();
}

is wrong. (Indeed Exponential(X).Derivative(X) gives X !!)

It should be: (see BUG FIX)

Handle(Expr_GeneralExpression) Expr_Exponential::Derivative (const Handle
(Expr_NamedUnknown)& X) const
{
  if (!Contains(X)) {
    return new Expr_NumericValue(0.0);
  }
  Handle(Expr_GeneralExpression) myexp = Operand();
  Handle(Expr_GeneralExpression) myder = myexp->Derivative(X);
  Handle(Expr_Product) resu = Expr::CopyShare(this) * myder; // BUG FIX !!
  return resu->ShallowSimplified();
}
No tags attached.
zip Expr.zip (1,011) 2003-04-29 13:11
https://tracker.dev.opencascade.org/
Issue History
2002-10-25 11:26bugmasterAssigned Tobugmaster => vtn
2002-10-25 11:26bugmasterStatusnew => assigned
2003-04-29 17:11vtnStatusassigned => resolved
2003-04-30 11:40apvCC => apv
2003-04-30 12:03apvCC => aki
2003-06-02 12:46bugmasterStatusresolved => closed
2003-06-02 12:46bugmasterResolution@0@ => fixed
2011-08-02 11:23bugmasterCategoryOCCT:FDC => OCCT:Foundation Classes
2011-12-15 17:54bugmasterProjectOpen CASCADE => Community

There are no notes attached to this issue.