Average Error: 0.0 → 0.0
Time: 3.2min
Precision: binary64
Cost: 13376
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
(FPCore (x) :precision binary64 (* 2.0 (atan (sqrt (/ (- 1.0 x) (+ 1.0 x))))))
(FPCore (x) :precision binary64 (* 2.0 (atan (sqrt (/ (- 1.0 x) (+ 1.0 x))))))
double code(double x) {
	return 2.0 * atan(sqrt((1.0 - x) / (1.0 + x)));
}
double code(double x) {
	return 2.0 * atan(sqrt((1.0 - x) / (1.0 + x)));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error0.4
Cost7104
\[2 \cdot \tan^{-1} \left(\left(1 - x\right) + \left(x \cdot x\right) \cdot 0.5\right)\]
Alternative 2
Error0.6
Cost6720
\[2 \cdot \tan^{-1} \left(1 - x\right)\]
Alternative 3
Error1.3
Cost6592
\[2 \cdot \tan^{-1} 1\]
Alternative 4
Error51.2
Cost64
\[1\]

Error

Time

Derivation

  1. Initial program 0.0

    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
  2. Simplified0.0

    \[\leadsto \color{blue}{2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)}\]
  3. Final simplification0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]

Reproduce

herbie shell --seed 2021065 
(FPCore (x)
  :name "arccos"
  :precision binary64
  (* 2.0 (atan (sqrt (/ (- 1.0 x) (+ 1.0 x))))))