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

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

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

\end{array}
double f(double x) {
        double r231828 = x;
        double r231829 = sin(r231828);
        double r231830 = r231828 - r231829;
        double r231831 = tan(r231828);
        double r231832 = r231828 - r231831;
        double r231833 = r231830 / r231832;
        return r231833;
}

double f(double x) {
        double r231834 = x;
        double r231835 = -0.028431537088381868;
        bool r231836 = r231834 <= r231835;
        double r231837 = sin(r231834);
        double r231838 = r231834 - r231837;
        double r231839 = tan(r231834);
        double r231840 = r231834 - r231839;
        double r231841 = r231838 / r231840;
        double r231842 = 0.025242037778536456;
        bool r231843 = r231834 <= r231842;
        double r231844 = r231834 * r231834;
        double r231845 = 0.225;
        double r231846 = r231844 * r231845;
        double r231847 = 0.5;
        double r231848 = r231846 - r231847;
        double r231849 = r231844 * r231844;
        double r231850 = 0.009642857142857142;
        double r231851 = r231849 * r231850;
        double r231852 = r231848 - r231851;
        double r231853 = r231841 * r231841;
        double r231854 = r231853 * r231841;
        double r231855 = cbrt(r231854);
        double r231856 = r231843 ? r231852 : r231855;
        double r231857 = r231836 ? r231841 : r231856;
        return r231857;
}

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.028431537088381868

    1. Initial program 0.0

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

    if -0.028431537088381868 < x < 0.025242037778536456

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

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

    if 0.025242037778536456 < x

    1. Initial program 0.1

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied add-cbrt-cube41.7

      \[\leadsto \frac{x - \sin x}{\color{blue}{\sqrt[3]{\left(\left(x - \tan x\right) \cdot \left(x - \tan x\right)\right) \cdot \left(x - \tan x\right)}}}\]
    4. Applied add-cbrt-cube41.5

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

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

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

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

Reproduce

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