Average Error: 0.0 → 0.0
Time: 4.9s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\left(\frac{1}{1 \cdot 1 - x \cdot x} - \frac{x}{1 \cdot 1 - x \cdot x}\right) \cdot \left(1 - x\right)}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\sqrt{\left(\frac{1}{1 \cdot 1 - x \cdot x} - \frac{x}{1 \cdot 1 - x \cdot x}\right) \cdot \left(1 - x\right)}\right)
double f(double x) {
        double r18630 = 2.0;
        double r18631 = 1.0;
        double r18632 = x;
        double r18633 = r18631 - r18632;
        double r18634 = r18631 + r18632;
        double r18635 = r18633 / r18634;
        double r18636 = sqrt(r18635);
        double r18637 = atan(r18636);
        double r18638 = r18630 * r18637;
        return r18638;
}

double f(double x) {
        double r18639 = 2.0;
        double r18640 = 1.0;
        double r18641 = r18640 * r18640;
        double r18642 = x;
        double r18643 = r18642 * r18642;
        double r18644 = r18641 - r18643;
        double r18645 = r18640 / r18644;
        double r18646 = r18642 / r18644;
        double r18647 = r18645 - r18646;
        double r18648 = r18640 - r18642;
        double r18649 = r18647 * r18648;
        double r18650 = sqrt(r18649);
        double r18651 = atan(r18650);
        double r18652 = r18639 * r18651;
        return r18652;
}

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{1 - x}{\color{blue}{\frac{1 \cdot 1 - x \cdot x}{1 - x}}}}\right)\]
  4. Applied associate-/r/0.0

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

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

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

Reproduce

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