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

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

\end{array}
double f(double x) {
        double r20260 = x;
        double r20261 = sin(r20260);
        double r20262 = r20260 - r20261;
        double r20263 = tan(r20260);
        double r20264 = r20260 - r20263;
        double r20265 = r20262 / r20264;
        return r20265;
}

double f(double x) {
        double r20266 = x;
        double r20267 = -0.02915706671350092;
        bool r20268 = r20266 <= r20267;
        double r20269 = 0.029468351736831863;
        bool r20270 = r20266 <= r20269;
        double r20271 = !r20270;
        bool r20272 = r20268 || r20271;
        double r20273 = 1.0;
        double r20274 = tan(r20266);
        double r20275 = r20266 - r20274;
        double r20276 = sin(r20266);
        double r20277 = r20266 - r20276;
        double r20278 = r20275 / r20277;
        double r20279 = r20273 / r20278;
        double r20280 = 0.225;
        double r20281 = 2.0;
        double r20282 = pow(r20266, r20281);
        double r20283 = r20280 * r20282;
        double r20284 = 0.009642857142857142;
        double r20285 = 4.0;
        double r20286 = pow(r20266, r20285);
        double r20287 = r20284 * r20286;
        double r20288 = r20283 - r20287;
        double r20289 = 0.5;
        double r20290 = r20288 - r20289;
        double r20291 = r20272 ? r20279 : r20290;
        return r20291;
}

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.02915706671350092 or 0.029468351736831863 < 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}}}\]

    if -0.02915706671350092 < x < 0.029468351736831863

    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. Using strategy rm
    4. Applied associate--r+0.0

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

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

Reproduce

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