Average Error: 61.2 → 58.9
Time: 35.3s
Precision: 64
\[\cos^{-1} \left({\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}^{\left(\mathsf{log1p}\left(a\right)\right)}\right)\]
\[\begin{array}{l} \mathbf{if}\;a \le 1.581925211003102227236423252710955093583 \cdot 10^{-162}:\\ \;\;\;\;\cos^{-1} \left({\left(\log \left(e^{\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}\right)\right)}^{\left(\log \left(e^{\mathsf{log1p}\left(a\right)}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos^{-1} \left({\left(\log \left(e^{\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}\right)\right)}^{\left(\mathsf{log1p}\left(a\right)\right)}\right)\\ \end{array}\]
\cos^{-1} \left({\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}^{\left(\mathsf{log1p}\left(a\right)\right)}\right)
\begin{array}{l}
\mathbf{if}\;a \le 1.581925211003102227236423252710955093583 \cdot 10^{-162}:\\
\;\;\;\;\cos^{-1} \left({\left(\log \left(e^{\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}\right)\right)}^{\left(\log \left(e^{\mathsf{log1p}\left(a\right)}\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\cos^{-1} \left({\left(\log \left(e^{\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}\right)\right)}^{\left(\mathsf{log1p}\left(a\right)\right)}\right)\\

\end{array}
double f(double a) {
        double r11767 = a;
        double r11768 = cosh(r11767);
        double r11769 = r11767 * r11767;
        double r11770 = fmod(r11768, r11769);
        double r11771 = log1p(r11767);
        double r11772 = pow(r11770, r11771);
        double r11773 = acos(r11772);
        return r11773;
}

double f(double a) {
        double r11774 = a;
        double r11775 = 1.5819252110031022e-162;
        bool r11776 = r11774 <= r11775;
        double r11777 = cosh(r11774);
        double r11778 = r11774 * r11774;
        double r11779 = fmod(r11777, r11778);
        double r11780 = exp(r11779);
        double r11781 = log(r11780);
        double r11782 = log1p(r11774);
        double r11783 = exp(r11782);
        double r11784 = log(r11783);
        double r11785 = pow(r11781, r11784);
        double r11786 = acos(r11785);
        double r11787 = pow(r11781, r11782);
        double r11788 = acos(r11787);
        double r11789 = r11776 ? r11786 : r11788;
        return r11789;
}

Error

Bits error versus a

Derivation

  1. Split input into 2 regimes
  2. if a < 1.5819252110031022e-162

    1. Initial program 64.0

      \[\cos^{-1} \left({\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}^{\left(\mathsf{log1p}\left(a\right)\right)}\right)\]
    2. Using strategy rm
    3. Applied add-log-exp64.0

      \[\leadsto \cos^{-1} \left({\color{blue}{\left(\log \left(e^{\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}\right)\right)}}^{\left(\mathsf{log1p}\left(a\right)\right)}\right)\]
    4. Using strategy rm
    5. Applied add-log-exp61.3

      \[\leadsto \cos^{-1} \left({\left(\log \left(e^{\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}\right)\right)}^{\color{blue}{\left(\log \left(e^{\mathsf{log1p}\left(a\right)}\right)\right)}}\right)\]

    if 1.5819252110031022e-162 < a

    1. Initial program 58.6

      \[\cos^{-1} \left({\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}^{\left(\mathsf{log1p}\left(a\right)\right)}\right)\]
    2. Using strategy rm
    3. Applied add-log-exp56.8

      \[\leadsto \cos^{-1} \left({\color{blue}{\left(\log \left(e^{\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}\right)\right)}}^{\left(\mathsf{log1p}\left(a\right)\right)}\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le 1.581925211003102227236423252710955093583 \cdot 10^{-162}:\\ \;\;\;\;\cos^{-1} \left({\left(\log \left(e^{\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}\right)\right)}^{\left(\log \left(e^{\mathsf{log1p}\left(a\right)}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos^{-1} \left({\left(\log \left(e^{\left(\left(\cosh a\right) \bmod \left(a \cdot a\right)\right)}\right)\right)}^{\left(\mathsf{log1p}\left(a\right)\right)}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019350 
(FPCore (a)
  :name "Random Jason Timeout Test 012"
  :precision binary64
  (acos (pow (fmod (cosh a) (* a a)) (log1p a))))