Average Error: 34.1 → 33.7
Time: 14.9s
Precision: 64
\[\left(\left(\cosh c\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
\[\sqrt{\left(\left(\sqrt{\cosh c} \cdot \left(\sqrt{e^{-1 \cdot c} + e^{c}} \cdot \sqrt{\frac{1}{2}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)} \cdot \sqrt{\left(\left(\sqrt{\cosh c} \cdot \left(\sqrt{e^{-1 \cdot c} + e^{c}} \cdot \sqrt{\frac{1}{2}}\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)
\sqrt{\left(\left(\sqrt{\cosh c} \cdot \left(\sqrt{e^{-1 \cdot c} + e^{c}} \cdot \sqrt{\frac{1}{2}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)} \cdot \sqrt{\left(\left(\sqrt{\cosh c} \cdot \left(\sqrt{e^{-1 \cdot c} + e^{c}} \cdot \sqrt{\frac{1}{2}}\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 (sqrt(fmod((sqrt(cosh(c)) * (sqrt((exp((-1.0 * c)) + exp(c))) * sqrt(0.5))), log1p(a))) * sqrt(fmod((sqrt(cosh(c)) * (sqrt((exp((-1.0 * c)) + exp(c))) * sqrt(0.5))), 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.1

    \[\left(\left(\cosh c\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt34.1

    \[\leadsto \left(\color{blue}{\left(\sqrt{\cosh c} \cdot \sqrt{\cosh c}\right)} \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
  4. Taylor expanded around inf 34.0

    \[\leadsto \left(\left(\sqrt{\cosh c} \cdot \color{blue}{\left(\sqrt{e^{c} + e^{-c}} \cdot \sqrt{\frac{1}{2}}\right)}\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
  5. Simplified34.0

    \[\leadsto \left(\left(\sqrt{\cosh c} \cdot \color{blue}{\left(\sqrt{e^{-1 \cdot c} + e^{c}} \cdot \sqrt{\frac{1}{2}}\right)}\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt33.7

    \[\leadsto \color{blue}{\sqrt{\left(\left(\sqrt{\cosh c} \cdot \left(\sqrt{e^{-1 \cdot c} + e^{c}} \cdot \sqrt{\frac{1}{2}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)} \cdot \sqrt{\left(\left(\sqrt{\cosh c} \cdot \left(\sqrt{e^{-1 \cdot c} + e^{c}} \cdot \sqrt{\frac{1}{2}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)}}\]
  8. Final simplification33.7

    \[\leadsto \sqrt{\left(\left(\sqrt{\cosh c} \cdot \left(\sqrt{e^{-1 \cdot c} + e^{c}} \cdot \sqrt{\frac{1}{2}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)} \cdot \sqrt{\left(\left(\sqrt{\cosh c} \cdot \left(\sqrt{e^{-1 \cdot c} + e^{c}} \cdot \sqrt{\frac{1}{2}}\right)\right) \bmod \left(\mathsf{log1p}\left(a\right)\right)\right)}\]

Reproduce

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