Average Error: 30.4 → 0.0
Time: 29.7s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.02935110025381627:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \mathbf{elif}\;x \le 0.027648445953870143:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \frac{9}{40} - \frac{27}{2800} \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\right) - \frac{1}{2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\left(\frac{1}{\frac{x - \tan x}{x - \sin x}} \cdot \frac{1}{\frac{x - \tan x}{x - \sin x}}\right) \cdot \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.02935110025381627:\\
\;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\

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

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

\end{array}
double f(double x) {
        double r641290 = x;
        double r641291 = sin(r641290);
        double r641292 = r641290 - r641291;
        double r641293 = tan(r641290);
        double r641294 = r641290 - r641293;
        double r641295 = r641292 / r641294;
        return r641295;
}

double f(double x) {
        double r641296 = x;
        double r641297 = -0.02935110025381627;
        bool r641298 = r641296 <= r641297;
        double r641299 = tan(r641296);
        double r641300 = r641296 - r641299;
        double r641301 = r641296 / r641300;
        double r641302 = sin(r641296);
        double r641303 = r641302 / r641300;
        double r641304 = r641301 - r641303;
        double r641305 = 0.027648445953870143;
        bool r641306 = r641296 <= r641305;
        double r641307 = r641296 * r641296;
        double r641308 = 0.225;
        double r641309 = r641307 * r641308;
        double r641310 = 0.009642857142857142;
        double r641311 = r641307 * r641307;
        double r641312 = r641310 * r641311;
        double r641313 = r641309 - r641312;
        double r641314 = 0.5;
        double r641315 = r641313 - r641314;
        double r641316 = 1.0;
        double r641317 = r641296 - r641302;
        double r641318 = r641300 / r641317;
        double r641319 = r641316 / r641318;
        double r641320 = r641319 * r641319;
        double r641321 = r641320 * r641319;
        double r641322 = cbrt(r641321);
        double r641323 = r641306 ? r641315 : r641322;
        double r641324 = r641298 ? r641304 : r641323;
        return r641324;
}

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

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

    if -0.02935110025381627 < x < 0.027648445953870143

    1. Initial program 62.6

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

    if 0.027648445953870143 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity0.0

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

      \[\leadsto \color{blue}{\frac{1}{\frac{x - \tan x}{x - \sin x}}}\]
    5. Using strategy rm
    6. Applied add-cbrt-cube0.1

      \[\leadsto \color{blue}{\sqrt[3]{\left(\frac{1}{\frac{x - \tan x}{x - \sin x}} \cdot \frac{1}{\frac{x - \tan x}{x - \sin x}}\right) \cdot \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.02935110025381627:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \mathbf{elif}\;x \le 0.027648445953870143:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot \frac{9}{40} - \frac{27}{2800} \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\right) - \frac{1}{2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\left(\frac{1}{\frac{x - \tan x}{x - \sin x}} \cdot \frac{1}{\frac{x - \tan x}{x - \sin x}}\right) \cdot \frac{1}{\frac{x - \tan x}{x - \sin x}}}\\ \end{array}\]

Reproduce

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