Average Error: 0.6 → 0.8
Time: 20.5s
Precision: 64
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)\]
\[\mathsf{expm1}\left(\sqrt{\mathsf{log1p}\left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)} \cdot \sqrt{\mathsf{log1p}\left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}\right)\]
\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)
\mathsf{expm1}\left(\sqrt{\mathsf{log1p}\left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)} \cdot \sqrt{\mathsf{log1p}\left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}\right)
double f(double v) {
        double r128863 = 1.0;
        double r128864 = 5.0;
        double r128865 = v;
        double r128866 = r128865 * r128865;
        double r128867 = r128864 * r128866;
        double r128868 = r128863 - r128867;
        double r128869 = r128866 - r128863;
        double r128870 = r128868 / r128869;
        double r128871 = acos(r128870);
        return r128871;
}

double f(double v) {
        double r128872 = 4.0;
        double r128873 = v;
        double r128874 = 4.0;
        double r128875 = pow(r128873, r128874);
        double r128876 = fma(r128873, r128873, r128875);
        double r128877 = 1.0;
        double r128878 = -r128877;
        double r128879 = fma(r128872, r128876, r128878);
        double r128880 = acos(r128879);
        double r128881 = log1p(r128880);
        double r128882 = sqrt(r128881);
        double r128883 = r128882 * r128882;
        double r128884 = expm1(r128883);
        return r128884;
}

Error

Bits error versus v

Derivation

  1. Initial program 0.6

    \[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)\]
  2. Using strategy rm
  3. Applied flip--0.6

    \[\leadsto \cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{\color{blue}{\frac{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - 1 \cdot 1}{v \cdot v + 1}}}\right)\]
  4. Applied associate-/r/0.6

    \[\leadsto \cos^{-1} \color{blue}{\left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - 1 \cdot 1} \cdot \left(v \cdot v + 1\right)\right)}\]
  5. Simplified0.6

    \[\leadsto \cos^{-1} \left(\color{blue}{\frac{1 - 5 \cdot {v}^{2}}{{v}^{4} - 1 \cdot 1}} \cdot \left(v \cdot v + 1\right)\right)\]
  6. Using strategy rm
  7. Applied expm1-log1p-u0.6

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\cos^{-1} \left(\frac{1 - 5 \cdot {v}^{2}}{{v}^{4} - 1 \cdot 1} \cdot \left(v \cdot v + 1\right)\right)\right)\right)}\]
  8. Simplified0.6

    \[\leadsto \mathsf{expm1}\left(\color{blue}{\mathsf{log1p}\left(\cos^{-1} \left(\mathsf{fma}\left(v, v, 1\right) \cdot \frac{1 - 5 \cdot {v}^{2}}{{v}^{4} - 1 \cdot 1}\right)\right)}\right)\]
  9. Taylor expanded around 0 0.8

    \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\cos^{-1} \color{blue}{\left(\left(4 \cdot {v}^{2} + 4 \cdot {v}^{4}\right) - 1\right)}\right)\right)\]
  10. Simplified0.8

    \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\cos^{-1} \color{blue}{\left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)}\right)\right)\]
  11. Using strategy rm
  12. Applied add-sqr-sqrt0.8

    \[\leadsto \mathsf{expm1}\left(\color{blue}{\sqrt{\mathsf{log1p}\left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)} \cdot \sqrt{\mathsf{log1p}\left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}}\right)\]
  13. Final simplification0.8

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

Reproduce

herbie shell --seed 2019212 +o rules:numerics
(FPCore (v)
  :name "Falkner and Boettcher, Appendix B, 1"
  :precision binary64
  (acos (/ (- 1 (* 5 (* v v))) (- (* v v) 1))))