Average Error: 31.2 → 0.0
Time: 29.5s
Precision: 64
Internal precision: 2432
\[\frac{x - \sin x}{x - \tan x}\]
⬇
\[\begin{array}{l}
\mathbf{if}\;x \le -0.0004101029468956529:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^3}\\
\mathbf{if}\;x \le 26943675.89880948:\\
\;\;\;\;\frac{9}{40} \cdot {x}^2 - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\
\end{array}\]
Derivation
- Split input into 3 regimes.
-
if x < -0.0004101029468956529
Initial program 0.2
\[\frac{x - \sin x}{x - \tan x}\]
- Using strategy
rm
Applied add-cbrt-cube 40.3
\[\leadsto \frac{x - \sin x}{\color{blue}{\sqrt[3]{{\left(x - \tan x\right)}^3}}}\]
Applied add-cbrt-cube 40.2
\[\leadsto \frac{\color{blue}{\sqrt[3]{{\left(x - \sin x\right)}^3}}}{\sqrt[3]{{\left(x - \tan x\right)}^3}}\]
Applied cbrt-undiv 40.2
\[\leadsto \color{blue}{\sqrt[3]{\frac{{\left(x - \sin x\right)}^3}{{\left(x - \tan x\right)}^3}}}\]
Applied simplify 0.2
\[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{x - \sin x}{x - \tan x}\right)}^3}}\]
if -0.0004101029468956529 < x < 26943675.89880948
Initial program 62.8
\[\frac{x - \sin x}{x - \tan x}\]
Applied taylor 0.0
\[\leadsto \frac{9}{40} \cdot {x}^2 - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\]
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)}\]
if 26943675.89880948 < x
Initial program 0.0
\[\frac{x - \sin x}{x - \tan x}\]
- Using strategy
rm
Applied add-log-exp 0.0
\[\leadsto \color{blue}{\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)}\]
- Recombined 3 regimes into one program.
- Removed slow pow expressions
Runtime
Please include this information when filing a bug report:
herbie shell --seed '#(1064875752 1442698706 3150723005 1316518582 2592983078 3835530843)'
(FPCore (x)
:name "sintan (problem 3.4.5)"
(/ (- x (sin x)) (- x (tan x))))