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

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

\end{array}
double f(double x) {
        double r28499 = x;
        double r28500 = sin(r28499);
        double r28501 = r28499 - r28500;
        double r28502 = tan(r28499);
        double r28503 = r28499 - r28502;
        double r28504 = r28501 / r28503;
        return r28504;
}

double f(double x) {
        double r28505 = x;
        double r28506 = -0.028396277205580838;
        bool r28507 = r28505 <= r28506;
        double r28508 = 0.02891102314655495;
        bool r28509 = r28505 <= r28508;
        double r28510 = !r28509;
        bool r28511 = r28507 || r28510;
        double r28512 = sin(r28505);
        double r28513 = r28505 - r28512;
        double r28514 = tan(r28505);
        double r28515 = r28505 - r28514;
        double r28516 = r28513 / r28515;
        double r28517 = 3.0;
        double r28518 = pow(r28516, r28517);
        double r28519 = cbrt(r28518);
        double r28520 = 2.0;
        double r28521 = pow(r28505, r28520);
        double r28522 = 0.225;
        double r28523 = 0.009642857142857142;
        double r28524 = r28521 * r28523;
        double r28525 = r28522 - r28524;
        double r28526 = r28521 * r28525;
        double r28527 = 0.5;
        double r28528 = r28526 - r28527;
        double r28529 = r28511 ? r28519 : r28528;
        return r28529;
}

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.028396277205580838 or 0.02891102314655495 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied add-cbrt-cube40.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.9

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

      \[\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}\right)}^{3}}}\]

    if -0.028396277205580838 < x < 0.02891102314655495

    1. Initial program 63.1

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

Reproduce

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