Skip to content

Commit b1949ea

Browse files
Refactor logcdf to return z value
pre-calculate value instead while returning the function call. Signed-off-by: Shubham <b4mshubham@gmail.com>
1 parent 8260691 commit b1949ea

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • lib/node_modules/@stdlib/stats/base/dists/halfnormal/logcdf/src

lib/node_modules/@stdlib/stats/base/dists/halfnormal/logcdf/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ double stdlib_base_dists_halfnormal_logcdf( const double x, const double sigma )
5252
}
5353

5454
z = x / sigma;
55+
z = stdlib_base_ln( stdlib_base_erf( z * INV_SQRT_TWO ) );
5556

56-
return stdlib_base_ln( stdlib_base_erf( z * INV_SQRT_TWO ) );
57+
return z;
5758
}

0 commit comments

Comments
 (0)