Average Error: 34.7 → 34.8
Time: 38.8s
Precision: 64
\[\left(\left(\cosh c\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
\[\left(\left(\mathsf{fma}\left(\frac{1}{2} \cdot c, c, e^{\sqrt{\mathsf{log1p}\left(\frac{1}{24} \cdot {c}^{4}\right)} \cdot \sqrt{\mathsf{log1p}\left(\frac{1}{24} \cdot {c}^{4}\right)}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
\left(\left(\cosh c\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)
\left(\left(\mathsf{fma}\left(\frac{1}{2} \cdot c, c, e^{\sqrt{\mathsf{log1p}\left(\frac{1}{24} \cdot {c}^{4}\right)} \cdot \sqrt{\mathsf{log1p}\left(\frac{1}{24} \cdot {c}^{4}\right)}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)
double f(double a, double c) {
        double r35437 = c;
        double r35438 = cosh(r35437);
        double r35439 = a;
        double r35440 = log1p(r35439);
        double r35441 = fmod(r35438, r35440);
        return r35441;
}

double f(double a, double c) {
        double r35442 = 0.5;
        double r35443 = c;
        double r35444 = r35442 * r35443;
        double r35445 = 0.041666666666666664;
        double r35446 = 4.0;
        double r35447 = pow(r35443, r35446);
        double r35448 = r35445 * r35447;
        double r35449 = log1p(r35448);
        double r35450 = sqrt(r35449);
        double r35451 = r35450 * r35450;
        double r35452 = exp(r35451);
        double r35453 = fma(r35444, r35443, r35452);
        double r35454 = a;
        double r35455 = log1p(r35454);
        double r35456 = fmod(r35453, r35455);
        return r35456;
}

Error

Bits error versus a

Bits error versus c

Derivation

  1. Initial program 34.7

    \[\left(\left(\cosh c\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
  2. Taylor expanded around 0 34.8

    \[\leadsto \left(\color{blue}{\left(\frac{1}{2} \cdot {c}^{2} + \left(\frac{1}{24} \cdot {c}^{4} + 1\right)\right)} \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
  3. Simplified34.8

    \[\leadsto \left(\color{blue}{\left(\mathsf{fma}\left(\frac{1}{2} \cdot c, c, \mathsf{fma}\left({c}^{4}, \frac{1}{24}, 1\right)\right)\right)} \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
  4. Using strategy rm
  5. Applied add-exp-log34.8

    \[\leadsto \left(\left(\mathsf{fma}\left(\frac{1}{2} \cdot c, c, \color{blue}{e^{\log \left(\mathsf{fma}\left({c}^{4}, \frac{1}{24}, 1\right)\right)}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
  6. Simplified34.8

    \[\leadsto \left(\left(\mathsf{fma}\left(\frac{1}{2} \cdot c, c, e^{\color{blue}{\mathsf{log1p}\left({c}^{4} \cdot \frac{1}{24}\right)}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
  7. Using strategy rm
  8. Applied add-sqr-sqrt34.8

    \[\leadsto \left(\left(\mathsf{fma}\left(\frac{1}{2} \cdot c, c, e^{\color{blue}{\sqrt{\mathsf{log1p}\left({c}^{4} \cdot \frac{1}{24}\right)} \cdot \sqrt{\mathsf{log1p}\left({c}^{4} \cdot \frac{1}{24}\right)}}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
  9. Simplified34.8

    \[\leadsto \left(\left(\mathsf{fma}\left(\frac{1}{2} \cdot c, c, e^{\color{blue}{\sqrt{\mathsf{log1p}\left(\frac{1}{24} \cdot {c}^{4}\right)}} \cdot \sqrt{\mathsf{log1p}\left({c}^{4} \cdot \frac{1}{24}\right)}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
  10. Simplified34.8

    \[\leadsto \left(\left(\mathsf{fma}\left(\frac{1}{2} \cdot c, c, e^{\sqrt{\mathsf{log1p}\left(\frac{1}{24} \cdot {c}^{4}\right)} \cdot \color{blue}{\sqrt{\mathsf{log1p}\left(\frac{1}{24} \cdot {c}^{4}\right)}}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
  11. Final simplification34.8

    \[\leadsto \left(\left(\mathsf{fma}\left(\frac{1}{2} \cdot c, c, e^{\sqrt{\mathsf{log1p}\left(\frac{1}{24} \cdot {c}^{4}\right)} \cdot \sqrt{\mathsf{log1p}\left(\frac{1}{24} \cdot {c}^{4}\right)}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]

Reproduce

herbie shell --seed 2019195 +o rules:numerics
(FPCore (a c)
  :name "Random Jason Timeout Test 004"
  (fmod (cosh c) (log1p a)))