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

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

\end{array}
double f(double x) {
        double r11275 = x;
        double r11276 = sin(r11275);
        double r11277 = r11275 - r11276;
        double r11278 = tan(r11275);
        double r11279 = r11275 - r11278;
        double r11280 = r11277 / r11279;
        return r11280;
}

double f(double x) {
        double r11281 = x;
        double r11282 = -0.027819204802016273;
        bool r11283 = r11281 <= r11282;
        double r11284 = 0.02907288472896622;
        bool r11285 = r11281 <= r11284;
        double r11286 = !r11285;
        bool r11287 = r11283 || r11286;
        double r11288 = 1.0;
        double r11289 = tan(r11281);
        double r11290 = r11281 - r11289;
        double r11291 = sin(r11281);
        double r11292 = r11281 - r11291;
        double r11293 = r11290 / r11292;
        double r11294 = r11288 / r11293;
        double r11295 = 0.225;
        double r11296 = 2.0;
        double r11297 = pow(r11281, r11296);
        double r11298 = r11295 * r11297;
        double r11299 = 0.009642857142857142;
        double r11300 = 4.0;
        double r11301 = pow(r11281, r11300);
        double r11302 = r11299 * r11301;
        double r11303 = 0.5;
        double r11304 = r11302 + r11303;
        double r11305 = r11298 - r11304;
        double r11306 = r11287 ? r11294 : r11305;
        return r11306;
}

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.027819204802016273 or 0.02907288472896622 < x

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

    if -0.027819204802016273 < x < 0.02907288472896622

    1. Initial program 63.1

      \[\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. Recombined 2 regimes into one program.
  4. Final simplification0.0

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

Reproduce

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