Average Error: 0.0 → 0.0
Time: 4.2s
Precision: binary64
Cost: 13632
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1}{1 + x} - \frac{x}{1 + x}}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\sqrt{\frac{1}{1 + x} - \frac{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 (+ 1.0 x)) (/ 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 / (1.0 + x)) - (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.0
Cost46144
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{\sqrt{1 - x}}{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \frac{\sqrt{1 - x}}{\sqrt[3]{1 + x}}}\right)\]
Alternative 2
Error0.0
Cost39488
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{\sqrt{1 - x}}{\sqrt{1 + x}} \cdot \frac{\sqrt{1 - x}}{\sqrt{1 + x}}}\right)\]
Alternative 3
Error0.0
Cost33600
\[2 \cdot \tan^{-1} \left(\sqrt{\sqrt[3]{\frac{1 - x}{1 + x}} \cdot \left(\sqrt[3]{\frac{1 - x}{1 + x}} \cdot \sqrt[3]{\frac{1 - x}{1 + x}}\right)}\right)\]
Alternative 4
Error0.0
Cost33216
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1}{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \frac{1 - x}{\sqrt[3]{1 + x}}}\right)\]
Alternative 5
Error0.0
Cost33088
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{\frac{1 - x}{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}}}{\sqrt[3]{1 + x}}}\right)\]
Alternative 6
Error0.0
Cost26560
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{\sqrt{1 + x}} \cdot \frac{1}{\sqrt{1 + x}}}\right)\]
Alternative 7
Error0.0
Cost26432
\[2 \cdot \tan^{-1} \left(\sqrt{\sqrt{1 - x} \cdot \frac{\sqrt{1 - x}}{1 + x}}\right)\]
Alternative 8
Error0.0
Cost26432
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{\frac{1 - x}{\sqrt{1 + x}}}{\sqrt{1 + x}}}\right)\]
Alternative 9
Error32.2
Cost26432
\[2 \cdot \tan^{-1} \left(\sqrt{\left(1 + \sqrt{x}\right) \cdot \frac{1 - \sqrt{x}}{1 + x}}\right)\]
Alternative 10
Error0.0
Cost26240
\[2 \cdot \sqrt[3]{{\tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)}^{3}}\]
Alternative 11
Error0.0
Cost26240
\[2 \cdot \tan^{-1} \left(\sqrt[3]{{\left(\sqrt{\frac{1 - x}{1 + x}}\right)}^{3}}\right)\]
Alternative 12
Error0.0
Cost19776
\[2 \cdot \tan^{-1} \left(\frac{\sqrt{1 - x}}{\sqrt{1 + x}}\right)\]
Alternative 13
Error0.0
Cost13504
\[2 \cdot \tan^{-1} \left(\sqrt{\left(1 - x\right) \cdot \frac{1}{1 + x}}\right)\]
Alternative 14
Error0.0
Cost13376
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
Alternative 15
Error0.7
Cost13248
\[2 \cdot \tan^{-1} \left(\sqrt{1 - \left(x + x\right)}\right)\]
Alternative 16
Error0.3
Cost7360
\[2 \cdot \tan^{-1} \left(\left(1 - x\right) + \left(1 - x\right) \cdot \left(\left(x \cdot x\right) \cdot 0.5\right)\right)\]
Alternative 17
Error0.4
Cost7104
\[2 \cdot \tan^{-1} \left(\left(1 - x\right) + \left(x \cdot x\right) \cdot 0.5\right)\]
Alternative 18
Error0.7
Cost6720
\[2 \cdot \tan^{-1} \left(1 - x\right)\]
Alternative 19
Error1.4
Cost6592
\[2 \cdot \tan^{-1} 1\]
Alternative 20
Error51.2
Cost64
\[1\]
Alternative 21
Error62.0
Cost64
\[0\]
Alternative 22
Error63.0
Cost64
\[-1\]

Error

Derivation

  1. Initial program 0.0

    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
  2. Using strategy rm
  3. Applied div-sub_binary640.0

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

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

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

Reproduce

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