Average Error: 31.5 → 0.0
Time: 9.5s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.026145755788180215 \lor \neg \left(x \le 0.0289802333023808541\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.026145755788180215 \lor \neg \left(x \le 0.0289802333023808541\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 r11773 = x;
        double r11774 = sin(r11773);
        double r11775 = r11773 - r11774;
        double r11776 = tan(r11773);
        double r11777 = r11773 - r11776;
        double r11778 = r11775 / r11777;
        return r11778;
}

double f(double x) {
        double r11779 = x;
        double r11780 = -0.026145755788180215;
        bool r11781 = r11779 <= r11780;
        double r11782 = 0.028980233302380854;
        bool r11783 = r11779 <= r11782;
        double r11784 = !r11783;
        bool r11785 = r11781 || r11784;
        double r11786 = sin(r11779);
        double r11787 = r11779 - r11786;
        double r11788 = tan(r11779);
        double r11789 = r11779 - r11788;
        double r11790 = r11787 / r11789;
        double r11791 = 0.225;
        double r11792 = 2.0;
        double r11793 = pow(r11779, r11792);
        double r11794 = r11791 * r11793;
        double r11795 = 0.009642857142857142;
        double r11796 = 4.0;
        double r11797 = pow(r11779, r11796);
        double r11798 = r11795 * r11797;
        double r11799 = r11794 - r11798;
        double r11800 = 0.5;
        double r11801 = r11799 - r11800;
        double r11802 = r11785 ? r11790 : r11801;
        return r11802;
}

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.026145755788180215 or 0.028980233302380854 < x

    1. Initial program 0.1

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

    if -0.026145755788180215 < x < 0.028980233302380854

    1. Initial program 63.0

      \[\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.026145755788180215 \lor \neg \left(x \le 0.0289802333023808541\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 2020034 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  :precision binary64
  (/ (- x (sin x)) (- x (tan x))))