\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
Test:
arccos
Bits:
128 bits
Bits error versus x
Time: 5.5 s
Input Error: 0.0
Output Error: 0.0
Log:
Profile: 🕒
\(2 \cdot \tan^{-1} \left(\sqrt{{\left(\frac{\sqrt{1 - x}}{\sqrt{1 + x}}\right)}^2}\right)\)
  1. Started with
    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
    0.0
  2. Using strategy rm
    0.0
  3. Applied add-sqr-sqrt to get
    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{\color{red}{1 + x}}}\right) \leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{\color{blue}{{\left(\sqrt{1 + x}\right)}^2}}}\right)\]
    0.0
  4. Applied add-sqr-sqrt to get
    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{\color{red}{1 - x}}{{\left(\sqrt{1 + x}\right)}^2}}\right) \leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{\color{blue}{{\left(\sqrt{1 - x}\right)}^2}}{{\left(\sqrt{1 + x}\right)}^2}}\right)\]
    0.0
  5. Applied square-undiv to get
    \[2 \cdot \tan^{-1} \left(\sqrt{\color{red}{\frac{{\left(\sqrt{1 - x}\right)}^2}{{\left(\sqrt{1 + x}\right)}^2}}}\right) \leadsto 2 \cdot \tan^{-1} \left(\sqrt{\color{blue}{{\left(\frac{\sqrt{1 - x}}{\sqrt{1 + x}}\right)}^2}}\right)\]
    0.0

  6. Removed slow pow expressions

Original test:


(lambda ((x default))
  #:name "arccos"
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))