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

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

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

\end{array}
double f(double x) {
        double r657616 = x;
        double r657617 = sin(r657616);
        double r657618 = r657616 - r657617;
        double r657619 = tan(r657616);
        double r657620 = r657616 - r657619;
        double r657621 = r657618 / r657620;
        return r657621;
}

double f(double x) {
        double r657622 = x;
        double r657623 = -0.026748202540908116;
        bool r657624 = r657622 <= r657623;
        double r657625 = sin(r657622);
        double r657626 = r657622 - r657625;
        double r657627 = tan(r657622);
        double r657628 = r657622 - r657627;
        double r657629 = r657626 / r657628;
        double r657630 = r657629 * r657629;
        double r657631 = r657629 * r657630;
        double r657632 = cbrt(r657631);
        double r657633 = 0.02985439976441334;
        bool r657634 = r657622 <= r657633;
        double r657635 = 0.225;
        double r657636 = r657622 * r657622;
        double r657637 = 0.009642857142857142;
        double r657638 = r657636 * r657637;
        double r657639 = r657635 - r657638;
        double r657640 = r657639 * r657636;
        double r657641 = 0.5;
        double r657642 = r657640 - r657641;
        double r657643 = r657634 ? r657642 : r657632;
        double r657644 = r657624 ? r657632 : r657643;
        return r657644;
}

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.026748202540908116 or 0.02985439976441334 < x

    1. Initial program 0.0

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

      \[\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-cube42.7

      \[\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-undiv42.7

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

    if -0.026748202540908116 < x < 0.02985439976441334

    1. Initial program 63.3

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

Reproduce

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