\frac{x - \sin x}{x - \tan x}\begin{array}{l}
\mathbf{if}\;x \leq -0.03145921990197293:\\
\;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\
\mathbf{elif}\;x \leq 0.028382328502402018:\\
\;\;\;\;\left(x \cdot x\right) \cdot 0.225 - \left(0.5 + {x}^{4} \cdot 0.009642857142857142\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\
\end{array}(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x)
:precision binary64
(if (<= x -0.03145921990197293)
(- (/ x (- x (tan x))) (/ (sin x) (- x (tan x))))
(if (<= x 0.028382328502402018)
(- (* (* x x) 0.225) (+ 0.5 (* (pow x 4.0) 0.009642857142857142)))
(log (exp (/ (- x (sin x)) (- x (tan x))))))))double code(double x) {
return (x - sin(x)) / (x - tan(x));
}
double code(double x) {
double tmp;
if (x <= -0.03145921990197293) {
tmp = (x / (x - tan(x))) - (sin(x) / (x - tan(x)));
} else if (x <= 0.028382328502402018) {
tmp = ((x * x) * 0.225) - (0.5 + (pow(x, 4.0) * 0.009642857142857142));
} else {
tmp = log(exp((x - sin(x)) / (x - tan(x))));
}
return tmp;
}












Bits error versus x
Results
| Alternative 1 | |
|---|---|
| Error | 0.0 |
| Cost | 20225 |
| Alternative 2 | |
|---|---|
| Error | 0.0 |
| Cost | 13576 |
| Alternative 3 | |
|---|---|
| Error | 0.7 |
| Cost | 7810 |
| Alternative 4 | |
|---|---|
| Error | 0.7 |
| Cost | 7810 |
| Alternative 5 | |
|---|---|
| Error | 0.8 |
| Cost | 7041 |
| Alternative 6 | |
|---|---|
| Error | 0.8 |
| Cost | 7041 |
| Alternative 7 | |
|---|---|
| Error | 0.8 |
| Cost | 1090 |
| Alternative 8 | |
|---|---|
| Error | 1.0 |
| Cost | 706 |
| Alternative 9 | |
|---|---|
| Error | 32.1 |
| Cost | 64 |


if x < -0.0314592199019729304Initial program 0.0
rmApplied div-sub_binary640.0
Simplified0.0
if -0.0314592199019729304 < x < 0.0283823285024020176Initial program 63.3
rmApplied flip3--_binary6463.4
Applied associate-/r/_binary6463.4
Taylor expanded around 0 0.0
Simplified0.0
Simplified0.0
if 0.0283823285024020176 < x Initial program 0.1
rmApplied add-log-exp_binary640.1
Simplified0.1
Final simplification0.0
herbie shell --seed 2021040
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))