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

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

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

\end{array}
double f(double x) {
        double r65 = x;
        double r66 = sin(r65);
        double r67 = r65 - r66;
        double r68 = tan(r65);
        double r69 = r65 - r68;
        double r70 = r67 / r69;
        return r70;
}

double f(double x) {
        double r71 = x;
        double r72 = -0.02707742369240808;
        bool r73 = r71 <= r72;
        double r74 = 1.0;
        double r75 = tan(r71);
        double r76 = r71 - r75;
        double r77 = r74 / r76;
        double r78 = sin(r71);
        double r79 = r71 - r78;
        double r80 = r74 / r79;
        double r81 = r77 / r80;
        double r82 = 0.027484538016213013;
        bool r83 = r71 <= r82;
        double r84 = 0.225;
        double r85 = 2.0;
        double r86 = pow(r71, r85);
        double r87 = r84 * r86;
        double r88 = 0.009642857142857142;
        double r89 = 4.0;
        double r90 = pow(r71, r89);
        double r91 = r88 * r90;
        double r92 = 0.5;
        double r93 = r91 + r92;
        double r94 = r87 - r93;
        double r95 = r76 / r79;
        double r96 = r74 / r95;
        double r97 = r83 ? r94 : r96;
        double r98 = r73 ? r81 : r97;
        return r98;
}

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.02707742369240808

    1. Initial program 0.0

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

      \[\leadsto \color{blue}{\frac{1}{\frac{x - \tan x}{x - \sin x}}}\]
    4. Using strategy rm
    5. Applied div-inv0.2

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

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

    if -0.02707742369240808 < x < 0.027484538016213013

    1. Initial program 63.2

      \[\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)}\]

    if 0.027484538016213013 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied clear-num0.0

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

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

Reproduce

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