Average Error: 32.6 → 32.7
Time: 14.5s
Precision: binary64
\[\frac{\left(\left(\left(\left(-0.5\right) \cdot x\right) \cdot \sin x - 3 \cdot {\left(\cos \left(0.5 \cdot x\right)\right)}^{2}\right) + 2 \cdot \cos \left(0.5 \cdot x\right)\right) + 1}{\left(\left(\left(-0.5\right) \cdot \sin x - 3 \cdot {\left(\cos \left(0.5 \cdot x\right)\right)}^{2}\right) + 2 \cdot \cos \left(0.5 \cdot x\right)\right) + 1}\]
\[-\frac{0.5 \cdot \left(x \cdot \sin x\right) + \left(3 \cdot {\left(\cos \left(0.5 \cdot x\right)\right)}^{2} - \left(2 \cdot \cos \left(0.5 \cdot x\right) + 1\right)\right)}{\left(2 \cdot \cos \left(0.5 \cdot x\right) + 1\right) - \left(0.5 \cdot \sin x + 3 \cdot {\left(\cos \left(0.5 \cdot x\right)\right)}^{2}\right)}\]

Error

Bits error versus x

Derivation

  1. Initial program 32.6

    \[\frac{\left(\left(\left(\left(-0.5\right) \cdot x\right) \cdot \sin x - 3 \cdot {\left(\cos \left(0.5 \cdot x\right)\right)}^{2}\right) + 2 \cdot \cos \left(0.5 \cdot x\right)\right) + 1}{\left(\left(\left(-0.5\right) \cdot \sin x - 3 \cdot {\left(\cos \left(0.5 \cdot x\right)\right)}^{2}\right) + 2 \cdot \cos \left(0.5 \cdot x\right)\right) + 1}\]
  2. Simplified32.7

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

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

Reproduce

herbie shell --seed 2020152 
(FPCore (x)
  :name "(/ (+ (+ (- (* (* (- 0.5) x) (sin x)) (* 3 (pow (cos (* 0.5 x)) 2))) (* 2 (cos (* 0.5 x)))) 1) (+ (+ (- (* (- 0.5) (sin x)) (* 3 (pow (cos (* 0.5 x)) 2))) (* 2 (cos (* 0.5 x)))) 1))"
  :precision binary64
  (/ (+ (+ (- (* (* (neg 0.5) x) (sin x)) (* 3.0 (pow (cos (* 0.5 x)) 2.0))) (* 2.0 (cos (* 0.5 x)))) 1.0) (+ (+ (- (* (neg 0.5) (sin x)) (* 3.0 (pow (cos (* 0.5 x)) 2.0))) (* 2.0 (cos (* 0.5 x)))) 1.0)))