Average Error: 32.1 → 1.2
Time: 15.3s
Precision: binary64
\[\frac{x - \sin x}{x - \tan x} \]
\[\begin{array}{l} t_0 := x + \tan x\\ \mathsf{fma}\left(\frac{{\left(\sqrt[3]{x}\right)}^{2}}{{\left(\sqrt[3]{t_0}\right)}^{2}}, \frac{\sqrt[3]{x}}{\mathsf{fma}\left(0.3333333333333333, \frac{\sin x}{\cos x} \cdot \log \left(e^{\sqrt[3]{{x}^{-2}}}\right), \sqrt[3]{x}\right)}, -\frac{\sin x}{t_0}\right) \end{array} \]
(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (+ x (tan x))))
   (fma
    (/ (pow (cbrt x) 2.0) (pow (cbrt t_0) 2.0))
    (/
     (cbrt x)
     (fma
      0.3333333333333333
      (* (/ (sin x) (cos x)) (log (exp (cbrt (pow x -2.0)))))
      (cbrt x)))
    (- (/ (sin x) t_0)))))
double code(double x) {
	return (x - sin(x)) / (x - tan(x));
}
double code(double x) {
	double t_0 = x + tan(x);
	return fma((pow(cbrt(x), 2.0) / pow(cbrt(t_0), 2.0)), (cbrt(x) / fma(0.3333333333333333, ((sin(x) / cos(x)) * log(exp(cbrt(pow(x, -2.0))))), cbrt(x))), -(sin(x) / t_0));
}
function code(x)
	return Float64(Float64(x - sin(x)) / Float64(x - tan(x)))
end
function code(x)
	t_0 = Float64(x + tan(x))
	return fma(Float64((cbrt(x) ^ 2.0) / (cbrt(t_0) ^ 2.0)), Float64(cbrt(x) / fma(0.3333333333333333, Float64(Float64(sin(x) / cos(x)) * log(exp(cbrt((x ^ -2.0))))), cbrt(x))), Float64(-Float64(sin(x) / t_0)))
end
code[x_] := N[(N[(x - N[Sin[x], $MachinePrecision]), $MachinePrecision] / N[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[(x + N[Tan[x], $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] / N[(0.3333333333333333 * N[(N[(N[Sin[x], $MachinePrecision] / N[Cos[x], $MachinePrecision]), $MachinePrecision] * N[Log[N[Exp[N[Power[N[Power[x, -2.0], $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-N[(N[Sin[x], $MachinePrecision] / t$95$0), $MachinePrecision])), $MachinePrecision]]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
t_0 := x + \tan x\\
\mathsf{fma}\left(\frac{{\left(\sqrt[3]{x}\right)}^{2}}{{\left(\sqrt[3]{t_0}\right)}^{2}}, \frac{\sqrt[3]{x}}{\mathsf{fma}\left(0.3333333333333333, \frac{\sin x}{\cos x} \cdot \log \left(e^{\sqrt[3]{{x}^{-2}}}\right), \sqrt[3]{x}\right)}, -\frac{\sin x}{t_0}\right)
\end{array}

Error

Bits error versus x

Derivation

  1. Initial program 32.1

    \[\frac{x - \sin x}{x - \tan x} \]
  2. Applied egg-rr31.2

    \[\leadsto \frac{x - \sin x}{\color{blue}{\left(x - \tan x\right) + \mathsf{fma}\left(-\sqrt[3]{\tan x}, {\left(\sqrt[3]{\tan x}\right)}^{2}, \tan x\right)}} \]
  3. Applied egg-rr31.3

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\sqrt[3]{x}\right)}^{2}}{{\left(\sqrt[3]{x + \tan x}\right)}^{2}}, \frac{\sqrt[3]{x}}{\sqrt[3]{x + \tan x}}, -\frac{\sin x}{x + \tan x}\right)} \]
  4. Taylor expanded in x around inf 40.1

    \[\leadsto \mathsf{fma}\left(\frac{{\left(\sqrt[3]{x}\right)}^{2}}{{\left(\sqrt[3]{x + \tan x}\right)}^{2}}, \frac{\sqrt[3]{x}}{\color{blue}{{x}^{0.3333333333333333} + 0.3333333333333333 \cdot \left(\frac{\sin x}{\cos x} \cdot {\left(\frac{1}{{x}^{2}}\right)}^{0.3333333333333333}\right)}}, -\frac{\sin x}{x + \tan x}\right) \]
  5. Simplified14.6

    \[\leadsto \mathsf{fma}\left(\frac{{\left(\sqrt[3]{x}\right)}^{2}}{{\left(\sqrt[3]{x + \tan x}\right)}^{2}}, \frac{\sqrt[3]{x}}{\color{blue}{\mathsf{fma}\left(0.3333333333333333, \frac{\sin x}{\cos x} \cdot \sqrt[3]{\frac{1}{x \cdot x}}, \sqrt[3]{x}\right)}}, -\frac{\sin x}{x + \tan x}\right) \]
  6. Applied egg-rr1.2

    \[\leadsto \mathsf{fma}\left(\frac{{\left(\sqrt[3]{x}\right)}^{2}}{{\left(\sqrt[3]{x + \tan x}\right)}^{2}}, \frac{\sqrt[3]{x}}{\mathsf{fma}\left(0.3333333333333333, \frac{\sin x}{\cos x} \cdot \color{blue}{\log \left(e^{\sqrt[3]{{x}^{-2}}}\right)}, \sqrt[3]{x}\right)}, -\frac{\sin x}{x + \tan x}\right) \]
  7. Final simplification1.2

    \[\leadsto \mathsf{fma}\left(\frac{{\left(\sqrt[3]{x}\right)}^{2}}{{\left(\sqrt[3]{x + \tan x}\right)}^{2}}, \frac{\sqrt[3]{x}}{\mathsf{fma}\left(0.3333333333333333, \frac{\sin x}{\cos x} \cdot \log \left(e^{\sqrt[3]{{x}^{-2}}}\right), \sqrt[3]{x}\right)}, -\frac{\sin x}{x + \tan x}\right) \]

Reproduce

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