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

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

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

\end{array}
double f(double x) {
        double r575167 = x;
        double r575168 = sin(r575167);
        double r575169 = r575167 - r575168;
        double r575170 = tan(r575167);
        double r575171 = r575167 - r575170;
        double r575172 = r575169 / r575171;
        return r575172;
}

double f(double x) {
        double r575173 = x;
        double r575174 = -0.03308569083367182;
        bool r575175 = r575173 <= r575174;
        double r575176 = tan(r575173);
        double r575177 = r575173 - r575176;
        double r575178 = r575173 / r575177;
        double r575179 = sin(r575173);
        double r575180 = r575179 / r575177;
        double r575181 = r575178 - r575180;
        double r575182 = cbrt(r575181);
        double r575183 = r575182 * r575182;
        double r575184 = r575182 * r575183;
        double r575185 = 0.04123574744667479;
        bool r575186 = r575173 <= r575185;
        double r575187 = 0.225;
        double r575188 = r575173 * r575173;
        double r575189 = 0.009642857142857142;
        double r575190 = r575188 * r575188;
        double r575191 = 0.5;
        double r575192 = fma(r575189, r575190, r575191);
        double r575193 = -r575192;
        double r575194 = fma(r575187, r575188, r575193);
        double r575195 = cbrt(r575177);
        double r575196 = r575179 / r575195;
        double r575197 = -r575196;
        double r575198 = 1.0;
        double r575199 = r575195 * r575195;
        double r575200 = r575198 / r575199;
        double r575201 = r575196 * r575200;
        double r575202 = fma(r575197, r575200, r575201);
        double r575203 = cbrt(r575173);
        double r575204 = r575203 * r575203;
        double r575205 = r575204 / r575199;
        double r575206 = r575203 / r575195;
        double r575207 = -1.0;
        double r575208 = r575207 / r575199;
        double r575209 = r575196 * r575208;
        double r575210 = fma(r575205, r575206, r575209);
        double r575211 = r575202 + r575210;
        double r575212 = r575186 ? r575194 : r575211;
        double r575213 = r575175 ? r575184 : r575212;
        return r575213;
}

Error

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if x < -0.03308569083367182

    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}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt0.1

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

    if -0.03308569083367182 < x < 0.04123574744667479

    1. Initial program 62.7

      \[\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}{\mathsf{fma}\left(\frac{9}{40}, \left(x \cdot x\right), \left(-\mathsf{fma}\left(\frac{27}{2800}, \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \frac{1}{2}\right)\right)\right)}\]

    if 0.04123574744667479 < x

    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}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt0.0

      \[\leadsto \frac{x}{x - \tan x} - \frac{\sin x}{\color{blue}{\left(\sqrt[3]{x - \tan x} \cdot \sqrt[3]{x - \tan x}\right) \cdot \sqrt[3]{x - \tan x}}}\]
    6. Applied *-un-lft-identity0.0

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

      \[\leadsto \frac{x}{x - \tan x} - \color{blue}{\frac{1}{\sqrt[3]{x - \tan x} \cdot \sqrt[3]{x - \tan x}} \cdot \frac{\sin x}{\sqrt[3]{x - \tan x}}}\]
    8. Applied add-cube-cbrt1.4

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

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x - \tan x} \cdot \sqrt[3]{x - \tan x}} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{x - \tan x}}} - \frac{1}{\sqrt[3]{x - \tan x} \cdot \sqrt[3]{x - \tan x}} \cdot \frac{\sin x}{\sqrt[3]{x - \tan x}}\]
    11. Applied prod-diff0.1

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

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

Reproduce

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