Average Error: 61.2 → 58.9
Time: 35.4s
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(1 + a\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(1 + a\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 r11763 = a;
        double r11764 = cosh(r11763);
        double r11765 = r11763 * r11763;
        double r11766 = fmod(r11764, r11765);
        double r11767 = log1p(r11763);
        double r11768 = pow(r11766, r11767);
        double r11769 = acos(r11768);
        return r11769;
}

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

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 log1p-udef61.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(1 + a\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(1 + a\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 +o rules:numerics
(FPCore (a)
  :name "Random Jason Timeout Test 012"
  :precision binary64
  (acos (pow (fmod (cosh a) (* a a)) (log1p a))))