Ignore:
Timestamp:
07/15/11 15:46:14 (13 years ago)
Author:
tbretz
Message:
Added GaussProb2D
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mbase/MMath.cc

    r10166 r11426  
    223223}
    224224
     225// --------------------------------------------------------------------------
     226//
     227// Returns: 1 - exp((x/sigma)^2 / 2)
     228//
     229Double_t MMath::GaussProb2D(Double_t x, Double_t sigma)
     230{
     231    const Double_t xs = x/sigma;
     232    return 1 - TMath::Exp(-xs*xs/2);
     233}
     234
    225235// ------------------------------------------------------------------------
    226236//
     
    720730//     Q := (3*b - a^2)/9
    721731//     R := (9*b*a - 27*c - 2*a^3)/54
    722 //     D := Q^3 + R^2                          % polynomial discriminant
     732//     D := R^2 -Q^3                           % polynomial discriminant
    723733//
    724734//     if (D >= 0) then                        % complex or duplicate roots
Note: See TracChangeset for help on using the changeset viewer.