Average Error: 59.4 → 59.4
Time: 9.0s
Precision: binary64
\[\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}\]
\[e^{\log \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) - x}\]
\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
e^{\log \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) - x}
double code(double x) {
	return ((double) (((double) fmod(((double) exp(x)), ((double) sqrt(((double) cos(x)))))) * ((double) exp(((double) -(x))))));
}
double code(double x) {
	return ((double) exp(((double) (((double) log(((double) fmod(((double) exp(x)), ((double) sqrt(((double) cos(x)))))))) - x))));
}

Error

Bits error versus x

Derivation

  1. Initial program Error: 59.4 bits

    \[\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}\]
  2. SimplifiedError: 59.4 bits

    \[\leadsto \color{blue}{\frac{\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right)}{e^{x}}}\]
  3. Using strategy rm
  4. Applied add-exp-logError: 59.4 bits

    \[\leadsto \frac{\color{blue}{e^{\log \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right)}}}{e^{x}}\]
  5. Applied div-expError: 59.4 bits

    \[\leadsto \color{blue}{e^{\log \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) - x}}\]
  6. Final simplificationError: 59.4 bits

    \[\leadsto e^{\log \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) - x}\]

Reproduce

herbie shell --seed 2020200 
(FPCore (x)
  :name "expfmod"
  :precision binary64
  (* (fmod (exp x) (sqrt (cos x))) (exp (- x))))