Average Error: 0.0 → 0.0
Time: 3.2s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{{1}^{3} \cdot {1}^{3} - {x}^{3} \cdot {x}^{3}} \cdot \left(\mathsf{fma}\left(1, 1, x \cdot x - 1 \cdot x\right) \cdot \left({1}^{3} - {x}^{3}\right)\right)}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{{1}^{3} \cdot {1}^{3} - {x}^{3} \cdot {x}^{3}} \cdot \left(\mathsf{fma}\left(1, 1, x \cdot x - 1 \cdot x\right) \cdot \left({1}^{3} - {x}^{3}\right)\right)}\right)
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) / ((pow(1.0, 3.0) * pow(1.0, 3.0)) - (pow(x, 3.0) * pow(x, 3.0)))) * (fma(1.0, 1.0, ((x * x) - (1.0 * x))) * (pow(1.0, 3.0) - pow(x, 3.0)))))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

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

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{\color{blue}{\frac{{1}^{3} + {x}^{3}}{1 \cdot 1 + \left(x \cdot x - 1 \cdot x\right)}}}}\right)\]
  4. Applied associate-/r/0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\color{blue}{\frac{1 - x}{{1}^{3} + {x}^{3}} \cdot \left(1 \cdot 1 + \left(x \cdot x - 1 \cdot x\right)\right)}}\right)\]
  5. Using strategy rm
  6. Applied flip-+0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{\color{blue}{\frac{{1}^{3} \cdot {1}^{3} - {x}^{3} \cdot {x}^{3}}{{1}^{3} - {x}^{3}}}} \cdot \left(1 \cdot 1 + \left(x \cdot x - 1 \cdot x\right)\right)}\right)\]
  7. Applied associate-/r/0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\color{blue}{\left(\frac{1 - x}{{1}^{3} \cdot {1}^{3} - {x}^{3} \cdot {x}^{3}} \cdot \left({1}^{3} - {x}^{3}\right)\right)} \cdot \left(1 \cdot 1 + \left(x \cdot x - 1 \cdot x\right)\right)}\right)\]
  8. Applied associate-*l*0.0

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

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

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{{1}^{3} \cdot {1}^{3} - {x}^{3} \cdot {x}^{3}} \cdot \left(\mathsf{fma}\left(1, 1, x \cdot x - 1 \cdot x\right) \cdot \left({1}^{3} - {x}^{3}\right)\right)}\right)\]

Reproduce

herbie shell --seed 2020071 +o rules:numerics
(FPCore (x)
  :name "arccos"
  :precision binary64
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))