Average Error: 31.2 → 0.0
Time: 28.0s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.029021700279035747:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \mathbf{elif}\;x \le 0.028563011272804206:\\ \;\;\;\;\left(\frac{-1}{2} + \frac{-27}{2800} \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\right) + \left(x \cdot x\right) \cdot \frac{9}{40}\\ \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.029021700279035747:\\
\;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\

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

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

\end{array}
double f(double x) {
        double r364183 = x;
        double r364184 = sin(r364183);
        double r364185 = r364183 - r364184;
        double r364186 = tan(r364183);
        double r364187 = r364183 - r364186;
        double r364188 = r364185 / r364187;
        return r364188;
}

double f(double x) {
        double r364189 = x;
        double r364190 = -0.029021700279035747;
        bool r364191 = r364189 <= r364190;
        double r364192 = tan(r364189);
        double r364193 = r364189 - r364192;
        double r364194 = r364189 / r364193;
        double r364195 = sin(r364189);
        double r364196 = r364195 / r364193;
        double r364197 = r364194 - r364196;
        double r364198 = 0.028563011272804206;
        bool r364199 = r364189 <= r364198;
        double r364200 = -0.5;
        double r364201 = -0.009642857142857142;
        double r364202 = r364189 * r364189;
        double r364203 = r364202 * r364202;
        double r364204 = r364201 * r364203;
        double r364205 = r364200 + r364204;
        double r364206 = 0.225;
        double r364207 = r364202 * r364206;
        double r364208 = r364205 + r364207;
        double r364209 = r364189 - r364195;
        double r364210 = r364209 / r364193;
        double r364211 = r364199 ? r364208 : r364210;
        double r364212 = r364191 ? r364197 : r364211;
        return r364212;
}

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

    1. Initial program 0.1

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

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

    if -0.029021700279035747 < x < 0.028563011272804206

    1. Initial program 62.9

      \[\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. Simplified0.0

      \[\leadsto \color{blue}{\left(\left(x \cdot x\right) \cdot \frac{9}{40} - \frac{1}{2}\right) - \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{27}{2800}}\]
    4. Taylor expanded around inf 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(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)}\]

    if 0.028563011272804206 < x

    1. Initial program 0.1

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

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

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

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

Reproduce

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