Average Error: 1.0 → 1.0
Time: 14.2s
Precision: 64
Internal Precision: 320
\[2 \cdot \cos \left(\frac{2 \cdot \pi}{3} + \frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right)\]
\[\log_* (1 + \left(e^{\cos \left((\left(\frac{2}{3}\right) \cdot \pi + \left(\frac{\cos^{-1} \left(-\frac{g}{h}\right)}{3}\right))_*\right)} - 1\right)) \cdot 2\]

Error

Bits error versus g

Bits error versus h

Derivation

  1. Initial program 1.0

    \[2 \cdot \cos \left(\frac{2 \cdot \pi}{3} + \frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right)\]
  2. Initial simplification1.0

    \[\leadsto \cos \left((\left(\frac{2}{3}\right) \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right) \cdot 2\]
  3. Using strategy rm
  4. Applied log1p-expm1-u1.0

    \[\leadsto \color{blue}{\log_* (1 + (e^{\cos \left((\left(\frac{2}{3}\right) \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)} - 1)^*)} \cdot 2\]
  5. Using strategy rm
  6. Applied expm1-udef1.0

    \[\leadsto \log_* (1 + \color{blue}{\left(e^{\cos \left((\left(\frac{2}{3}\right) \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)} - 1\right)}) \cdot 2\]
  7. Final simplification1.0

    \[\leadsto \log_* (1 + \left(e^{\cos \left((\left(\frac{2}{3}\right) \cdot \pi + \left(\frac{\cos^{-1} \left(-\frac{g}{h}\right)}{3}\right))_*\right)} - 1\right)) \cdot 2\]

Runtime

Time bar (total: 14.2s)Debug logProfile

herbie shell --seed 2018217 +o rules:numerics
(FPCore (g h)
  :name "2-ancestry mixing, negative discriminant"
  (* 2 (cos (+ (/ (* 2 PI) 3) (/ (acos (/ (- g) h)) 3)))))