Average Error: 31.5 → 0.1
Time: 9.5s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.036105050770743163 \lor \neg \left(x \le 0.0318273845035723299\right):\\ \;\;\;\;\frac{\sqrt[3]{x - \sin x} \cdot \sqrt[3]{x - \sin x}}{\frac{\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)}{\sqrt[3]{x - \sin x}}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{9}{40}, {x}^{2}, -\mathsf{fma}\left(\frac{27}{2800}, {x}^{4}, \frac{1}{2}\right)\right)\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.036105050770743163 \lor \neg \left(x \le 0.0318273845035723299\right):\\
\;\;\;\;\frac{\sqrt[3]{x - \sin x} \cdot \sqrt[3]{x - \sin x}}{\frac{\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)}{\sqrt[3]{x - \sin x}}}\\

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

\end{array}
double f(double x) {
        double r10855 = x;
        double r10856 = sin(r10855);
        double r10857 = r10855 - r10856;
        double r10858 = tan(r10855);
        double r10859 = r10855 - r10858;
        double r10860 = r10857 / r10859;
        return r10860;
}

double f(double x) {
        double r10861 = x;
        double r10862 = -0.03610505077074316;
        bool r10863 = r10861 <= r10862;
        double r10864 = 0.03182738450357233;
        bool r10865 = r10861 <= r10864;
        double r10866 = !r10865;
        bool r10867 = r10863 || r10866;
        double r10868 = sin(r10861);
        double r10869 = r10861 - r10868;
        double r10870 = cbrt(r10869);
        double r10871 = r10870 * r10870;
        double r10872 = cbrt(r10861);
        double r10873 = r10872 * r10872;
        double r10874 = tan(r10861);
        double r10875 = -r10874;
        double r10876 = fma(r10873, r10872, r10875);
        double r10877 = r10876 / r10870;
        double r10878 = r10871 / r10877;
        double r10879 = 0.225;
        double r10880 = 2.0;
        double r10881 = pow(r10861, r10880);
        double r10882 = 0.009642857142857142;
        double r10883 = 4.0;
        double r10884 = pow(r10861, r10883);
        double r10885 = 0.5;
        double r10886 = fma(r10882, r10884, r10885);
        double r10887 = -r10886;
        double r10888 = fma(r10879, r10881, r10887);
        double r10889 = r10867 ? r10878 : r10888;
        return r10889;
}

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < -0.03610505077074316 or 0.03182738450357233 < x

    1. Initial program 0.1

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

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x - \sin x} \cdot \sqrt[3]{x - \sin x}}{\frac{x - \tan x}{\sqrt[3]{x - \sin x}}}}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt0.2

      \[\leadsto \frac{\sqrt[3]{x - \sin x} \cdot \sqrt[3]{x - \sin x}}{\frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}} - \tan x}{\sqrt[3]{x - \sin x}}}\]
    7. Applied fma-neg0.2

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

    if -0.03610505077074316 < x < 0.03182738450357233

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

Reproduce

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