Average Error: 31.2 → 0.0
Time: 28.7s
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(x \cdot x\right) \cdot \left(\frac{9}{40} - \left(x \cdot x\right) \cdot \frac{27}{2800}\right) - \frac{1}{2}\\ \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(x \cdot x\right) \cdot \left(\frac{9}{40} - \left(x \cdot x\right) \cdot \frac{27}{2800}\right) - \frac{1}{2}\\

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

\end{array}
double f(double x) {
        double r418492 = x;
        double r418493 = sin(r418492);
        double r418494 = r418492 - r418493;
        double r418495 = tan(r418492);
        double r418496 = r418492 - r418495;
        double r418497 = r418494 / r418496;
        return r418497;
}

double f(double x) {
        double r418498 = x;
        double r418499 = -0.029021700279035747;
        bool r418500 = r418498 <= r418499;
        double r418501 = tan(r418498);
        double r418502 = r418498 - r418501;
        double r418503 = r418498 / r418502;
        double r418504 = sin(r418498);
        double r418505 = r418504 / r418502;
        double r418506 = r418503 - r418505;
        double r418507 = 0.028563011272804206;
        bool r418508 = r418498 <= r418507;
        double r418509 = r418498 * r418498;
        double r418510 = 0.225;
        double r418511 = 0.009642857142857142;
        double r418512 = r418509 * r418511;
        double r418513 = r418510 - r418512;
        double r418514 = r418509 * r418513;
        double r418515 = 0.5;
        double r418516 = r418514 - r418515;
        double r418517 = r418498 - r418504;
        double r418518 = r418517 / r418502;
        double r418519 = r418508 ? r418516 : r418518;
        double r418520 = r418500 ? r418506 : r418519;
        return r418520;
}

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. Using strategy rm
    3. Applied div-sub62.8

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

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

      \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(\frac{9}{40} - \frac{27}{2800} \cdot \left(x \cdot x\right)\right) - \frac{1}{2}}\]

    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(x \cdot x\right) \cdot \left(\frac{9}{40} - \left(x \cdot x\right) \cdot \frac{27}{2800}\right) - \frac{1}{2}\\ \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))))