Average Error: 31.5 → 0.0
Time: 9.7s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.0291606622700367434 \lor \neg \left(x \le 0.0281371210540874335\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan 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.0291606622700367434 \lor \neg \left(x \le 0.0281371210540874335\right):\\
\;\;\;\;\frac{x - \sin x}{x - \tan 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 r14156 = x;
        double r14157 = sin(r14156);
        double r14158 = r14156 - r14157;
        double r14159 = tan(r14156);
        double r14160 = r14156 - r14159;
        double r14161 = r14158 / r14160;
        return r14161;
}

double f(double x) {
        double r14162 = x;
        double r14163 = -0.029160662270036743;
        bool r14164 = r14162 <= r14163;
        double r14165 = 0.028137121054087433;
        bool r14166 = r14162 <= r14165;
        double r14167 = !r14166;
        bool r14168 = r14164 || r14167;
        double r14169 = sin(r14162);
        double r14170 = r14162 - r14169;
        double r14171 = tan(r14162);
        double r14172 = r14162 - r14171;
        double r14173 = r14170 / r14172;
        double r14174 = 0.225;
        double r14175 = 2.0;
        double r14176 = pow(r14162, r14175);
        double r14177 = r14174 * r14176;
        double r14178 = 0.009642857142857142;
        double r14179 = 4.0;
        double r14180 = pow(r14162, r14179);
        double r14181 = r14178 * r14180;
        double r14182 = r14177 - r14181;
        double r14183 = 0.5;
        double r14184 = r14182 - r14183;
        double r14185 = r14168 ? r14173 : r14184;
        return r14185;
}

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.029160662270036743 or 0.028137121054087433 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]

    if -0.029160662270036743 < x < 0.028137121054087433

    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.0291606622700367434 \lor \neg \left(x \le 0.0281371210540874335\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan 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 2020021 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  :precision binary64
  (/ (- x (sin x)) (- x (tan x))))