Average Error: 31.5 → 0.0
Time: 27.4s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.02464141707269403:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{elif}\;x \le 0.02782498439406133:\\ \;\;\;\;\left(x \cdot x\right) \cdot \frac{9}{40} - \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{27}{2800} + \frac{1}{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.02464141707269403:\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\

\mathbf{elif}\;x \le 0.02782498439406133:\\
\;\;\;\;\left(x \cdot x\right) \cdot \frac{9}{40} - \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{27}{2800} + \frac{1}{2}\right)\\

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

\end{array}
double f(double x) {
        double r511379 = x;
        double r511380 = sin(r511379);
        double r511381 = r511379 - r511380;
        double r511382 = tan(r511379);
        double r511383 = r511379 - r511382;
        double r511384 = r511381 / r511383;
        return r511384;
}

double f(double x) {
        double r511385 = x;
        double r511386 = -0.02464141707269403;
        bool r511387 = r511385 <= r511386;
        double r511388 = sin(r511385);
        double r511389 = r511385 - r511388;
        double r511390 = tan(r511385);
        double r511391 = r511385 - r511390;
        double r511392 = r511389 / r511391;
        double r511393 = 0.02782498439406133;
        bool r511394 = r511385 <= r511393;
        double r511395 = r511385 * r511385;
        double r511396 = 0.225;
        double r511397 = r511395 * r511396;
        double r511398 = r511395 * r511395;
        double r511399 = 0.009642857142857142;
        double r511400 = r511398 * r511399;
        double r511401 = 0.5;
        double r511402 = r511400 + r511401;
        double r511403 = r511397 - r511402;
        double r511404 = r511394 ? r511403 : r511392;
        double r511405 = r511387 ? r511392 : r511404;
        return r511405;
}

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.02464141707269403 or 0.02782498439406133 < x

    1. Initial program 0.1

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

      \[\leadsto \frac{\color{blue}{x - \sin x}}{x - \tan x}\]

    if -0.02464141707269403 < x < 0.02782498439406133

    1. Initial program 62.9

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity62.9

      \[\leadsto \frac{\color{blue}{1 \cdot \left(x - \sin x\right)}}{x - \tan x}\]
    4. Applied associate-/l*62.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.02464141707269403:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{elif}\;x \le 0.02782498439406133:\\ \;\;\;\;\left(x \cdot x\right) \cdot \frac{9}{40} - \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{27}{2800} + \frac{1}{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \end{array}\]

Reproduce

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