File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -461,12 +461,8 @@ fn truncated_normal() {
461461
462462 let normal = statrs:: distribution:: Normal :: new ( 0.0 , 1.0 ) . unwrap ( ) ;
463463
464- let z = normal
465- . cdf ( standard_upper)
466- - normal. cdf ( standard_lower) ;
467- ( normal. cdf ( standard_x)
468- - normal. cdf ( standard_lower) )
469- / Z
464+ let z = normal. cdf ( standard_upper) - normal. cdf ( standard_lower) ;
465+ ( normal. cdf ( standard_x) - normal. cdf ( standard_lower) ) / Z
470466 }
471467 } ;
472468 test_continuous ( seed as u64 , dist, analytic) ;
Original file line number Diff line number Diff line change 11use rand:: { Rng , distr:: Distribution } ;
2+ #[ allow( unused_imports) ]
3+ use num_traits:: Float ;
24
35/// The [truncated normal distribution](https://en.wikipedia.org/wiki/Truncated_normal_distribution).
46///
You can’t perform that action at this time.
0 commit comments