\[\sin \left(x + \varepsilon\right) - \sin x
\]
↓
\[\begin{array}{l}
t_0 := \sin \varepsilon - \sin x\\
\mathbf{if}\;\varepsilon \leq -40:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\varepsilon \leq 1.8 \cdot 10^{-9}:\\
\;\;\;\;\varepsilon \cdot \cos x + \left(-0.16666666666666666 \cdot \left(\cos x \cdot {\varepsilon}^{3}\right) + \sin x \cdot \left(0.041666666666666664 \cdot {\varepsilon}^{4} + -0.5 \cdot {\varepsilon}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
(FPCore (x eps) :precision binary64 (- (sin (+ x eps)) (sin x)))
↓
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (sin eps) (sin x))))
(if (<= eps -40.0)
t_0
(if (<= eps 1.8e-9)
(+
(* eps (cos x))
(+
(* -0.16666666666666666 (* (cos x) (pow eps 3.0)))
(*
(sin x)
(+ (* 0.041666666666666664 (pow eps 4.0)) (* -0.5 (pow eps 2.0))))))
t_0))))double code(double x, double eps) {
return sin((x + eps)) - sin(x);
}
↓
double code(double x, double eps) {
double t_0 = sin(eps) - sin(x);
double tmp;
if (eps <= -40.0) {
tmp = t_0;
} else if (eps <= 1.8e-9) {
tmp = (eps * cos(x)) + ((-0.16666666666666666 * (cos(x) * pow(eps, 3.0))) + (sin(x) * ((0.041666666666666664 * pow(eps, 4.0)) + (-0.5 * pow(eps, 2.0)))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = sin((x + eps)) - sin(x)
end function
↓
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = sin(eps) - sin(x)
if (eps <= (-40.0d0)) then
tmp = t_0
else if (eps <= 1.8d-9) then
tmp = (eps * cos(x)) + (((-0.16666666666666666d0) * (cos(x) * (eps ** 3.0d0))) + (sin(x) * ((0.041666666666666664d0 * (eps ** 4.0d0)) + ((-0.5d0) * (eps ** 2.0d0)))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
return Math.sin((x + eps)) - Math.sin(x);
}
↓
public static double code(double x, double eps) {
double t_0 = Math.sin(eps) - Math.sin(x);
double tmp;
if (eps <= -40.0) {
tmp = t_0;
} else if (eps <= 1.8e-9) {
tmp = (eps * Math.cos(x)) + ((-0.16666666666666666 * (Math.cos(x) * Math.pow(eps, 3.0))) + (Math.sin(x) * ((0.041666666666666664 * Math.pow(eps, 4.0)) + (-0.5 * Math.pow(eps, 2.0)))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps):
return math.sin((x + eps)) - math.sin(x)
↓
def code(x, eps):
t_0 = math.sin(eps) - math.sin(x)
tmp = 0
if eps <= -40.0:
tmp = t_0
elif eps <= 1.8e-9:
tmp = (eps * math.cos(x)) + ((-0.16666666666666666 * (math.cos(x) * math.pow(eps, 3.0))) + (math.sin(x) * ((0.041666666666666664 * math.pow(eps, 4.0)) + (-0.5 * math.pow(eps, 2.0)))))
else:
tmp = t_0
return tmp
function code(x, eps)
return Float64(sin(Float64(x + eps)) - sin(x))
end
↓
function code(x, eps)
t_0 = Float64(sin(eps) - sin(x))
tmp = 0.0
if (eps <= -40.0)
tmp = t_0;
elseif (eps <= 1.8e-9)
tmp = Float64(Float64(eps * cos(x)) + Float64(Float64(-0.16666666666666666 * Float64(cos(x) * (eps ^ 3.0))) + Float64(sin(x) * Float64(Float64(0.041666666666666664 * (eps ^ 4.0)) + Float64(-0.5 * (eps ^ 2.0))))));
else
tmp = t_0;
end
return tmp
end
function tmp = code(x, eps)
tmp = sin((x + eps)) - sin(x);
end
↓
function tmp_2 = code(x, eps)
t_0 = sin(eps) - sin(x);
tmp = 0.0;
if (eps <= -40.0)
tmp = t_0;
elseif (eps <= 1.8e-9)
tmp = (eps * cos(x)) + ((-0.16666666666666666 * (cos(x) * (eps ^ 3.0))) + (sin(x) * ((0.041666666666666664 * (eps ^ 4.0)) + (-0.5 * (eps ^ 2.0)))));
else
tmp = t_0;
end
tmp_2 = tmp;
end
code[x_, eps_] := N[(N[Sin[N[(x + eps), $MachinePrecision]], $MachinePrecision] - N[Sin[x], $MachinePrecision]), $MachinePrecision]
↓
code[x_, eps_] := Block[{t$95$0 = N[(N[Sin[eps], $MachinePrecision] - N[Sin[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps, -40.0], t$95$0, If[LessEqual[eps, 1.8e-9], N[(N[(eps * N[Cos[x], $MachinePrecision]), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[Power[eps, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * N[(N[(0.041666666666666664 * N[Power[eps, 4.0], $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[Power[eps, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\sin \left(x + \varepsilon\right) - \sin x
↓
\begin{array}{l}
t_0 := \sin \varepsilon - \sin x\\
\mathbf{if}\;\varepsilon \leq -40:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\varepsilon \leq 1.8 \cdot 10^{-9}:\\
\;\;\;\;\varepsilon \cdot \cos x + \left(-0.16666666666666666 \cdot \left(\cos x \cdot {\varepsilon}^{3}\right) + \sin x \cdot \left(0.041666666666666664 \cdot {\varepsilon}^{4} + -0.5 \cdot {\varepsilon}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}