Average Error: 0.0 → 0.0
Time: 2.0s
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 r4967 = 2.0;
        double r4968 = 1.0;
        double r4969 = x;
        double r4970 = r4968 - r4969;
        double r4971 = r4968 + r4969;
        double r4972 = r4970 / r4971;
        double r4973 = sqrt(r4972);
        double r4974 = atan(r4973);
        double r4975 = r4967 * r4974;
        return r4975;
}

double f(double x) {
        double r4976 = 2.0;
        double r4977 = 1.0;
        double r4978 = x;
        double r4979 = r4977 - r4978;
        double r4980 = sqrt(r4979);
        double r4981 = r4977 + r4978;
        double r4982 = sqrt(r4981);
        double r4983 = r4980 / r4982;
        double r4984 = atan(r4983);
        double r4985 = r4976 * r4984;
        return r4985;
}

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 2020060 +o rules:numerics
(FPCore (x)
  :name "arccos"
  :precision binary64
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))