Average Error: 27.0 → 1.9
Time: 49.2s
Precision: 64
Internal Precision: 576
\[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\cos \left(2 \cdot x\right)}{\left({cos}^{2} \cdot \left(x \cdot {sin}^{2}\right)\right) \cdot x} \le 2.3311889794139347 \cdot 10^{+262}:\\ \;\;\;\;\cos \left(2 \cdot x\right) \cdot \frac{1}{\left|\left(x \cdot cos\right) \cdot sin\right| \cdot \left|\left(x \cdot cos\right) \cdot sin\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{\cos \left(2 \cdot x\right)} \cdot \sqrt[3]{\cos \left(2 \cdot x\right)}}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|} \cdot \left(\left(\sqrt[3]{\frac{\sqrt[3]{\cos \left(2 \cdot x\right)}}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|}} \cdot \sqrt[3]{\frac{\sqrt[3]{\cos \left(2 \cdot x\right)}}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|}}\right) \cdot \sqrt[3]{\frac{\sqrt[3]{\cos \left(2 \cdot x\right)}}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|}}\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus cos

Bits error versus sin

Derivation

  1. Split input into 2 regimes
  2. if (/ (cos (* 2 x)) (* (* (pow cos 2) (* x (pow sin 2))) x)) < 2.3311889794139347e+262

    1. Initial program 16.7

      \[\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 add-sqr-sqrt16.7

      \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\sqrt{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)} \cdot \sqrt{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}}}\]
    4. Applied simplify16.6

      \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left|\left(x \cdot cos\right) \cdot sin\right|} \cdot \sqrt{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}}\]
    5. Applied simplify1.4

      \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\left|\left(x \cdot cos\right) \cdot sin\right| \cdot \color{blue}{\left|\left(x \cdot cos\right) \cdot sin\right|}}\]
    6. Using strategy rm
    7. Applied div-inv1.5

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

    if 2.3311889794139347e+262 < (/ (cos (* 2 x)) (* (* (pow cos 2) (* x (pow sin 2))) x))

    1. Initial program 59.8

      \[\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 add-sqr-sqrt59.8

      \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\sqrt{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)} \cdot \sqrt{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}}}\]
    4. Applied simplify59.8

      \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left|\left(x \cdot cos\right) \cdot sin\right|} \cdot \sqrt{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}}\]
    5. Applied simplify7.7

      \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\left|\left(x \cdot cos\right) \cdot sin\right| \cdot \color{blue}{\left|\left(x \cdot cos\right) \cdot sin\right|}}\]
    6. Using strategy rm
    7. Applied add-sqr-sqrt7.7

      \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\sqrt{\left|\left(x \cdot cos\right) \cdot sin\right| \cdot \left|\left(x \cdot cos\right) \cdot sin\right|} \cdot \sqrt{\left|\left(x \cdot cos\right) \cdot sin\right| \cdot \left|\left(x \cdot cos\right) \cdot sin\right|}}}\]
    8. Applied simplify9.5

      \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|} \cdot \sqrt{\left|\left(x \cdot cos\right) \cdot sin\right| \cdot \left|\left(x \cdot cos\right) \cdot sin\right|}}\]
    9. Applied simplify3.1

      \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right| \cdot \color{blue}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|}}\]
    10. Using strategy rm
    11. Applied add-cube-cbrt3.4

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\cos \left(2 \cdot x\right)} \cdot \sqrt[3]{\cos \left(2 \cdot x\right)}\right) \cdot \sqrt[3]{\cos \left(2 \cdot x\right)}}}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right| \cdot \left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|}\]
    12. Applied times-frac3.1

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\cos \left(2 \cdot x\right)} \cdot \sqrt[3]{\cos \left(2 \cdot x\right)}}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|} \cdot \frac{\sqrt[3]{\cos \left(2 \cdot x\right)}}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|}}\]
    13. Using strategy rm
    14. Applied add-cube-cbrt3.5

      \[\leadsto \frac{\sqrt[3]{\cos \left(2 \cdot x\right)} \cdot \sqrt[3]{\cos \left(2 \cdot x\right)}}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|} \cdot \color{blue}{\left(\left(\sqrt[3]{\frac{\sqrt[3]{\cos \left(2 \cdot x\right)}}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|}} \cdot \sqrt[3]{\frac{\sqrt[3]{\cos \left(2 \cdot x\right)}}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|}}\right) \cdot \sqrt[3]{\frac{\sqrt[3]{\cos \left(2 \cdot x\right)}}{\left|\left|\left(sin \cdot cos\right) \cdot x\right|\right|}}\right)}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 49.2s)Debug logProfile

herbie shell --seed '#(1071979731 1496239409 439705970 2863295848 982327776 189749553)' 
(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))))