OSDN Git Service
(root)
/
sie
/
sie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2399d4
)
Lighten a Math.qubicnewton function
author
dhrname
<dhrname@users.sourceforge.jp>
Tue, 31 Mar 2015 11:00:46 +0000
(20:00 +0900)
committer
dhrname
<dhrname@users.sourceforge.jp>
Tue, 31 Mar 2015 11:00:46 +0000
(20:00 +0900)
org/w3c/dom/smil.js
patch
|
blob
|
history
diff --git
a/org/w3c/dom/smil.js
b/org/w3c/dom/smil.js
index
87c23d4
..
bdff79d
100644
(file)
--- a/
org/w3c/dom/smil.js
+++ b/
org/w3c/dom/smil.js
@@
-627,14
+627,13
@@
base("$from").of( {
* 引数bは初期値*/
\r
Math.qubicnewton = function(a0, a1, a2, a3, b) {
\r
var eps = 1e-10, //収束誤差
\r
- fb = a0 *b*b*b + a1 *b*b + a2*b + a3, //方程式の結果
\r
- _abs = Math.abs; //高速化のための関数のエイリアス
\r
+ fb = a0 *b*b*b + a1 *b*b + a2*b + a3; //方程式の結果
\r
if (fb === 0) {
\r
return b;
\r
}
\r
/*限界の収束回数は100回とする*/
\r
for (var i=0;i<100;++i) {
\r
- if (
_abs(fb) < eps
) {
\r
+ if (
(fb < eps) && (fb > -eps)
) {
\r
fb = eps = void 0;
\r
return b;
\r
} else {
\r