diff --git a/zfit_physics/models/pdf_cruijff.py b/zfit_physics/models/pdf_cruijff.py index 43149c0..c088c92 100644 --- a/zfit_physics/models/pdf_cruijff.py +++ b/zfit_physics/models/pdf_cruijff.py @@ -26,16 +26,16 @@ def cruijff_pdf_func(x, mu, sigmal, alphal, sigmar, alphar): """ cond = znp.less(x, mu) -# compute only once (in graph this _may_ be optimized anyways, but surely not in eager) -xminmu = (x - mu) -tleft = znp.square(xminmu / sigmal) -tright = znp.square(xminmu / sigmar) -exponent = znp.where( - cond, - tleft / (1 + alphal * tleft), - tright / (1 + alphar * tright), -) -value = znp.exp(-0.5 * exponent) + # compute only once (in graph this _may_ be optimized anyways, but surely not in eager) + xminmu = x - mu + tleft = znp.square(xminmu / sigmal) + tright = znp.square(xminmu / sigmar) + exponent = znp.where( + cond, + tleft / (1 + alphal * tleft), + tright / (1 + alphar * tright), + ) + value = znp.exp(-0.5 * exponent) return value