Average Error: 31.5 → 0.1
Time: 22.5s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.569624820234627682324912711919751018286:\\ \;\;\;\;\sqrt{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt{\frac{x - \sin x}{x - \tan x}}\\ \mathbf{elif}\;x \le 0.02988866558285174085396462828612129669636:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\frac{9}{40} - \left(x \cdot x\right) \cdot \frac{27}{2800}\right) - \frac{1}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x \cdot \frac{x}{x - \tan x}}{x - \tan x} - \frac{{\left(\sin x\right)}^{2}}{\left(x - \tan x\right) \cdot \left(x - \tan x\right)}}{\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}}\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -1.569624820234627682324912711919751018286:\\
\;\;\;\;\sqrt{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt{\frac{x - \sin x}{x - \tan x}}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \frac{x}{x - \tan x}}{x - \tan x} - \frac{{\left(\sin x\right)}^{2}}{\left(x - \tan x\right) \cdot \left(x - \tan x\right)}}{\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}}\\

\end{array}
double f(double x) {
        double r22294 = x;
        double r22295 = sin(r22294);
        double r22296 = r22294 - r22295;
        double r22297 = tan(r22294);
        double r22298 = r22294 - r22297;
        double r22299 = r22296 / r22298;
        return r22299;
}

double f(double x) {
        double r22300 = x;
        double r22301 = -1.5696248202346277;
        bool r22302 = r22300 <= r22301;
        double r22303 = sin(r22300);
        double r22304 = r22300 - r22303;
        double r22305 = tan(r22300);
        double r22306 = r22300 - r22305;
        double r22307 = r22304 / r22306;
        double r22308 = sqrt(r22307);
        double r22309 = r22308 * r22308;
        double r22310 = 0.02988866558285174;
        bool r22311 = r22300 <= r22310;
        double r22312 = r22300 * r22300;
        double r22313 = 0.225;
        double r22314 = 0.009642857142857142;
        double r22315 = r22312 * r22314;
        double r22316 = r22313 - r22315;
        double r22317 = r22312 * r22316;
        double r22318 = 0.5;
        double r22319 = r22317 - r22318;
        double r22320 = r22300 / r22306;
        double r22321 = r22300 * r22320;
        double r22322 = r22321 / r22306;
        double r22323 = 2.0;
        double r22324 = pow(r22303, r22323);
        double r22325 = r22306 * r22306;
        double r22326 = r22324 / r22325;
        double r22327 = r22322 - r22326;
        double r22328 = r22303 / r22306;
        double r22329 = r22320 + r22328;
        double r22330 = r22327 / r22329;
        double r22331 = r22311 ? r22319 : r22330;
        double r22332 = r22302 ? r22309 : r22331;
        return r22332;
}

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

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt0.0

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

    if -1.5696248202346277 < x < 0.02988866558285174

    1. Initial program 63.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Taylor expanded around 0 0.1

      \[\leadsto \color{blue}{\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)}\]
    3. Simplified0.1

      \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(\frac{9}{40} - \frac{27}{2800} \cdot \left(x \cdot x\right)\right) - \frac{1}{2}}\]

    if 0.02988866558285174 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied div-sub0.0

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]
    4. Using strategy rm
    5. Applied flip--0.0

      \[\leadsto \color{blue}{\frac{\frac{x}{x - \tan x} \cdot \frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x} \cdot \frac{\sin x}{x - \tan x}}{\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}}}\]
    6. Simplified0.0

      \[\leadsto \frac{\color{blue}{\frac{x \cdot \frac{x}{x - \tan x}}{x - \tan x} - \frac{{\left(\sin x\right)}^{2}}{\left(x - \tan x\right) \cdot \left(x - \tan x\right)}}}{\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}}\]
    7. Simplified0.0

      \[\leadsto \frac{\frac{x \cdot \frac{x}{x - \tan x}}{x - \tan x} - \frac{{\left(\sin x\right)}^{2}}{\left(x - \tan x\right) \cdot \left(x - \tan x\right)}}{\color{blue}{\frac{\sin x}{x - \tan x} + \frac{x}{x - \tan x}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.1

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

Reproduce

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