
(FPCore (x eps) :precision binary64 (- (tan (+ x eps)) (tan x)))
double code(double x, double eps) {
return tan((x + eps)) - tan(x);
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = tan((x + eps)) - tan(x)
end function
public static double code(double x, double eps) {
return Math.tan((x + eps)) - Math.tan(x);
}
def code(x, eps): return math.tan((x + eps)) - math.tan(x)
function code(x, eps) return Float64(tan(Float64(x + eps)) - tan(x)) end
function tmp = code(x, eps) tmp = tan((x + eps)) - tan(x); end
code[x_, eps_] := N[(N[Tan[N[(x + eps), $MachinePrecision]], $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\tan \left(x + \varepsilon\right) - \tan x
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x eps) :precision binary64 (- (tan (+ x eps)) (tan x)))
double code(double x, double eps) {
return tan((x + eps)) - tan(x);
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = tan((x + eps)) - tan(x)
end function
public static double code(double x, double eps) {
return Math.tan((x + eps)) - Math.tan(x);
}
def code(x, eps): return math.tan((x + eps)) - math.tan(x)
function code(x, eps) return Float64(tan(Float64(x + eps)) - tan(x)) end
function tmp = code(x, eps) tmp = tan((x + eps)) - tan(x); end
code[x_, eps_] := N[(N[Tan[N[(x + eps), $MachinePrecision]], $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\tan \left(x + \varepsilon\right) - \tan x
\end{array}
(FPCore (x eps)
:precision binary64
(let* ((t_0 (+ (tan x) (tan eps))) (t_1 (- 1.0 (* (tan x) (tan eps)))))
(if (<= eps -4.7e-7)
(- (/ t_0 (- 1.0 (/ (* (tan eps) (sin x)) (cos x)))) (tan x))
(if (<= eps 4.1e-7)
(/ (/ eps (/ (cos x) (fma (sin x) (tan x) (cos x)))) t_1)
(fma t_0 (/ 1.0 t_1) (- (tan x)))))))
double code(double x, double eps) {
double t_0 = tan(x) + tan(eps);
double t_1 = 1.0 - (tan(x) * tan(eps));
double tmp;
if (eps <= -4.7e-7) {
tmp = (t_0 / (1.0 - ((tan(eps) * sin(x)) / cos(x)))) - tan(x);
} else if (eps <= 4.1e-7) {
tmp = (eps / (cos(x) / fma(sin(x), tan(x), cos(x)))) / t_1;
} else {
tmp = fma(t_0, (1.0 / t_1), -tan(x));
}
return tmp;
}
function code(x, eps) t_0 = Float64(tan(x) + tan(eps)) t_1 = Float64(1.0 - Float64(tan(x) * tan(eps))) tmp = 0.0 if (eps <= -4.7e-7) tmp = Float64(Float64(t_0 / Float64(1.0 - Float64(Float64(tan(eps) * sin(x)) / cos(x)))) - tan(x)); elseif (eps <= 4.1e-7) tmp = Float64(Float64(eps / Float64(cos(x) / fma(sin(x), tan(x), cos(x)))) / t_1); else tmp = fma(t_0, Float64(1.0 / t_1), Float64(-tan(x))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Tan[x], $MachinePrecision] + N[Tan[eps], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(N[Tan[x], $MachinePrecision] * N[Tan[eps], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps, -4.7e-7], N[(N[(t$95$0 / N[(1.0 - N[(N[(N[Tan[eps], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[eps, 4.1e-7], N[(N[(eps / N[(N[Cos[x], $MachinePrecision] / N[(N[Sin[x], $MachinePrecision] * N[Tan[x], $MachinePrecision] + N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(t$95$0 * N[(1.0 / t$95$1), $MachinePrecision] + (-N[Tan[x], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan x + \tan \varepsilon\\
t_1 := 1 - \tan x \cdot \tan \varepsilon\\
\mathbf{if}\;\varepsilon \leq -4.7 \cdot 10^{-7}:\\
\;\;\;\;\frac{t_0}{1 - \frac{\tan \varepsilon \cdot \sin x}{\cos x}} - \tan x\\
\mathbf{elif}\;\varepsilon \leq 4.1 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{\varepsilon}{\frac{\cos x}{\mathsf{fma}\left(\sin x, \tan x, \cos x\right)}}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t_0, \frac{1}{t_1}, -\tan x\right)\\
\end{array}
\end{array}
if eps < -4.7e-7Initial program 58.9%
tan-sum99.3%
div-inv99.3%
*-un-lft-identity99.3%
prod-diff99.3%
*-commutative99.3%
*-un-lft-identity99.3%
*-commutative99.3%
*-un-lft-identity99.3%
Applied egg-rr99.3%
+-commutative99.3%
fma-udef99.3%
associate-+r+99.3%
unsub-neg99.3%
Simplified99.3%
*-commutative99.3%
tan-quot99.4%
associate-*r/99.4%
Applied egg-rr99.4%
if -4.7e-7 < eps < 4.0999999999999999e-7Initial program 29.6%
tan-sum31.1%
tan-quot30.7%
frac-sub30.6%
Applied egg-rr30.6%
Taylor expanded in eps around 0 99.5%
cancel-sign-sub-inv99.5%
metadata-eval99.5%
*-lft-identity99.5%
Simplified99.5%
*-un-lft-identity99.5%
tan-quot99.5%
tan-quot99.5%
*-commutative99.5%
times-frac99.5%
*-commutative99.5%
tan-quot99.5%
tan-quot99.5%
Applied egg-rr99.5%
associate-*l/99.6%
*-lft-identity99.6%
associate-/l*99.6%
+-commutative99.6%
/-rgt-identity99.6%
fma-def99.7%
Simplified99.7%
if 4.0999999999999999e-7 < eps Initial program 59.5%
tan-sum99.6%
div-inv99.6%
*-un-lft-identity99.6%
prod-diff99.6%
*-commutative99.6%
*-un-lft-identity99.6%
*-commutative99.6%
*-un-lft-identity99.6%
Applied egg-rr99.6%
+-commutative99.6%
fma-udef99.6%
associate-+r+99.6%
unsub-neg99.6%
Simplified99.6%
div-inv99.6%
fma-neg99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (tan x) (tan eps))))
(-
(/ (/ (sin eps) (cos eps)) (- 1.0 (/ (tan x) (/ 1.0 (tan eps)))))
(/ t_0 (/ (+ -1.0 t_0) (tan x))))))
double code(double x, double eps) {
double t_0 = tan(x) * tan(eps);
return ((sin(eps) / cos(eps)) / (1.0 - (tan(x) / (1.0 / tan(eps))))) - (t_0 / ((-1.0 + t_0) / tan(x)));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
t_0 = tan(x) * tan(eps)
code = ((sin(eps) / cos(eps)) / (1.0d0 - (tan(x) / (1.0d0 / tan(eps))))) - (t_0 / (((-1.0d0) + t_0) / tan(x)))
end function
public static double code(double x, double eps) {
double t_0 = Math.tan(x) * Math.tan(eps);
return ((Math.sin(eps) / Math.cos(eps)) / (1.0 - (Math.tan(x) / (1.0 / Math.tan(eps))))) - (t_0 / ((-1.0 + t_0) / Math.tan(x)));
}
def code(x, eps): t_0 = math.tan(x) * math.tan(eps) return ((math.sin(eps) / math.cos(eps)) / (1.0 - (math.tan(x) / (1.0 / math.tan(eps))))) - (t_0 / ((-1.0 + t_0) / math.tan(x)))
function code(x, eps) t_0 = Float64(tan(x) * tan(eps)) return Float64(Float64(Float64(sin(eps) / cos(eps)) / Float64(1.0 - Float64(tan(x) / Float64(1.0 / tan(eps))))) - Float64(t_0 / Float64(Float64(-1.0 + t_0) / tan(x)))) end
function tmp = code(x, eps) t_0 = tan(x) * tan(eps); tmp = ((sin(eps) / cos(eps)) / (1.0 - (tan(x) / (1.0 / tan(eps))))) - (t_0 / ((-1.0 + t_0) / tan(x))); end
code[x_, eps_] := Block[{t$95$0 = N[(N[Tan[x], $MachinePrecision] * N[Tan[eps], $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[Sin[eps], $MachinePrecision] / N[Cos[eps], $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[Tan[x], $MachinePrecision] / N[(1.0 / N[Tan[eps], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 / N[(N[(-1.0 + t$95$0), $MachinePrecision] / N[Tan[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan x \cdot \tan \varepsilon\\
\frac{\frac{\sin \varepsilon}{\cos \varepsilon}}{1 - \frac{\tan x}{\frac{1}{\tan \varepsilon}}} - \frac{t_0}{\frac{-1 + t_0}{\tan x}}
\end{array}
\end{array}
Initial program 45.0%
tan-sum66.6%
div-inv66.6%
*-un-lft-identity66.6%
prod-diff66.6%
*-commutative66.6%
*-un-lft-identity66.6%
*-commutative66.6%
*-un-lft-identity66.6%
Applied egg-rr66.6%
+-commutative66.6%
fma-udef66.6%
associate-+r+66.6%
unsub-neg66.6%
Simplified66.6%
Taylor expanded in x around inf 66.4%
associate--l+80.5%
associate-/r*80.5%
times-frac80.5%
Simplified80.6%
frac-2neg80.6%
clear-num77.6%
frac-sub76.6%
Applied egg-rr77.4%
cancel-sign-sub77.4%
distribute-lft-neg-out77.4%
rgt-mult-inverse80.6%
metadata-eval80.6%
*-rgt-identity80.6%
sub-neg80.6%
distribute-rgt-neg-out80.6%
associate-+r+99.5%
metadata-eval99.5%
associate-*r/99.5%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
un-div-inv99.5%
tan-quot99.6%
clear-num99.6%
tan-quot99.5%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (tan x) (tan eps))))
(-
(/ (/ (sin eps) (cos eps)) (- 1.0 t_0))
(/ t_0 (/ (+ -1.0 t_0) (tan x))))))
double code(double x, double eps) {
double t_0 = tan(x) * tan(eps);
return ((sin(eps) / cos(eps)) / (1.0 - t_0)) - (t_0 / ((-1.0 + t_0) / tan(x)));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
t_0 = tan(x) * tan(eps)
code = ((sin(eps) / cos(eps)) / (1.0d0 - t_0)) - (t_0 / (((-1.0d0) + t_0) / tan(x)))
end function
public static double code(double x, double eps) {
double t_0 = Math.tan(x) * Math.tan(eps);
return ((Math.sin(eps) / Math.cos(eps)) / (1.0 - t_0)) - (t_0 / ((-1.0 + t_0) / Math.tan(x)));
}
def code(x, eps): t_0 = math.tan(x) * math.tan(eps) return ((math.sin(eps) / math.cos(eps)) / (1.0 - t_0)) - (t_0 / ((-1.0 + t_0) / math.tan(x)))
function code(x, eps) t_0 = Float64(tan(x) * tan(eps)) return Float64(Float64(Float64(sin(eps) / cos(eps)) / Float64(1.0 - t_0)) - Float64(t_0 / Float64(Float64(-1.0 + t_0) / tan(x)))) end
function tmp = code(x, eps) t_0 = tan(x) * tan(eps); tmp = ((sin(eps) / cos(eps)) / (1.0 - t_0)) - (t_0 / ((-1.0 + t_0) / tan(x))); end
code[x_, eps_] := Block[{t$95$0 = N[(N[Tan[x], $MachinePrecision] * N[Tan[eps], $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[Sin[eps], $MachinePrecision] / N[Cos[eps], $MachinePrecision]), $MachinePrecision] / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 / N[(N[(-1.0 + t$95$0), $MachinePrecision] / N[Tan[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan x \cdot \tan \varepsilon\\
\frac{\frac{\sin \varepsilon}{\cos \varepsilon}}{1 - t_0} - \frac{t_0}{\frac{-1 + t_0}{\tan x}}
\end{array}
\end{array}
Initial program 45.0%
tan-sum66.6%
div-inv66.6%
*-un-lft-identity66.6%
prod-diff66.6%
*-commutative66.6%
*-un-lft-identity66.6%
*-commutative66.6%
*-un-lft-identity66.6%
Applied egg-rr66.6%
+-commutative66.6%
fma-udef66.6%
associate-+r+66.6%
unsub-neg66.6%
Simplified66.6%
Taylor expanded in x around inf 66.4%
associate--l+80.5%
associate-/r*80.5%
times-frac80.5%
Simplified80.6%
frac-2neg80.6%
clear-num77.6%
frac-sub76.6%
Applied egg-rr77.4%
cancel-sign-sub77.4%
distribute-lft-neg-out77.4%
rgt-mult-inverse80.6%
metadata-eval80.6%
*-rgt-identity80.6%
sub-neg80.6%
distribute-rgt-neg-out80.6%
associate-+r+99.5%
metadata-eval99.5%
associate-*r/99.5%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
un-div-inv99.5%
tan-quot99.6%
clear-num99.6%
tan-quot99.5%
Applied egg-rr99.5%
associate-/r/99.5%
/-rgt-identity99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- 1.0 (* (tan x) (tan eps)))) (t_1 (+ (tan x) (tan eps))))
(if (<= eps -6.2e-7)
(- (/ t_1 (- 1.0 (/ (* (tan eps) (sin x)) (cos x)))) (tan x))
(if (<= eps 4.5e-7)
(* (/ eps t_0) (/ (+ (cos x) (* (tan x) (sin x))) (cos x)))
(fma t_1 (/ 1.0 t_0) (- (tan x)))))))
double code(double x, double eps) {
double t_0 = 1.0 - (tan(x) * tan(eps));
double t_1 = tan(x) + tan(eps);
double tmp;
if (eps <= -6.2e-7) {
tmp = (t_1 / (1.0 - ((tan(eps) * sin(x)) / cos(x)))) - tan(x);
} else if (eps <= 4.5e-7) {
tmp = (eps / t_0) * ((cos(x) + (tan(x) * sin(x))) / cos(x));
} else {
tmp = fma(t_1, (1.0 / t_0), -tan(x));
}
return tmp;
}
function code(x, eps) t_0 = Float64(1.0 - Float64(tan(x) * tan(eps))) t_1 = Float64(tan(x) + tan(eps)) tmp = 0.0 if (eps <= -6.2e-7) tmp = Float64(Float64(t_1 / Float64(1.0 - Float64(Float64(tan(eps) * sin(x)) / cos(x)))) - tan(x)); elseif (eps <= 4.5e-7) tmp = Float64(Float64(eps / t_0) * Float64(Float64(cos(x) + Float64(tan(x) * sin(x))) / cos(x))); else tmp = fma(t_1, Float64(1.0 / t_0), Float64(-tan(x))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(1.0 - N[(N[Tan[x], $MachinePrecision] * N[Tan[eps], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Tan[x], $MachinePrecision] + N[Tan[eps], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps, -6.2e-7], N[(N[(t$95$1 / N[(1.0 - N[(N[(N[Tan[eps], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[eps, 4.5e-7], N[(N[(eps / t$95$0), $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] + N[(N[Tan[x], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(1.0 / t$95$0), $MachinePrecision] + (-N[Tan[x], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \tan x \cdot \tan \varepsilon\\
t_1 := \tan x + \tan \varepsilon\\
\mathbf{if}\;\varepsilon \leq -6.2 \cdot 10^{-7}:\\
\;\;\;\;\frac{t_1}{1 - \frac{\tan \varepsilon \cdot \sin x}{\cos x}} - \tan x\\
\mathbf{elif}\;\varepsilon \leq 4.5 \cdot 10^{-7}:\\
\;\;\;\;\frac{\varepsilon}{t_0} \cdot \frac{\cos x + \tan x \cdot \sin x}{\cos x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t_1, \frac{1}{t_0}, -\tan x\right)\\
\end{array}
\end{array}
if eps < -6.1999999999999999e-7Initial program 58.9%
tan-sum99.3%
div-inv99.3%
*-un-lft-identity99.3%
prod-diff99.3%
*-commutative99.3%
*-un-lft-identity99.3%
*-commutative99.3%
*-un-lft-identity99.3%
Applied egg-rr99.3%
+-commutative99.3%
fma-udef99.3%
associate-+r+99.3%
unsub-neg99.3%
Simplified99.3%
*-commutative99.3%
tan-quot99.4%
associate-*r/99.4%
Applied egg-rr99.4%
if -6.1999999999999999e-7 < eps < 4.4999999999999998e-7Initial program 29.6%
tan-sum31.1%
tan-quot30.7%
frac-sub30.6%
Applied egg-rr30.6%
Taylor expanded in eps around 0 99.5%
cancel-sign-sub-inv99.5%
metadata-eval99.5%
*-lft-identity99.5%
Simplified99.5%
times-frac99.5%
unpow299.5%
*-un-lft-identity99.5%
times-frac99.5%
tan-quot99.5%
Applied egg-rr99.5%
/-rgt-identity99.5%
Simplified99.5%
if 4.4999999999999998e-7 < eps Initial program 59.5%
tan-sum99.6%
div-inv99.6%
*-un-lft-identity99.6%
prod-diff99.6%
*-commutative99.6%
*-un-lft-identity99.6%
*-commutative99.6%
*-un-lft-identity99.6%
Applied egg-rr99.6%
+-commutative99.6%
fma-udef99.6%
associate-+r+99.6%
unsub-neg99.6%
Simplified99.6%
div-inv99.6%
fma-neg99.6%
Applied egg-rr99.6%
Final simplification99.5%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (+ (tan x) (tan eps))) (t_1 (- 1.0 (* (tan x) (tan eps)))))
(if (<= eps -4.4e-9)
(- (/ t_0 t_1) (tan x))
(if (<= eps 3.1e-9)
(/ eps (/ (cos x) (fma (sin x) (tan x) (cos x))))
(fma t_0 (/ 1.0 t_1) (- (tan x)))))))
double code(double x, double eps) {
double t_0 = tan(x) + tan(eps);
double t_1 = 1.0 - (tan(x) * tan(eps));
double tmp;
if (eps <= -4.4e-9) {
tmp = (t_0 / t_1) - tan(x);
} else if (eps <= 3.1e-9) {
tmp = eps / (cos(x) / fma(sin(x), tan(x), cos(x)));
} else {
tmp = fma(t_0, (1.0 / t_1), -tan(x));
}
return tmp;
}
function code(x, eps) t_0 = Float64(tan(x) + tan(eps)) t_1 = Float64(1.0 - Float64(tan(x) * tan(eps))) tmp = 0.0 if (eps <= -4.4e-9) tmp = Float64(Float64(t_0 / t_1) - tan(x)); elseif (eps <= 3.1e-9) tmp = Float64(eps / Float64(cos(x) / fma(sin(x), tan(x), cos(x)))); else tmp = fma(t_0, Float64(1.0 / t_1), Float64(-tan(x))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Tan[x], $MachinePrecision] + N[Tan[eps], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(N[Tan[x], $MachinePrecision] * N[Tan[eps], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps, -4.4e-9], N[(N[(t$95$0 / t$95$1), $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[eps, 3.1e-9], N[(eps / N[(N[Cos[x], $MachinePrecision] / N[(N[Sin[x], $MachinePrecision] * N[Tan[x], $MachinePrecision] + N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 / t$95$1), $MachinePrecision] + (-N[Tan[x], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan x + \tan \varepsilon\\
t_1 := 1 - \tan x \cdot \tan \varepsilon\\
\mathbf{if}\;\varepsilon \leq -4.4 \cdot 10^{-9}:\\
\;\;\;\;\frac{t_0}{t_1} - \tan x\\
\mathbf{elif}\;\varepsilon \leq 3.1 \cdot 10^{-9}:\\
\;\;\;\;\frac{\varepsilon}{\frac{\cos x}{\mathsf{fma}\left(\sin x, \tan x, \cos x\right)}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t_0, \frac{1}{t_1}, -\tan x\right)\\
\end{array}
\end{array}
if eps < -4.3999999999999997e-9Initial program 58.2%
tan-sum98.9%
div-inv98.9%
*-un-lft-identity98.9%
prod-diff98.9%
*-commutative98.9%
*-un-lft-identity98.9%
*-commutative98.9%
*-un-lft-identity98.9%
Applied egg-rr98.9%
+-commutative98.9%
fma-udef98.9%
associate-+r+98.9%
unsub-neg98.9%
Simplified98.9%
if -4.3999999999999997e-9 < eps < 3.10000000000000005e-9Initial program 29.8%
tan-sum30.8%
tan-quot30.4%
frac-sub30.3%
Applied egg-rr30.3%
Taylor expanded in eps around 0 98.9%
associate-/l*98.9%
cancel-sign-sub-inv98.9%
metadata-eval98.9%
*-lft-identity98.9%
Simplified98.9%
expm1-log1p-u98.8%
expm1-udef98.2%
unpow298.2%
*-un-lft-identity98.2%
times-frac98.2%
tan-quot98.2%
Applied egg-rr98.2%
expm1-def98.9%
expm1-log1p99.0%
+-commutative99.0%
/-rgt-identity99.0%
fma-def99.1%
Simplified99.1%
if 3.10000000000000005e-9 < eps Initial program 59.5%
tan-sum99.6%
div-inv99.6%
*-un-lft-identity99.6%
prod-diff99.6%
*-commutative99.6%
*-un-lft-identity99.6%
*-commutative99.6%
*-un-lft-identity99.6%
Applied egg-rr99.6%
+-commutative99.6%
fma-udef99.6%
associate-+r+99.6%
unsub-neg99.6%
Simplified99.6%
div-inv99.6%
fma-neg99.6%
Applied egg-rr99.6%
Final simplification99.2%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (+ (tan x) (tan eps))))
(if (<= eps -2.7e-9)
(- (/ t_0 (- 1.0 (/ (* (tan eps) (sin x)) (cos x)))) (tan x))
(if (<= eps 5.2e-9)
(/ eps (/ (cos x) (fma (sin x) (tan x) (cos x))))
(fma t_0 (/ 1.0 (- 1.0 (* (tan x) (tan eps)))) (- (tan x)))))))
double code(double x, double eps) {
double t_0 = tan(x) + tan(eps);
double tmp;
if (eps <= -2.7e-9) {
tmp = (t_0 / (1.0 - ((tan(eps) * sin(x)) / cos(x)))) - tan(x);
} else if (eps <= 5.2e-9) {
tmp = eps / (cos(x) / fma(sin(x), tan(x), cos(x)));
} else {
tmp = fma(t_0, (1.0 / (1.0 - (tan(x) * tan(eps)))), -tan(x));
}
return tmp;
}
function code(x, eps) t_0 = Float64(tan(x) + tan(eps)) tmp = 0.0 if (eps <= -2.7e-9) tmp = Float64(Float64(t_0 / Float64(1.0 - Float64(Float64(tan(eps) * sin(x)) / cos(x)))) - tan(x)); elseif (eps <= 5.2e-9) tmp = Float64(eps / Float64(cos(x) / fma(sin(x), tan(x), cos(x)))); else tmp = fma(t_0, Float64(1.0 / Float64(1.0 - Float64(tan(x) * tan(eps)))), Float64(-tan(x))); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Tan[x], $MachinePrecision] + N[Tan[eps], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps, -2.7e-9], N[(N[(t$95$0 / N[(1.0 - N[(N[(N[Tan[eps], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[eps, 5.2e-9], N[(eps / N[(N[Cos[x], $MachinePrecision] / N[(N[Sin[x], $MachinePrecision] * N[Tan[x], $MachinePrecision] + N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 / N[(1.0 - N[(N[Tan[x], $MachinePrecision] * N[Tan[eps], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-N[Tan[x], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan x + \tan \varepsilon\\
\mathbf{if}\;\varepsilon \leq -2.7 \cdot 10^{-9}:\\
\;\;\;\;\frac{t_0}{1 - \frac{\tan \varepsilon \cdot \sin x}{\cos x}} - \tan x\\
\mathbf{elif}\;\varepsilon \leq 5.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{\varepsilon}{\frac{\cos x}{\mathsf{fma}\left(\sin x, \tan x, \cos x\right)}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t_0, \frac{1}{1 - \tan x \cdot \tan \varepsilon}, -\tan x\right)\\
\end{array}
\end{array}
if eps < -2.7000000000000002e-9Initial program 58.2%
tan-sum98.9%
div-inv98.9%
*-un-lft-identity98.9%
prod-diff98.9%
*-commutative98.9%
*-un-lft-identity98.9%
*-commutative98.9%
*-un-lft-identity98.9%
Applied egg-rr98.9%
+-commutative98.9%
fma-udef98.9%
associate-+r+98.9%
unsub-neg98.9%
Simplified98.9%
*-commutative98.9%
tan-quot98.9%
associate-*r/98.9%
Applied egg-rr98.9%
if -2.7000000000000002e-9 < eps < 5.2000000000000002e-9Initial program 29.8%
tan-sum30.8%
tan-quot30.4%
frac-sub30.3%
Applied egg-rr30.3%
Taylor expanded in eps around 0 98.9%
associate-/l*98.9%
cancel-sign-sub-inv98.9%
metadata-eval98.9%
*-lft-identity98.9%
Simplified98.9%
expm1-log1p-u98.8%
expm1-udef98.2%
unpow298.2%
*-un-lft-identity98.2%
times-frac98.2%
tan-quot98.2%
Applied egg-rr98.2%
expm1-def98.9%
expm1-log1p99.0%
+-commutative99.0%
/-rgt-identity99.0%
fma-def99.1%
Simplified99.1%
if 5.2000000000000002e-9 < eps Initial program 59.5%
tan-sum99.6%
div-inv99.6%
*-un-lft-identity99.6%
prod-diff99.6%
*-commutative99.6%
*-un-lft-identity99.6%
*-commutative99.6%
*-un-lft-identity99.6%
Applied egg-rr99.6%
+-commutative99.6%
fma-udef99.6%
associate-+r+99.6%
unsub-neg99.6%
Simplified99.6%
div-inv99.6%
fma-neg99.6%
Applied egg-rr99.6%
Final simplification99.2%
(FPCore (x eps) :precision binary64 (if (or (<= eps -1.35e-9) (not (<= eps 2.3e-9))) (- (/ (+ (tan x) (tan eps)) (- 1.0 (* (tan x) (tan eps)))) (tan x)) (/ eps (/ (cos x) (fma (sin x) (tan x) (cos x))))))
double code(double x, double eps) {
double tmp;
if ((eps <= -1.35e-9) || !(eps <= 2.3e-9)) {
tmp = ((tan(x) + tan(eps)) / (1.0 - (tan(x) * tan(eps)))) - tan(x);
} else {
tmp = eps / (cos(x) / fma(sin(x), tan(x), cos(x)));
}
return tmp;
}
function code(x, eps) tmp = 0.0 if ((eps <= -1.35e-9) || !(eps <= 2.3e-9)) tmp = Float64(Float64(Float64(tan(x) + tan(eps)) / Float64(1.0 - Float64(tan(x) * tan(eps)))) - tan(x)); else tmp = Float64(eps / Float64(cos(x) / fma(sin(x), tan(x), cos(x)))); end return tmp end
code[x_, eps_] := If[Or[LessEqual[eps, -1.35e-9], N[Not[LessEqual[eps, 2.3e-9]], $MachinePrecision]], N[(N[(N[(N[Tan[x], $MachinePrecision] + N[Tan[eps], $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[Tan[x], $MachinePrecision] * N[Tan[eps], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision], N[(eps / N[(N[Cos[x], $MachinePrecision] / N[(N[Sin[x], $MachinePrecision] * N[Tan[x], $MachinePrecision] + N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\varepsilon \leq -1.35 \cdot 10^{-9} \lor \neg \left(\varepsilon \leq 2.3 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{\tan x + \tan \varepsilon}{1 - \tan x \cdot \tan \varepsilon} - \tan x\\
\mathbf{else}:\\
\;\;\;\;\frac{\varepsilon}{\frac{\cos x}{\mathsf{fma}\left(\sin x, \tan x, \cos x\right)}}\\
\end{array}
\end{array}
if eps < -1.3500000000000001e-9 or 2.2999999999999999e-9 < eps Initial program 58.8%
tan-sum99.2%
div-inv99.2%
*-un-lft-identity99.2%
prod-diff99.2%
*-commutative99.2%
*-un-lft-identity99.2%
*-commutative99.2%
*-un-lft-identity99.2%
Applied egg-rr99.2%
+-commutative99.2%
fma-udef99.2%
associate-+r+99.2%
unsub-neg99.2%
Simplified99.2%
if -1.3500000000000001e-9 < eps < 2.2999999999999999e-9Initial program 29.8%
tan-sum30.8%
tan-quot30.4%
frac-sub30.3%
Applied egg-rr30.3%
Taylor expanded in eps around 0 98.9%
associate-/l*98.9%
cancel-sign-sub-inv98.9%
metadata-eval98.9%
*-lft-identity98.9%
Simplified98.9%
expm1-log1p-u98.8%
expm1-udef98.2%
unpow298.2%
*-un-lft-identity98.2%
times-frac98.2%
tan-quot98.2%
Applied egg-rr98.2%
expm1-def98.9%
expm1-log1p99.0%
+-commutative99.0%
/-rgt-identity99.0%
fma-def99.1%
Simplified99.1%
Final simplification99.2%
(FPCore (x eps) :precision binary64 (if (or (<= eps -0.0082) (not (<= eps 1.22e-5))) (- (tan eps) (tan x)) (/ eps (/ (cos x) (fma (sin x) (tan x) (cos x))))))
double code(double x, double eps) {
double tmp;
if ((eps <= -0.0082) || !(eps <= 1.22e-5)) {
tmp = tan(eps) - tan(x);
} else {
tmp = eps / (cos(x) / fma(sin(x), tan(x), cos(x)));
}
return tmp;
}
function code(x, eps) tmp = 0.0 if ((eps <= -0.0082) || !(eps <= 1.22e-5)) tmp = Float64(tan(eps) - tan(x)); else tmp = Float64(eps / Float64(cos(x) / fma(sin(x), tan(x), cos(x)))); end return tmp end
code[x_, eps_] := If[Or[LessEqual[eps, -0.0082], N[Not[LessEqual[eps, 1.22e-5]], $MachinePrecision]], N[(N[Tan[eps], $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision], N[(eps / N[(N[Cos[x], $MachinePrecision] / N[(N[Sin[x], $MachinePrecision] * N[Tan[x], $MachinePrecision] + N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\varepsilon \leq -0.0082 \lor \neg \left(\varepsilon \leq 1.22 \cdot 10^{-5}\right):\\
\;\;\;\;\tan \varepsilon - \tan x\\
\mathbf{else}:\\
\;\;\;\;\frac{\varepsilon}{\frac{\cos x}{\mathsf{fma}\left(\sin x, \tan x, \cos x\right)}}\\
\end{array}
\end{array}
if eps < -0.00820000000000000069 or 1.22000000000000001e-5 < eps Initial program 59.6%
expm1-log1p-u44.9%
Applied egg-rr44.9%
Taylor expanded in x around 0 46.6%
log1p-def46.7%
Simplified46.7%
expm1-log1p-u62.0%
tan-quot62.0%
sub-neg62.0%
tan-quot62.3%
tan-quot62.3%
Applied egg-rr62.3%
sub-neg62.3%
Simplified62.3%
if -0.00820000000000000069 < eps < 1.22000000000000001e-5Initial program 29.4%
tan-sum31.6%
tan-quot31.2%
frac-sub31.1%
Applied egg-rr31.1%
Taylor expanded in eps around 0 97.9%
associate-/l*98.0%
cancel-sign-sub-inv98.0%
metadata-eval98.0%
*-lft-identity98.0%
Simplified98.0%
expm1-log1p-u97.9%
expm1-udef97.2%
unpow297.2%
*-un-lft-identity97.2%
times-frac97.2%
tan-quot97.2%
Applied egg-rr97.2%
expm1-def97.9%
expm1-log1p98.0%
+-commutative98.0%
/-rgt-identity98.0%
fma-def98.1%
Simplified98.1%
Final simplification79.6%
(FPCore (x eps) :precision binary64 (if (or (<= eps -0.009) (not (<= eps 2e-5))) (- (tan eps) (tan x)) (* eps (+ 1.0 (/ (pow (sin x) 2.0) (pow (cos x) 2.0))))))
double code(double x, double eps) {
double tmp;
if ((eps <= -0.009) || !(eps <= 2e-5)) {
tmp = tan(eps) - tan(x);
} else {
tmp = eps * (1.0 + (pow(sin(x), 2.0) / pow(cos(x), 2.0)));
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if ((eps <= (-0.009d0)) .or. (.not. (eps <= 2d-5))) then
tmp = tan(eps) - tan(x)
else
tmp = eps * (1.0d0 + ((sin(x) ** 2.0d0) / (cos(x) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if ((eps <= -0.009) || !(eps <= 2e-5)) {
tmp = Math.tan(eps) - Math.tan(x);
} else {
tmp = eps * (1.0 + (Math.pow(Math.sin(x), 2.0) / Math.pow(Math.cos(x), 2.0)));
}
return tmp;
}
def code(x, eps): tmp = 0 if (eps <= -0.009) or not (eps <= 2e-5): tmp = math.tan(eps) - math.tan(x) else: tmp = eps * (1.0 + (math.pow(math.sin(x), 2.0) / math.pow(math.cos(x), 2.0))) return tmp
function code(x, eps) tmp = 0.0 if ((eps <= -0.009) || !(eps <= 2e-5)) tmp = Float64(tan(eps) - tan(x)); else tmp = Float64(eps * Float64(1.0 + Float64((sin(x) ^ 2.0) / (cos(x) ^ 2.0)))); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if ((eps <= -0.009) || ~((eps <= 2e-5))) tmp = tan(eps) - tan(x); else tmp = eps * (1.0 + ((sin(x) ^ 2.0) / (cos(x) ^ 2.0))); end tmp_2 = tmp; end
code[x_, eps_] := If[Or[LessEqual[eps, -0.009], N[Not[LessEqual[eps, 2e-5]], $MachinePrecision]], N[(N[Tan[eps], $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision], N[(eps * N[(1.0 + N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[N[Cos[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\varepsilon \leq -0.009 \lor \neg \left(\varepsilon \leq 2 \cdot 10^{-5}\right):\\
\;\;\;\;\tan \varepsilon - \tan x\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(1 + \frac{{\sin x}^{2}}{{\cos x}^{2}}\right)\\
\end{array}
\end{array}
if eps < -0.00899999999999999932 or 2.00000000000000016e-5 < eps Initial program 59.6%
expm1-log1p-u44.9%
Applied egg-rr44.9%
Taylor expanded in x around 0 46.6%
log1p-def46.7%
Simplified46.7%
expm1-log1p-u62.0%
tan-quot62.0%
sub-neg62.0%
tan-quot62.3%
tan-quot62.3%
Applied egg-rr62.3%
sub-neg62.3%
Simplified62.3%
if -0.00899999999999999932 < eps < 2.00000000000000016e-5Initial program 29.4%
Taylor expanded in eps around 0 97.9%
cancel-sign-sub-inv97.9%
metadata-eval97.9%
*-lft-identity97.9%
Simplified97.9%
Final simplification79.5%
(FPCore (x eps) :precision binary64 (if (or (<= eps -0.0082) (not (<= eps 2.7e-5))) (- (tan eps) (tan x)) (/ eps (/ (cos x) (+ (cos x) (* (tan x) (sin x)))))))
double code(double x, double eps) {
double tmp;
if ((eps <= -0.0082) || !(eps <= 2.7e-5)) {
tmp = tan(eps) - tan(x);
} else {
tmp = eps / (cos(x) / (cos(x) + (tan(x) * sin(x))));
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if ((eps <= (-0.0082d0)) .or. (.not. (eps <= 2.7d-5))) then
tmp = tan(eps) - tan(x)
else
tmp = eps / (cos(x) / (cos(x) + (tan(x) * sin(x))))
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if ((eps <= -0.0082) || !(eps <= 2.7e-5)) {
tmp = Math.tan(eps) - Math.tan(x);
} else {
tmp = eps / (Math.cos(x) / (Math.cos(x) + (Math.tan(x) * Math.sin(x))));
}
return tmp;
}
def code(x, eps): tmp = 0 if (eps <= -0.0082) or not (eps <= 2.7e-5): tmp = math.tan(eps) - math.tan(x) else: tmp = eps / (math.cos(x) / (math.cos(x) + (math.tan(x) * math.sin(x)))) return tmp
function code(x, eps) tmp = 0.0 if ((eps <= -0.0082) || !(eps <= 2.7e-5)) tmp = Float64(tan(eps) - tan(x)); else tmp = Float64(eps / Float64(cos(x) / Float64(cos(x) + Float64(tan(x) * sin(x))))); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if ((eps <= -0.0082) || ~((eps <= 2.7e-5))) tmp = tan(eps) - tan(x); else tmp = eps / (cos(x) / (cos(x) + (tan(x) * sin(x)))); end tmp_2 = tmp; end
code[x_, eps_] := If[Or[LessEqual[eps, -0.0082], N[Not[LessEqual[eps, 2.7e-5]], $MachinePrecision]], N[(N[Tan[eps], $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision], N[(eps / N[(N[Cos[x], $MachinePrecision] / N[(N[Cos[x], $MachinePrecision] + N[(N[Tan[x], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\varepsilon \leq -0.0082 \lor \neg \left(\varepsilon \leq 2.7 \cdot 10^{-5}\right):\\
\;\;\;\;\tan \varepsilon - \tan x\\
\mathbf{else}:\\
\;\;\;\;\frac{\varepsilon}{\frac{\cos x}{\cos x + \tan x \cdot \sin x}}\\
\end{array}
\end{array}
if eps < -0.00820000000000000069 or 2.6999999999999999e-5 < eps Initial program 59.6%
expm1-log1p-u44.9%
Applied egg-rr44.9%
Taylor expanded in x around 0 46.6%
log1p-def46.7%
Simplified46.7%
expm1-log1p-u62.0%
tan-quot62.0%
sub-neg62.0%
tan-quot62.3%
tan-quot62.3%
Applied egg-rr62.3%
sub-neg62.3%
Simplified62.3%
if -0.00820000000000000069 < eps < 2.6999999999999999e-5Initial program 29.4%
tan-sum31.6%
tan-quot31.2%
frac-sub31.1%
Applied egg-rr31.1%
Taylor expanded in eps around 0 97.9%
associate-/l*98.0%
cancel-sign-sub-inv98.0%
metadata-eval98.0%
*-lft-identity98.0%
Simplified98.0%
expm1-log1p-u97.9%
expm1-udef97.2%
unpow297.2%
*-un-lft-identity97.2%
times-frac97.2%
tan-quot97.2%
Applied egg-rr97.2%
expm1-def97.9%
expm1-log1p98.0%
/-rgt-identity98.0%
Simplified98.0%
Final simplification79.6%
(FPCore (x eps) :precision binary64 (tan eps))
double code(double x, double eps) {
return tan(eps);
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = tan(eps)
end function
public static double code(double x, double eps) {
return Math.tan(eps);
}
def code(x, eps): return math.tan(eps)
function code(x, eps) return tan(eps) end
function tmp = code(x, eps) tmp = tan(eps); end
code[x_, eps_] := N[Tan[eps], $MachinePrecision]
\begin{array}{l}
\\
\tan \varepsilon
\end{array}
Initial program 45.0%
Taylor expanded in x around 0 60.1%
tan-quot60.3%
expm1-log1p-u52.6%
expm1-udef27.4%
Applied egg-rr27.4%
expm1-def52.6%
expm1-log1p60.3%
Simplified60.3%
Final simplification60.3%
(FPCore (x eps) :precision binary64 eps)
double code(double x, double eps) {
return eps;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = eps
end function
public static double code(double x, double eps) {
return eps;
}
def code(x, eps): return eps
function code(x, eps) return eps end
function tmp = code(x, eps) tmp = eps; end
code[x_, eps_] := eps
\begin{array}{l}
\\
\varepsilon
\end{array}
Initial program 45.0%
Taylor expanded in x around 0 60.1%
Taylor expanded in eps around 0 30.1%
Final simplification30.1%
(FPCore (x eps) :precision binary64 (/ (sin eps) (* (cos x) (cos (+ x eps)))))
double code(double x, double eps) {
return sin(eps) / (cos(x) * cos((x + eps)));
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = sin(eps) / (cos(x) * cos((x + eps)))
end function
public static double code(double x, double eps) {
return Math.sin(eps) / (Math.cos(x) * Math.cos((x + eps)));
}
def code(x, eps): return math.sin(eps) / (math.cos(x) * math.cos((x + eps)))
function code(x, eps) return Float64(sin(eps) / Float64(cos(x) * cos(Float64(x + eps)))) end
function tmp = code(x, eps) tmp = sin(eps) / (cos(x) * cos((x + eps))); end
code[x_, eps_] := N[(N[Sin[eps], $MachinePrecision] / N[(N[Cos[x], $MachinePrecision] * N[Cos[N[(x + eps), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin \varepsilon}{\cos x \cdot \cos \left(x + \varepsilon\right)}
\end{array}
herbie shell --seed 2024010
(FPCore (x eps)
:name "2tan (problem 3.3.2)"
:precision binary64
:herbie-target
(/ (sin eps) (* (cos x) (cos (+ x eps))))
(- (tan (+ x eps)) (tan x)))