Average Error: 30.6 → 0.0
Time: 10.0s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.027077423692408079:\\ \;\;\;\;\frac{\frac{1}{x - \tan x}}{\frac{1}{x - \sin x}}\\ \mathbf{elif}\;x \le 0.027484538016213013:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin x}}\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.027077423692408079:\\
\;\;\;\;\frac{\frac{1}{x - \tan x}}{\frac{1}{x - \sin x}}\\

\mathbf{elif}\;x \le 0.027484538016213013:\\
\;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin x}}\\

\end{array}
double f(double x) {
        double r14194 = x;
        double r14195 = sin(r14194);
        double r14196 = r14194 - r14195;
        double r14197 = tan(r14194);
        double r14198 = r14194 - r14197;
        double r14199 = r14196 / r14198;
        return r14199;
}

double f(double x) {
        double r14200 = x;
        double r14201 = -0.02707742369240808;
        bool r14202 = r14200 <= r14201;
        double r14203 = 1.0;
        double r14204 = tan(r14200);
        double r14205 = r14200 - r14204;
        double r14206 = r14203 / r14205;
        double r14207 = sin(r14200);
        double r14208 = r14200 - r14207;
        double r14209 = r14203 / r14208;
        double r14210 = r14206 / r14209;
        double r14211 = 0.027484538016213013;
        bool r14212 = r14200 <= r14211;
        double r14213 = 0.225;
        double r14214 = 2.0;
        double r14215 = pow(r14200, r14214);
        double r14216 = r14213 * r14215;
        double r14217 = 0.009642857142857142;
        double r14218 = 4.0;
        double r14219 = pow(r14200, r14218);
        double r14220 = r14217 * r14219;
        double r14221 = 0.5;
        double r14222 = r14220 + r14221;
        double r14223 = r14216 - r14222;
        double r14224 = r14205 / r14208;
        double r14225 = r14203 / r14224;
        double r14226 = r14212 ? r14223 : r14225;
        double r14227 = r14202 ? r14210 : r14226;
        return r14227;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if x < -0.02707742369240808

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied clear-num0.1

      \[\leadsto \color{blue}{\frac{1}{\frac{x - \tan x}{x - \sin x}}}\]
    4. Using strategy rm
    5. Applied div-inv0.2

      \[\leadsto \frac{1}{\color{blue}{\left(x - \tan x\right) \cdot \frac{1}{x - \sin x}}}\]
    6. Applied associate-/r*0.1

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

    if -0.02707742369240808 < x < 0.027484538016213013

    1. Initial program 63.2

      \[\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)}\]

    if 0.027484538016213013 < 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}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.027077423692408079:\\ \;\;\;\;\frac{\frac{1}{x - \tan x}}{\frac{1}{x - \sin x}}\\ \mathbf{elif}\;x \le 0.027484538016213013:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin x}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020025 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  :precision binary64
  (/ (- x (sin x)) (- x (tan x))))