Average Error: 31.3 → 0.0
Time: 14.2s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.0275654979361482401 \lor \neg \left(x \le 0.029125046562482146\right):\\ \;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin 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.0275654979361482401 \lor \neg \left(x \le 0.029125046562482146\right):\\
\;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin 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 r11615 = x;
        double r11616 = sin(r11615);
        double r11617 = r11615 - r11616;
        double r11618 = tan(r11615);
        double r11619 = r11615 - r11618;
        double r11620 = r11617 / r11619;
        return r11620;
}

double f(double x) {
        double r11621 = x;
        double r11622 = -0.02756549793614824;
        bool r11623 = r11621 <= r11622;
        double r11624 = 0.029125046562482146;
        bool r11625 = r11621 <= r11624;
        double r11626 = !r11625;
        bool r11627 = r11623 || r11626;
        double r11628 = 1.0;
        double r11629 = tan(r11621);
        double r11630 = r11621 - r11629;
        double r11631 = sin(r11621);
        double r11632 = r11621 - r11631;
        double r11633 = r11630 / r11632;
        double r11634 = r11628 / r11633;
        double r11635 = 0.225;
        double r11636 = 2.0;
        double r11637 = pow(r11621, r11636);
        double r11638 = r11635 * r11637;
        double r11639 = 0.009642857142857142;
        double r11640 = 4.0;
        double r11641 = pow(r11621, r11640);
        double r11642 = r11639 * r11641;
        double r11643 = 0.5;
        double r11644 = r11642 + r11643;
        double r11645 = r11638 - r11644;
        double r11646 = r11627 ? r11634 : r11645;
        return r11646;
}

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.02756549793614824 or 0.029125046562482146 < x

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

    if -0.02756549793614824 < x < 0.029125046562482146

    1. Initial program 63.0

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