Average Error: 31.3 → 0.0
Time: 11.5s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.026896790136361697:\\ \;\;\;\;\log \left(e^{\frac{x - \sin x}{x + \left(-\tan x\right)}}\right)\\ \mathbf{elif}\;x \le 0.027208711435501284:\\ \;\;\;\;\mathsf{fma}\left(\frac{9}{40}, {x}^{2}, -\mathsf{fma}\left(\frac{27}{2800}, {x}^{4}, \frac{1}{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x + \left(-\tan x\right)}\right)}^{3}}\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.026896790136361697:\\
\;\;\;\;\log \left(e^{\frac{x - \sin x}{x + \left(-\tan x\right)}}\right)\\

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

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

\end{array}
double code(double x) {
	return ((x - sin(x)) / (x - tan(x)));
}
double code(double x) {
	double temp;
	if ((x <= -0.026896790136361697)) {
		temp = log(exp(((x - sin(x)) / (x + -tan(x)))));
	} else {
		double temp_1;
		if ((x <= 0.027208711435501284)) {
			temp_1 = fma(0.225, pow(x, 2.0), -fma(0.009642857142857142, pow(x, 4.0), 0.5));
		} else {
			temp_1 = cbrt(pow(((x - sin(x)) / (x + -tan(x))), 3.0));
		}
		temp = temp_1;
	}
	return temp;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

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

    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} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}} - \tan x}\]
    4. Applied fma-neg1.4

      \[\leadsto \frac{x - \sin x}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)}}\]
    5. Using strategy rm
    6. Applied add-cbrt-cube41.3

      \[\leadsto \frac{x - \sin x}{\color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right) \cdot \mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)\right) \cdot \mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)}}}\]
    7. Applied add-cbrt-cube42.5

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\left(x - \sin x\right) \cdot \left(x - \sin x\right)\right) \cdot \left(x - \sin x\right)}}}{\sqrt[3]{\left(\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right) \cdot \mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)\right) \cdot \mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)}}\]
    8. Applied cbrt-undiv42.5

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

      \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{x - \sin x}{\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)}\right)}^{3}}}\]
    10. Using strategy rm
    11. Applied fma-udef1.1

      \[\leadsto \sqrt[3]{{\left(\frac{x - \sin x}{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x} + \left(-\tan x\right)}}\right)}^{3}}\]
    12. Simplified0.1

      \[\leadsto \sqrt[3]{{\left(\frac{x - \sin x}{\color{blue}{x} + \left(-\tan x\right)}\right)}^{3}}\]
    13. Using strategy rm
    14. Applied add-log-exp0.1

      \[\leadsto \color{blue}{\log \left(e^{\sqrt[3]{{\left(\frac{x - \sin x}{x + \left(-\tan x\right)}\right)}^{3}}}\right)}\]
    15. Simplified0.1

      \[\leadsto \log \color{blue}{\left(e^{\frac{x - \sin x}{x + \left(-\tan x\right)}}\right)}\]

    if -0.026896790136361697 < x < 0.027208711435501284

    1. Initial program 63.0

      \[\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)}\]

    if 0.027208711435501284 < x

    1. Initial program 0.1

      \[\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} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}} - \tan x}\]
    4. Applied fma-neg1.4

      \[\leadsto \frac{x - \sin x}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)}}\]
    5. Using strategy rm
    6. Applied add-cbrt-cube41.2

      \[\leadsto \frac{x - \sin x}{\color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right) \cdot \mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)\right) \cdot \mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)}}}\]
    7. Applied add-cbrt-cube42.5

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\left(x - \sin x\right) \cdot \left(x - \sin x\right)\right) \cdot \left(x - \sin x\right)}}}{\sqrt[3]{\left(\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right) \cdot \mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)\right) \cdot \mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)}}\]
    8. Applied cbrt-undiv42.4

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

      \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{x - \sin x}{\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -\tan x\right)}\right)}^{3}}}\]
    10. Using strategy rm
    11. Applied fma-udef1.1

      \[\leadsto \sqrt[3]{{\left(\frac{x - \sin x}{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x} + \left(-\tan x\right)}}\right)}^{3}}\]
    12. Simplified0.1

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

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

Reproduce

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