Average Error: 0.5 → 0.6
Time: 9.8s
Precision: binary64
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right) \]
\[\begin{array}{l} t_0 := \cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)\\ \mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}\right)\right) \end{array} \]
\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)
\begin{array}{l}
t_0 := \cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)\\
\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}\right)\right)
\end{array}
(FPCore (v)
 :precision binary64
 (acos (/ (- 1.0 (* 5.0 (* v v))) (- (* v v) 1.0))))
(FPCore (v)
 :precision binary64
 (let* ((t_0 (acos (/ (fma v (* v -5.0) 1.0) (fma v v -1.0)))))
   (expm1 (log1p (cbrt (* t_0 (* t_0 t_0)))))))
double code(double v) {
	return acos((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0));
}
double code(double v) {
	double t_0 = acos(fma(v, (v * -5.0), 1.0) / fma(v, v, -1.0));
	return expm1(log1p(cbrt(t_0 * (t_0 * t_0))));
}

Error

Bits error versus v

Derivation

  1. Initial program 0.5

    \[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right) \]
  2. Simplified0.5

    \[\leadsto \color{blue}{\cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)} \]
  3. Applied expm1-log1p-u_binary640.6

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)\right)\right)} \]
  4. Applied add-cbrt-cube_binary640.6

    \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\sqrt[3]{\left(\cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right) \cdot \cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)\right) \cdot \cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)}}\right)\right) \]
  5. Final simplification0.6

    \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right) \cdot \left(\cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right) \cdot \cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)\right)}\right)\right) \]

Reproduce

herbie shell --seed 2021224 
(FPCore (v)
  :name "Falkner and Boettcher, Appendix B, 1"
  :precision binary64
  (acos (/ (- 1.0 (* 5.0 (* v v))) (- (* v v) 1.0))))