Average Error: 31.5 → 0.0
Time: 25.3s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.029116187280256105:\\ \;\;\;\;\left(\sqrt[3]{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\right) \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\\ \mathbf{elif}\;x \le 0.02766522497664611:\\ \;\;\;\;\left(\frac{9}{40} \cdot \left(x \cdot x\right) - \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{27}{2800}\right) - \frac{1}{2}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\right) \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.029116187280256105:\\
\;\;\;\;\left(\sqrt[3]{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\right) \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\\

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

\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\right) \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\\

\end{array}
double f(double x) {
        double r290879 = x;
        double r290880 = sin(r290879);
        double r290881 = r290879 - r290880;
        double r290882 = tan(r290879);
        double r290883 = r290879 - r290882;
        double r290884 = r290881 / r290883;
        return r290884;
}

double f(double x) {
        double r290885 = x;
        double r290886 = -0.029116187280256105;
        bool r290887 = r290885 <= r290886;
        double r290888 = sin(r290885);
        double r290889 = r290885 - r290888;
        double r290890 = tan(r290885);
        double r290891 = r290885 - r290890;
        double r290892 = r290889 / r290891;
        double r290893 = cbrt(r290892);
        double r290894 = r290893 * r290893;
        double r290895 = r290894 * r290893;
        double r290896 = 0.02766522497664611;
        bool r290897 = r290885 <= r290896;
        double r290898 = 0.225;
        double r290899 = r290885 * r290885;
        double r290900 = r290898 * r290899;
        double r290901 = r290899 * r290899;
        double r290902 = 0.009642857142857142;
        double r290903 = r290901 * r290902;
        double r290904 = r290900 - r290903;
        double r290905 = 0.5;
        double r290906 = r290904 - r290905;
        double r290907 = r290897 ? r290906 : r290895;
        double r290908 = r290887 ? r290895 : r290907;
        return r290908;
}

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.029116187280256105 or 0.02766522497664611 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt0.1

      \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\right) \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}}\]

    if -0.029116187280256105 < x < 0.02766522497664611

    1. Initial program 62.7

      \[\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. Simplified0.0

      \[\leadsto \color{blue}{\left(\left(x \cdot x\right) \cdot \frac{9}{40} - \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{27}{2800}\right) - \frac{1}{2}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

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

Reproduce

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