Dodaj tabelo napak

This commit is contained in:
Martin Vuk 2026-01-04 01:36:13 +01:00
parent c20e72c395
commit a97bee079d
4 changed files with 91 additions and 3 deletions

View file

@ -1,3 +1,14 @@
using Plots
"""
s, c = sincos(x)
plot(x->sin(x)-(x-x^3/3))
Izračunaj vrednost funkcij `sin` in `cos` za dano vrednost `x`.
"""
function sincos(x)
if (abs(x)< 0.05)
x2 = x^2
return x*(1 + x2*(-1/6 + x2/120)), 1 + x2*(-0.5 + x2/24)
end
x = mod(x, 2pi)
s, c = sincos(x/2)
return 2*s*c, c^2 - s^2
end