Average Error: 34.8 → 34.9
Time: 11.6s
Precision: 64
\[\left(\left(\cosh c\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
\[\left(\left(\mathsf{fma}\left(\frac{1}{24}, {c}^{4}, \mathsf{fma}\left(\frac{1}{2}, {c}^{2}, 1\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}{24}, {c}^{4}, \mathsf{fma}\left(\frac{1}{2}, {c}^{2}, 1\right)\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)
double code(double a, double c) {
	return fmod(cosh(c), log1p(a));
}
double code(double a, double c) {
	return fmod(fma(0.041666666666666664, pow(c, 4.0), fma(0.5, pow(c, 2.0), 1.0)), log1p(a));
}

Error

Bits error versus a

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 34.8

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

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

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

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

Reproduce

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