Average Error: 31.2 → 0.1
Time: 9.4s
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 r10322 = x;
        double r10323 = sin(r10322);
        double r10324 = r10322 - r10323;
        double r10325 = tan(r10322);
        double r10326 = r10322 - r10325;
        double r10327 = r10324 / r10326;
        return r10327;
}

double f(double x) {
        double r10328 = x;
        double r10329 = -1.5845262208940065;
        bool r10330 = r10328 <= r10329;
        double r10331 = 1.5807919572689517;
        bool r10332 = r10328 <= r10331;
        double r10333 = !r10332;
        bool r10334 = r10330 || r10333;
        double r10335 = sin(r10328);
        double r10336 = r10328 - r10335;
        double r10337 = tan(r10328);
        double r10338 = r10328 - r10337;
        double r10339 = r10336 / r10338;
        double r10340 = sqrt(r10339);
        double r10341 = r10340 * r10340;
        double r10342 = 0.225;
        double r10343 = 2.0;
        double r10344 = pow(r10328, r10343);
        double r10345 = r10342 * r10344;
        double r10346 = 0.009642857142857142;
        double r10347 = 4.0;
        double r10348 = pow(r10328, r10347);
        double r10349 = r10346 * r10348;
        double r10350 = exp(r10349);
        double r10351 = log(r10350);
        double r10352 = 0.5;
        double r10353 = r10351 + r10352;
        double r10354 = r10345 - r10353;
        double r10355 = r10334 ? r10341 : r10354;
        return r10355;
}

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))))