\frac{x - \sin x}{x - \tan x}\begin{array}{l}
\mathbf{if}\;x \leq -0.03249701931273373:\\
\;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\
\mathbf{elif}\;x \leq 0.02883492941991452:\\
\;\;\;\;\left(\left(x \cdot x\right) \cdot 0.225 + -0.5\right) - 0.009642857142857142 \cdot {x}^{4}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\frac{x}{x - \tan x}\right)}^{3} - {\left(\frac{\sin x}{x - \tan x}\right)}^{3}}{\frac{x}{x - \tan x} \cdot \frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x} \cdot \left(\frac{x}{x - \tan x} + \frac{\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.03249701931273373)
(- (/ x (- x (tan x))) (/ (sin x) (- x (tan x))))
(if (<= x 0.02883492941991452)
(- (+ (* (* x x) 0.225) -0.5) (* 0.009642857142857142 (pow x 4.0)))
(/
(- (pow (/ x (- x (tan x))) 3.0) (pow (/ (sin x) (- x (tan x))) 3.0))
(+
(* (/ x (- x (tan x))) (/ x (- x (tan x))))
(*
(/ (sin x) (- x (tan x)))
(+ (/ x (- x (tan 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.03249701931273373) {
tmp = (x / (x - tan(x))) - (sin(x) / (x - tan(x)));
} else if (x <= 0.02883492941991452) {
tmp = (((x * x) * 0.225) + -0.5) - (0.009642857142857142 * pow(x, 4.0));
} else {
tmp = (pow((x / (x - tan(x))), 3.0) - pow((sin(x) / (x - tan(x))), 3.0)) / (((x / (x - tan(x))) * (x / (x - tan(x)))) + ((sin(x) / (x - tan(x))) * ((x / (x - tan(x))) + (sin(x) / (x - tan(x))))));
}
return tmp;
}













Bits error versus x
Results
| Alternative 1 | |
|---|---|
| Error | 0.0 |
| Cost | 20232 |
| Alternative 2 | |
|---|---|
| Error | 0.0 |
| Cost | 14018 |
| Alternative 3 | |
|---|---|
| Error | 0.0 |
| Cost | 13576 |
| Alternative 4 | |
|---|---|
| Error | 0.7 |
| Cost | 7496 |
| Alternative 5 | |
|---|---|
| Error | 0.8 |
| Cost | 7048 |
| Alternative 6 | |
|---|---|
| Error | 0.8 |
| Cost | 7041 |
| Alternative 7 | |
|---|---|
| Error | 0.8 |
| Cost | 1090 |
| Alternative 8 | |
|---|---|
| Error | 1.0 |
| Cost | 706 |
| Alternative 9 | |
|---|---|
| Error | 26.3 |
| Cost | 706 |
| Alternative 10 | |
|---|---|
| Error | 31.7 |
| Cost | 64 |

if x < -0.03249701931273373Initial program 0.0
rmApplied div-sub_binary640.1
Simplified0.1
if -0.03249701931273373 < x < 0.0288349294199145186Initial program 63.2
Taylor expanded around 0 0.0
Simplified0.0
rmApplied associate--r+_binary640.0
Simplified0.0
if 0.0288349294199145186 < x Initial program 0.0
rmApplied div-sub_binary640.0
rmApplied flip3--_binary640.0
Simplified0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2021044
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))