Average Error: 30.7 → 0.0
Time: 9.8s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.02438907762167830811650404143620107788593 \lor \neg \left(x \le 0.01861232521167046835564029549914266681299\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{else}:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.02438907762167830811650404143620107788593 \lor \neg \left(x \le 0.01861232521167046835564029549914266681299\right):\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\

\mathbf{else}:\\
\;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\

\end{array}
double f(double x) {
        double r14275 = x;
        double r14276 = sin(r14275);
        double r14277 = r14275 - r14276;
        double r14278 = tan(r14275);
        double r14279 = r14275 - r14278;
        double r14280 = r14277 / r14279;
        return r14280;
}

double f(double x) {
        double r14281 = x;
        double r14282 = -0.024389077621678308;
        bool r14283 = r14281 <= r14282;
        double r14284 = 0.01861232521167047;
        bool r14285 = r14281 <= r14284;
        double r14286 = !r14285;
        bool r14287 = r14283 || r14286;
        double r14288 = sin(r14281);
        double r14289 = r14281 - r14288;
        double r14290 = tan(r14281);
        double r14291 = r14281 - r14290;
        double r14292 = r14289 / r14291;
        double r14293 = 0.225;
        double r14294 = 2.0;
        double r14295 = pow(r14281, r14294);
        double r14296 = r14293 * r14295;
        double r14297 = 0.009642857142857142;
        double r14298 = 4.0;
        double r14299 = pow(r14281, r14298);
        double r14300 = r14297 * r14299;
        double r14301 = 0.5;
        double r14302 = r14300 + r14301;
        double r14303 = r14296 - r14302;
        double r14304 = r14287 ? r14292 : r14303;
        return r14304;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < -0.024389077621678308 or 0.01861232521167047 < x

    1. Initial program 0.1

      \[\frac{x - \sin x}{x - \tan x}\]

    if -0.024389077621678308 < x < 0.01861232521167047

    1. Initial program 63.3

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

      \[\leadsto \color{blue}{\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.02438907762167830811650404143620107788593 \lor \neg \left(x \le 0.01861232521167046835564029549914266681299\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{else}:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\ \end{array}\]

Reproduce

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