Average Error: 27.6 → 5.7
Time: 19.4s
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{\cos \left(2 \cdot x\right)}{cos \cdot \left(\left(\left(sin \cdot x\right) \cdot cos\right) \cdot \left(sin \cdot x\right)\right)}\]

Error

Bits error versus x

Bits error versus cos

Bits error versus sin

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 27.6

    \[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
  2. Using strategy rm
  3. Applied unpow227.6

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot \color{blue}{\left(sin \cdot sin\right)}\right) \cdot x\right)}\]
  4. Applied associate-*r*21.4

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\color{blue}{\left(\left(x \cdot sin\right) \cdot sin\right)} \cdot x\right)}\]
  5. Using strategy rm
  6. Applied unpow221.4

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left(cos \cdot cos\right)} \cdot \left(\left(\left(x \cdot sin\right) \cdot sin\right) \cdot x\right)}\]
  7. Applied associate-*l*16.1

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{cos \cdot \left(cos \cdot \left(\left(\left(x \cdot sin\right) \cdot sin\right) \cdot x\right)\right)}}\]
  8. Using strategy rm
  9. Applied associate-*l*13.1

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{cos \cdot \left(cos \cdot \color{blue}{\left(\left(x \cdot sin\right) \cdot \left(sin \cdot x\right)\right)}\right)}\]
  10. Using strategy rm
  11. Applied associate-*r*5.7

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{cos \cdot \color{blue}{\left(\left(cos \cdot \left(x \cdot sin\right)\right) \cdot \left(sin \cdot x\right)\right)}}\]
  12. Final simplification5.7

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{cos \cdot \left(\left(\left(sin \cdot x\right) \cdot cos\right) \cdot \left(sin \cdot x\right)\right)}\]

Reproduce

herbie shell --seed 2019030 +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))))