mirror of https://github.com/glouw/tinn
Merge pull request #11 from Bl00drav3n/master
replace call to powf with SQUARE macro
This commit is contained in:
commit
87a032a14a
2
Tinn.c
2
Tinn.c
|
@ -8,7 +8,7 @@
|
||||||
// Error function.
|
// Error function.
|
||||||
static float err(const float a, const float b)
|
static float err(const float a, const float b)
|
||||||
{
|
{
|
||||||
return 0.5f * powf(a - b, 2.0f);
|
return 0.5f * (a - b) * (a - b);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Partial derivative of error function.
|
// Partial derivative of error function.
|
||||||
|
|
Loading…
Reference in New Issue