Average Error: 27.1 → 2.3
Time: 24.9s
Precision: 64
Internal Precision: 128
\[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
\[\frac{\frac{\log_* (1 + (e^{\cos \left(2 \cdot x\right)} - 1)^*)}{sin \cdot \left(x \cdot cos\right)}}{sin \cdot \left(x \cdot cos\right)}\]

Error

Bits error versus x

Bits error versus cos

Bits error versus sin

Derivation

  1. Initial program 27.1

    \[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
  2. Simplified2.6

    \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}}\]
  3. Using strategy rm
  4. Applied associate-/r*2.3

    \[\leadsto \color{blue}{\frac{\frac{\cos \left(2 \cdot x\right)}{sin \cdot \left(x \cdot cos\right)}}{sin \cdot \left(x \cdot cos\right)}}\]
  5. Using strategy rm
  6. Applied log1p-expm1-u2.3

    \[\leadsto \frac{\frac{\color{blue}{\log_* (1 + (e^{\cos \left(2 \cdot x\right)} - 1)^*)}}{sin \cdot \left(x \cdot cos\right)}}{sin \cdot \left(x \cdot cos\right)}\]
  7. Final simplification2.3

    \[\leadsto \frac{\frac{\log_* (1 + (e^{\cos \left(2 \cdot x\right)} - 1)^*)}{sin \cdot \left(x \cdot cos\right)}}{sin \cdot \left(x \cdot cos\right)}\]

Reproduce

herbie shell --seed 2019068 +o rules:numerics
(FPCore (x cos sin)
  :name "cos(2*x)/(cos^2(x)*sin^2(x))"
  (/ (cos (* 2 x)) (* (pow cos 2) (* (* x (pow sin 2)) x))))