Average Error: 31.1 → 0.0
Time: 20.1s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.02393875230028380887703498558494175085798 \lor \neg \left(x \le 0.02838856156577738987234482692656456492841\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan 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.02393875230028380887703498558494175085798 \lor \neg \left(x \le 0.02838856156577738987234482692656456492841\right):\\
\;\;\;\;\frac{x - \sin x}{x - \tan 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 r13194 = x;
        double r13195 = sin(r13194);
        double r13196 = r13194 - r13195;
        double r13197 = tan(r13194);
        double r13198 = r13194 - r13197;
        double r13199 = r13196 / r13198;
        return r13199;
}

double f(double x) {
        double r13200 = x;
        double r13201 = -0.02393875230028381;
        bool r13202 = r13200 <= r13201;
        double r13203 = 0.02838856156577739;
        bool r13204 = r13200 <= r13203;
        double r13205 = !r13204;
        bool r13206 = r13202 || r13205;
        double r13207 = sin(r13200);
        double r13208 = r13200 - r13207;
        double r13209 = tan(r13200);
        double r13210 = r13200 - r13209;
        double r13211 = r13208 / r13210;
        double r13212 = 0.225;
        double r13213 = 2.0;
        double r13214 = pow(r13200, r13213);
        double r13215 = r13212 * r13214;
        double r13216 = 0.009642857142857142;
        double r13217 = 4.0;
        double r13218 = pow(r13200, r13217);
        double r13219 = r13216 * r13218;
        double r13220 = 0.5;
        double r13221 = r13219 + r13220;
        double r13222 = r13215 - r13221;
        double r13223 = r13206 ? r13211 : r13222;
        return r13223;
}

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.02393875230028381 or 0.02838856156577739 < x

    1. Initial program 0.0

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

    if -0.02393875230028381 < x < 0.02838856156577739

    1. Initial program 63.4

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