Average Error: 31.1 → 0.0
Time: 32.2s
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 r20025 = x;
        double r20026 = sin(r20025);
        double r20027 = r20025 - r20026;
        double r20028 = tan(r20025);
        double r20029 = r20025 - r20028;
        double r20030 = r20027 / r20029;
        return r20030;
}

double f(double x) {
        double r20031 = x;
        double r20032 = -0.02915706671350092;
        bool r20033 = r20031 <= r20032;
        double r20034 = 0.029468351736831863;
        bool r20035 = r20031 <= r20034;
        double r20036 = !r20035;
        bool r20037 = r20033 || r20036;
        double r20038 = 1.0;
        double r20039 = tan(r20031);
        double r20040 = r20031 - r20039;
        double r20041 = sin(r20031);
        double r20042 = r20031 - r20041;
        double r20043 = r20040 / r20042;
        double r20044 = r20038 / r20043;
        double r20045 = 0.225;
        double r20046 = 2.0;
        double r20047 = pow(r20031, r20046);
        double r20048 = r20045 * r20047;
        double r20049 = 0.009642857142857142;
        double r20050 = 4.0;
        double r20051 = pow(r20031, r20050);
        double r20052 = r20049 * r20051;
        double r20053 = r20048 - r20052;
        double r20054 = 0.5;
        double r20055 = r20053 - r20054;
        double r20056 = r20037 ? r20044 : r20055;
        return r20056;
}

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))))