diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-10-13 21:00:07 -0600 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-10-13 21:00:07 -0600 |
commit | d21a7de801b4a326001e45c0d26826e9ab53589b (patch) | |
tree | 314c35f77473b651f4a2f79395769595ddb9dd6c /src/lin.c | |
parent | cae58e90e0a2f19aa9a01177ef1707904f22c64c (diff) | |
download | cmath-d21a7de801b4a326001e45c0d26826e9ab53589b.tar.gz cmath-d21a7de801b4a326001e45c0d26826e9ab53589b.zip |
hw 4
Diffstat (limited to 'src/lin.c')
-rw-r--r-- | src/lin.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -7,8 +7,8 @@ Line *least_squares_lin_reg(Array_double *x, Array_double *y) { uint64_t n = x->size; double sum_x = sum_v(x); double sum_y = sum_v(y); - double sum_xy = dot_v(x, y); - double sum_xx = dot_v(x, x); + double sum_xy = v_dot_v(x, y); + double sum_xx = v_dot_v(x, x); double denom = ((n * sum_xx) - (sum_x * sum_x)); Line *line = malloc(sizeof(Line)); |