Average Error: 0.0 → 0.0
Time: 9.7s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\frac{1 - x \cdot x}{x \cdot \left(1 + x\right) + \left(1 + x\right)}}\right) \cdot 2\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
\tan^{-1} \left(\sqrt{\frac{1 - x \cdot x}{x \cdot \left(1 + x\right) + \left(1 + x\right)}}\right) \cdot 2
double f(double x) {
        double r671948 = 2.0;
        double r671949 = 1.0;
        double r671950 = x;
        double r671951 = r671949 - r671950;
        double r671952 = r671949 + r671950;
        double r671953 = r671951 / r671952;
        double r671954 = sqrt(r671953);
        double r671955 = atan(r671954);
        double r671956 = r671948 * r671955;
        return r671956;
}

double f(double x) {
        double r671957 = 1.0;
        double r671958 = x;
        double r671959 = r671958 * r671958;
        double r671960 = r671957 - r671959;
        double r671961 = r671957 + r671958;
        double r671962 = r671958 * r671961;
        double r671963 = r671962 + r671961;
        double r671964 = r671960 / r671963;
        double r671965 = sqrt(r671964);
        double r671966 = atan(r671965);
        double r671967 = 2.0;
        double r671968 = r671966 * r671967;
        return r671968;
}

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 flip--0.0

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

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

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

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

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

Reproduce

herbie shell --seed 2019168 
(FPCore (x)
  :name "arccos"
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))