Average Error: 31.9 → 0.0
Time: 9.9s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.0268909451166995696 \lor \neg \left(x \le 0.025959275320095801\right):\\ \;\;\;\;\frac{x - \sin x}{x - \frac{\sin x}{\cos 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.0268909451166995696 \lor \neg \left(x \le 0.025959275320095801\right):\\
\;\;\;\;\frac{x - \sin x}{x - \frac{\sin x}{\cos 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 r11783 = x;
        double r11784 = sin(r11783);
        double r11785 = r11783 - r11784;
        double r11786 = tan(r11783);
        double r11787 = r11783 - r11786;
        double r11788 = r11785 / r11787;
        return r11788;
}

double f(double x) {
        double r11789 = x;
        double r11790 = -0.02689094511669957;
        bool r11791 = r11789 <= r11790;
        double r11792 = 0.0259592753200958;
        bool r11793 = r11789 <= r11792;
        double r11794 = !r11793;
        bool r11795 = r11791 || r11794;
        double r11796 = sin(r11789);
        double r11797 = r11789 - r11796;
        double r11798 = cos(r11789);
        double r11799 = r11796 / r11798;
        double r11800 = r11789 - r11799;
        double r11801 = r11797 / r11800;
        double r11802 = 0.225;
        double r11803 = 2.0;
        double r11804 = pow(r11789, r11803);
        double r11805 = r11802 * r11804;
        double r11806 = 0.009642857142857142;
        double r11807 = 4.0;
        double r11808 = pow(r11789, r11807);
        double r11809 = r11806 * r11808;
        double r11810 = 0.5;
        double r11811 = r11809 + r11810;
        double r11812 = r11805 - r11811;
        double r11813 = r11795 ? r11801 : r11812;
        return r11813;
}

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.02689094511669957 or 0.0259592753200958 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Taylor expanded around inf 0.0

      \[\leadsto \frac{x - \sin x}{\color{blue}{x - \frac{\sin x}{\cos x}}}\]

    if -0.02689094511669957 < x < 0.0259592753200958

    1. Initial program 63.3

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