Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function y = arcsin_test3(x)
- y = x.*(1+x.*x.*(1/6+ x.*x.*(3/(2*4*5) + x.*x.*((1*3*5)/(2*4*6*7)))))
- endfunction
- // 25770
- function y = arcsin_test(x)
- a0 = 1.5707288
- a1 = -0.2121144
- a2 = 0.0742610
- a3 = -0.0187293
- xx = abs(x)
- y = %pi/2 - sqrt(1-x).*(a0 + a1*x + a2.*x.*x + a3.*x.*x.*x)
- endfunction
- function y = arcsin_test2(x)
- a0 = 1.5707288
- a1 = -0.2121144
- a2 = 0.0742610
- a3 = -0.0187293
- xx = abs(x)
- y = %pi/2 - sqrt(1-xx).*(a0 + a1*xx + a2.*xx.*xx + a3.*xx.*xx.*xx)
- y = y.*sign(x);
- endfunction
- x = [-1: .0100001 : 1];
- clf
- subplot(211)
- plot(x,arcsin_test2(x),'g.');
- plot(x,arcsin_test(x),'r:');
- plot(x,asin(x))
- subplot(212)
- //plot(x,(arcsin_test(x) - asin(x)),'r:')
- plot(x,(arcsin_test2(x) - asin(x)),'g.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement