Average Error: 0.0 → 0.0
Time: 6.5s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\frac{\sqrt{1 - x}}{\sqrt{1 + x}}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\frac{\sqrt{1 - x}}{\sqrt{1 + x}}\right)
double f(double x) {
        double r10078 = 2.0;
        double r10079 = 1.0;
        double r10080 = x;
        double r10081 = r10079 - r10080;
        double r10082 = r10079 + r10080;
        double r10083 = r10081 / r10082;
        double r10084 = sqrt(r10083);
        double r10085 = atan(r10084);
        double r10086 = r10078 * r10085;
        return r10086;
}

double f(double x) {
        double r10087 = 2.0;
        double r10088 = 1.0;
        double r10089 = x;
        double r10090 = r10088 - r10089;
        double r10091 = sqrt(r10090);
        double r10092 = r10088 + r10089;
        double r10093 = sqrt(r10092);
        double r10094 = r10091 / r10093;
        double r10095 = atan(r10094);
        double r10096 = r10087 * r10095;
        return r10096;
}

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 sqrt-div0.0

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

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

Reproduce

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