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

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

\end{array}
double f(double x) {
        double r18363 = x;
        double r18364 = sin(r18363);
        double r18365 = r18363 - r18364;
        double r18366 = tan(r18363);
        double r18367 = r18363 - r18366;
        double r18368 = r18365 / r18367;
        return r18368;
}

double f(double x) {
        double r18369 = x;
        double r18370 = -0.029656023299900573;
        bool r18371 = r18369 <= r18370;
        double r18372 = 0.02964489669427243;
        bool r18373 = r18369 <= r18372;
        double r18374 = !r18373;
        bool r18375 = r18371 || r18374;
        double r18376 = sin(r18369);
        double r18377 = r18369 - r18376;
        double r18378 = tan(r18369);
        double r18379 = r18369 - r18378;
        double r18380 = r18377 / r18379;
        double r18381 = 0.225;
        double r18382 = r18369 * r18369;
        double r18383 = r18381 * r18382;
        double r18384 = 0.5;
        double r18385 = r18383 - r18384;
        double r18386 = 0.009642857142857142;
        double r18387 = 4.0;
        double r18388 = pow(r18369, r18387);
        double r18389 = r18386 * r18388;
        double r18390 = r18385 - r18389;
        double r18391 = r18375 ? r18380 : r18390;
        return r18391;
}

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.029656023299900573 or 0.02964489669427243 < x

    1. Initial program 0.0

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

    if -0.029656023299900573 < x < 0.02964489669427243

    1. Initial program 63.2

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied div-sub63.1

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]
    4. 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)}\]
    5. Simplified0.0

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

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

Reproduce

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