Average Error: 31.2 → 0.1
Time: 9.3s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.584526220894006520722996356198564171791 \lor \neg \left(x \le 1.580791957268951719584038073662668466568\right):\\ \;\;\;\;\sqrt{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt{\frac{x - \sin x}{x - \tan x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\log \left(e^{\frac{27}{2800} \cdot {x}^{4}}\right) + \frac{1}{2}\right)\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -1.584526220894006520722996356198564171791 \lor \neg \left(x \le 1.580791957268951719584038073662668466568\right):\\
\;\;\;\;\sqrt{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt{\frac{x - \sin x}{x - \tan x}}\\

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

\end{array}
double f(double x) {
        double r10283 = x;
        double r10284 = sin(r10283);
        double r10285 = r10283 - r10284;
        double r10286 = tan(r10283);
        double r10287 = r10283 - r10286;
        double r10288 = r10285 / r10287;
        return r10288;
}

double f(double x) {
        double r10289 = x;
        double r10290 = -1.5845262208940065;
        bool r10291 = r10289 <= r10290;
        double r10292 = 1.5807919572689517;
        bool r10293 = r10289 <= r10292;
        double r10294 = !r10293;
        bool r10295 = r10291 || r10294;
        double r10296 = sin(r10289);
        double r10297 = r10289 - r10296;
        double r10298 = tan(r10289);
        double r10299 = r10289 - r10298;
        double r10300 = r10297 / r10299;
        double r10301 = sqrt(r10300);
        double r10302 = r10301 * r10301;
        double r10303 = 0.225;
        double r10304 = 2.0;
        double r10305 = pow(r10289, r10304);
        double r10306 = r10303 * r10305;
        double r10307 = 0.009642857142857142;
        double r10308 = 4.0;
        double r10309 = pow(r10289, r10308);
        double r10310 = r10307 * r10309;
        double r10311 = exp(r10310);
        double r10312 = log(r10311);
        double r10313 = 0.5;
        double r10314 = r10312 + r10313;
        double r10315 = r10306 - r10314;
        double r10316 = r10295 ? r10302 : r10315;
        return r10316;
}

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 < -1.5845262208940065 or 1.5807919572689517 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt0.0

      \[\leadsto \color{blue}{\sqrt{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt{\frac{x - \sin x}{x - \tan x}}}\]

    if -1.5845262208940065 < x < 1.5807919572689517

    1. Initial program 63.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Taylor expanded around 0 0.1

      \[\leadsto \color{blue}{\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)}\]
    3. Using strategy rm
    4. Applied add-log-exp0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.584526220894006520722996356198564171791 \lor \neg \left(x \le 1.580791957268951719584038073662668466568\right):\\ \;\;\;\;\sqrt{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt{\frac{x - \sin x}{x - \tan x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\log \left(e^{\frac{27}{2800} \cdot {x}^{4}}\right) + \frac{1}{2}\right)\\ \end{array}\]

Reproduce

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