\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
Test:
arccos
Bits:
128 bits
Bits error versus x
Time: 8.9 s
Input Error: 0.1
Output Error: 0.1
Log:
Profile: 🕒
\(2 \cdot \tan^{-1} \left(\sqrt{e^{\log \left(1 - x\right) - \log_* (1 + x)}}\right)\)
  1. Started with
    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
    0.1
  2. Using strategy rm
    0.1
  3. Applied add-exp-log 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}{e^{\log \left(1 + x\right)}}}}\right)\]
    0.1
  4. Applied add-exp-log to get
    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{\color{red}{1 - x}}{e^{\log \left(1 + x\right)}}}\right) \leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{\color{blue}{e^{\log \left(1 - x\right)}}}{e^{\log \left(1 + x\right)}}}\right)\]
    0.1
  5. Applied div-exp to get
    \[2 \cdot \tan^{-1} \left(\sqrt{\color{red}{\frac{e^{\log \left(1 - x\right)}}{e^{\log \left(1 + x\right)}}}}\right) \leadsto 2 \cdot \tan^{-1} \left(\sqrt{\color{blue}{e^{\log \left(1 - x\right) - \log \left(1 + x\right)}}}\right)\]
    0.1
  6. Applied simplify to get
    \[2 \cdot \tan^{-1} \left(\sqrt{e^{\color{red}{\log \left(1 - x\right) - \log \left(1 + x\right)}}}\right) \leadsto 2 \cdot \tan^{-1} \left(\sqrt{e^{\color{blue}{\log \left(1 - x\right) - \log_* (1 + x)}}}\right)\]
    0.1

Original test:


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