\frac{x - \sin x}{x - \tan x}\begin{array}{l}
\mathbf{if}\;x \leq -0.02561464791998105:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\
\mathbf{elif}\;x \leq 0.03192922868605998:\\
\;\;\;\;\left(\left(x \cdot x\right) \cdot 0.225 - 0.5\right) - \log \left(e^{0.009642857142857142 \cdot {x}^{4}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin x}}\\
\end{array}(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x)
:precision binary64
(if (<= x -0.02561464791998105)
(cbrt (pow (/ (- x (sin x)) (- x (tan x))) 3.0))
(if (<= x 0.03192922868605998)
(-
(- (* (* x x) 0.225) 0.5)
(log (exp (* 0.009642857142857142 (pow x 4.0)))))
(/ 1.0 (/ (- x (tan x)) (- x (sin x)))))))double code(double x) {
return (x - sin(x)) / (x - tan(x));
}
double code(double x) {
double tmp;
if (x <= -0.02561464791998105) {
tmp = cbrt(pow(((x - sin(x)) / (x - tan(x))), 3.0));
} else if (x <= 0.03192922868605998) {
tmp = (((x * x) * 0.225) - 0.5) - log(exp(0.009642857142857142 * pow(x, 4.0)));
} else {
tmp = 1.0 / ((x - tan(x)) / (x - sin(x)));
}
return tmp;
}








Bits error versus x
Results
| Alternative 1 | |
|---|---|
| Accuracy | 0.0 |
| Cost | 1346 |
| Alternative 2 | |
|---|---|
| Accuracy | 0.0 |
| Cost | 1922 |
| Alternative 3 | |
|---|---|
| Accuracy | 0.0 |
| Cost | 1860 |
| Alternative 4 | |
|---|---|
| Accuracy | 0.0 |
| Cost | 1156 |
| Alternative 5 | |
|---|---|
| Accuracy | 31.1 |
| Cost | 576 |
if x < -0.0256146479199810505Initial program 0.0
rmApplied add-cbrt-cube_binary640.1
Simplified0.1
if -0.0256146479199810505 < x < 0.031929228686059977Initial program 63.3
Taylor expanded around 0 0.0
Simplified0.0
rmApplied associate--r+_binary640.0
rmApplied add-log-exp_binary640.0
if 0.031929228686059977 < x Initial program 0.0
rmApplied clear-num_binary640.0
Final simplification0.0
herbie shell --seed 2020322
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))