Average Error: 31.2 → 0.1
Time: 33.3s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.0255462208880924725173944267453407519497:\\ \;\;\;\;\frac{\sqrt[3]{x - \sin x}}{\sqrt[3]{x - \tan x}} \cdot \left(\frac{\sqrt[3]{x - \sin x}}{\sqrt[3]{x - \tan x}} \cdot \frac{\sqrt[3]{x - \sin x}}{\sqrt[3]{x - \tan x}}\right)\\ \mathbf{elif}\;x \le 0.02857901990345195278320211684786045225337:\\ \;\;\;\;\mathsf{fma}\left(\frac{9}{40}, x \cdot x, \mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right), \frac{-27}{2800}, \frac{-1}{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{x - \sin x}}{\sqrt[3]{x - \tan x}} \cdot \left(\frac{\sqrt[3]{x - \sin x}}{\sqrt[3]{x - \tan x}} \cdot \frac{\sqrt[3]{x - \sin x}}{\sqrt[3]{x - \tan x}}\right)\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.0255462208880924725173944267453407519497:\\
\;\;\;\;\frac{\sqrt[3]{x - \sin x}}{\sqrt[3]{x - \tan x}} \cdot \left(\frac{\sqrt[3]{x - \sin x}}{\sqrt[3]{x - \tan x}} \cdot \frac{\sqrt[3]{x - \sin x}}{\sqrt[3]{x - \tan x}}\right)\\

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

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

\end{array}
double f(double x) {
        double r757666 = x;
        double r757667 = sin(r757666);
        double r757668 = r757666 - r757667;
        double r757669 = tan(r757666);
        double r757670 = r757666 - r757669;
        double r757671 = r757668 / r757670;
        return r757671;
}

double f(double x) {
        double r757672 = x;
        double r757673 = -0.025546220888092473;
        bool r757674 = r757672 <= r757673;
        double r757675 = sin(r757672);
        double r757676 = r757672 - r757675;
        double r757677 = cbrt(r757676);
        double r757678 = tan(r757672);
        double r757679 = r757672 - r757678;
        double r757680 = cbrt(r757679);
        double r757681 = r757677 / r757680;
        double r757682 = r757681 * r757681;
        double r757683 = r757681 * r757682;
        double r757684 = 0.028579019903451953;
        bool r757685 = r757672 <= r757684;
        double r757686 = 0.225;
        double r757687 = r757672 * r757672;
        double r757688 = r757687 * r757687;
        double r757689 = -0.009642857142857142;
        double r757690 = -0.5;
        double r757691 = fma(r757688, r757689, r757690);
        double r757692 = fma(r757686, r757687, r757691);
        double r757693 = r757685 ? r757692 : r757683;
        double r757694 = r757674 ? r757683 : r757693;
        return r757694;
}

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < -0.025546220888092473 or 0.028579019903451953 < x

    1. Initial program 0.0

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

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

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

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

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

    if -0.025546220888092473 < x < 0.028579019903451953

    1. Initial program 63.3

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied expm1-log1p-u63.3

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x - \sin x}{x - \tan x}\right)\right)}\]
    4. 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)}\]
    5. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019170 +o rules:numerics
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  (/ (- x (sin x)) (- x (tan x))))