Average Error: 0.0 → 0.0
Time: 12.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 r634246 = 2.0;
        double r634247 = 1.0;
        double r634248 = x;
        double r634249 = r634247 - r634248;
        double r634250 = r634247 + r634248;
        double r634251 = r634249 / r634250;
        double r634252 = sqrt(r634251);
        double r634253 = atan(r634252);
        double r634254 = r634246 * r634253;
        return r634254;
}

double f(double x) {
        double r634255 = 2.0;
        double r634256 = 1.0;
        double r634257 = x;
        double r634258 = r634256 - r634257;
        double r634259 = sqrt(r634258);
        double r634260 = r634256 + r634257;
        double r634261 = sqrt(r634260);
        double r634262 = r634259 / r634261;
        double r634263 = atan(r634262);
        double r634264 = r634255 * r634263;
        return r634264;
}

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 2019172 +o rules:numerics
(FPCore (x)
  :name "arccos"
  (* 2.0 (atan (sqrt (/ (- 1.0 x) (+ 1.0 x))))))