Average Error: 0.0 → 0.0
Time: 10.8s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\left|\frac{\sqrt{1 \cdot 1 - x \cdot x}}{1 + x}\right|\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\left|\frac{\sqrt{1 \cdot 1 - x \cdot x}}{1 + x}\right|\right)
double f(double x) {
        double r24940 = 2.0;
        double r24941 = 1.0;
        double r24942 = x;
        double r24943 = r24941 - r24942;
        double r24944 = r24941 + r24942;
        double r24945 = r24943 / r24944;
        double r24946 = sqrt(r24945);
        double r24947 = atan(r24946);
        double r24948 = r24940 * r24947;
        return r24948;
}

double f(double x) {
        double r24949 = 2.0;
        double r24950 = 1.0;
        double r24951 = r24950 * r24950;
        double r24952 = x;
        double r24953 = r24952 * r24952;
        double r24954 = r24951 - r24953;
        double r24955 = sqrt(r24954);
        double r24956 = r24950 + r24952;
        double r24957 = r24955 / r24956;
        double r24958 = fabs(r24957);
        double r24959 = atan(r24958);
        double r24960 = r24949 * r24959;
        return r24960;
}

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 add-sqr-sqrt0.0

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

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

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

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

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

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

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

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

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

Reproduce

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