preventing more nan's by replacing func(a) -> func(|a|) for func: sqrt(), ln(), log()
This commit is contained in:
parent
78d0469993
commit
901f12b5c5
@ -458,13 +458,13 @@ Double_t PFunction::EvalNode(PFuncTreeNode &node)
|
|||||||
} else if (node.fFunctionTag == FUN_ATANH) {
|
} else if (node.fFunctionTag == FUN_ATANH) {
|
||||||
return atanh(EvalNode(node.children[0]));
|
return atanh(EvalNode(node.children[0]));
|
||||||
} else if (node.fFunctionTag == FUN_LOG) {
|
} else if (node.fFunctionTag == FUN_LOG) {
|
||||||
return log(EvalNode(node.children[0]))/log(10.0);
|
return log(fabs(EvalNode(node.children[0])))/log(10.0);
|
||||||
} else if (node.fFunctionTag == FUN_LN) {
|
} else if (node.fFunctionTag == FUN_LN) {
|
||||||
return log(EvalNode(node.children[0]));
|
return log(fabs(EvalNode(node.children[0])));
|
||||||
} else if (node.fFunctionTag == FUN_EXP) {
|
} else if (node.fFunctionTag == FUN_EXP) {
|
||||||
return exp(EvalNode(node.children[0]));
|
return exp(EvalNode(node.children[0]));
|
||||||
} else if (node.fFunctionTag == FUN_SQRT) {
|
} else if (node.fFunctionTag == FUN_SQRT) {
|
||||||
return sqrt(EvalNode(node.children[0]));
|
return sqrt(fabs(EvalNode(node.children[0])));
|
||||||
} else {
|
} else {
|
||||||
cerr << endl << "**PANIC ERROR**: PFunction::EvalNode: node.fID == PFunctionGrammar::functionID: you never should have reached this point!";
|
cerr << endl << "**PANIC ERROR**: PFunction::EvalNode: node.fID == PFunctionGrammar::functionID: you never should have reached this point!";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user