Average Error: 31.1 → 0.0
Time: 10.1s
Precision: binary64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \leq -0.029101539732209875:\\ \;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\ \mathbf{elif}\;x \leq 0.02423900971992383:\\ \;\;\;\;x \cdot \left(x \cdot 0.225\right) + \left(-0.5 + {x}^{4} \cdot -0.009642857142857142\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \sin x}{x - \frac{\sin x}{\cos x}}\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \leq -0.029101539732209875:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\

\mathbf{elif}\;x \leq 0.02423900971992383:\\
\;\;\;\;x \cdot \left(x \cdot 0.225\right) + \left(-0.5 + {x}^{4} \cdot -0.009642857142857142\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{x - \sin x}{x - \frac{\sin x}{\cos x}}\\

\end{array}
double code(double x) {
	return (((double) (x - ((double) sin(x)))) / ((double) (x - ((double) tan(x)))));
}
double code(double x) {
	double VAR;
	if ((x <= -0.029101539732209875)) {
		VAR = ((double) cbrt(((double) pow((((double) (x - ((double) sin(x)))) / ((double) (x - ((double) tan(x))))), 3.0))));
	} else {
		double VAR_1;
		if ((x <= 0.02423900971992383)) {
			VAR_1 = ((double) (((double) (x * ((double) (x * 0.225)))) + ((double) (-0.5 + ((double) (((double) pow(x, 4.0)) * -0.009642857142857142))))));
		} else {
			VAR_1 = (((double) (x - ((double) sin(x)))) / ((double) (x - (((double) sin(x)) / ((double) cos(x))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if x < -0.0291015397322098752

    1. Initial program 0.1

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied add-cbrt-cube41.7

      \[\leadsto \frac{x - \sin x}{\color{blue}{\sqrt[3]{\left(\left(x - \tan x\right) \cdot \left(x - \tan x\right)\right) \cdot \left(x - \tan x\right)}}}\]
    4. Applied add-cbrt-cube42.9

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\left(x - \sin x\right) \cdot \left(x - \sin x\right)\right) \cdot \left(x - \sin x\right)}}}{\sqrt[3]{\left(\left(x - \tan x\right) \cdot \left(x - \tan x\right)\right) \cdot \left(x - \tan x\right)}}\]
    5. Applied cbrt-undiv42.8

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\left(\left(x - \sin x\right) \cdot \left(x - \sin x\right)\right) \cdot \left(x - \sin x\right)}{\left(\left(x - \tan x\right) \cdot \left(x - \tan x\right)\right) \cdot \left(x - \tan x\right)}}}\]
    6. Simplified0.1

      \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}}\]

    if -0.0291015397322098752 < x < 0.0242390097199238312

    1. Initial program 63.3

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Taylor expanded around 0 0.0

      \[\leadsto \color{blue}{0.225 \cdot {x}^{2} - \left(0.009642857142857142 \cdot {x}^{4} + 0.5\right)}\]
    3. Simplified0.0

      \[\leadsto \color{blue}{x \cdot \left(x \cdot 0.225\right) + \left(-0.5 + {x}^{4} \cdot -0.009642857142857142\right)}\]

    if 0.0242390097199238312 < x

    1. Initial program 0.1

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Taylor expanded around inf 0.1

      \[\leadsto \frac{x - \sin x}{\color{blue}{x - \frac{\sin x}{\cos x}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.029101539732209875:\\ \;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\ \mathbf{elif}\;x \leq 0.02423900971992383:\\ \;\;\;\;x \cdot \left(x \cdot 0.225\right) + \left(-0.5 + {x}^{4} \cdot -0.009642857142857142\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \sin x}{x - \frac{\sin x}{\cos x}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020199 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  :precision binary64
  (/ (- x (sin x)) (- x (tan x))))