using the native tan and tanh math functions for real vector calculation

This commit is contained in:
dwarning 2018-10-03 20:54:46 +02:00 committed by Holger Vogt
parent 3dd94ba15c
commit 76c43ab512
1 changed files with 3 additions and 4 deletions

View File

@ -581,8 +581,8 @@ d_tan(double *dd, int length)
d = alloc_d(length);
for (i = 0; i < length; i++) {
rcheck(cos(degtorad(dd[i])) != 0, "tan");
d[i] = sin(degtorad(dd[i])) / cos(degtorad(dd[i]));
rcheck(tan(degtorad(dd[i])) != 0, "tan");
d[i] = tan(degtorad(dd[i]));
}
return d;
}
@ -595,8 +595,7 @@ d_tanh(double *dd, int length)
d = alloc_d(length);
for (i = 0; i < length; i++) {
rcheck(cosh(degtorad(dd[i])) != 0, "tanh");
d[i] = sinh(degtorad(dd[i])) / cosh(degtorad(dd[i]));
d[i] = tanh(degtorad(dd[i]));
}
return d;
}