TI-Nspire & Lua / Fehlberg 法 4 / 誤差 (4 次、5 次の解の差) と指定許容値とから新しい刻み幅を計算する、それに意味のないとき

参考: パソコンで見る天体の動き, pp.103-109

function hNew(h, err, tol)
   if err > tol then
      return 0.9 * h * (tol * h/(h * err))^(1/4)
   else
      return h
   end
end

-- 確かめる
print(hNew(1, 0.0017737, 0.0001))

f:id:ti-nspire:20170603062441p:plain:w300