Average Error: 0.0 → 0.0
Time: 12.1s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\frac{1 - x \cdot x}{\left(1 + x\right) + \left(1 + x\right) \cdot x}}\right) \cdot 2\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
\tan^{-1} \left(\sqrt{\frac{1 - x \cdot x}{\left(1 + x\right) + \left(1 + x\right) \cdot x}}\right) \cdot 2
double f(double x) {
        double r609757 = 2.0;
        double r609758 = 1.0;
        double r609759 = x;
        double r609760 = r609758 - r609759;
        double r609761 = r609758 + r609759;
        double r609762 = r609760 / r609761;
        double r609763 = sqrt(r609762);
        double r609764 = atan(r609763);
        double r609765 = r609757 * r609764;
        return r609765;
}

double f(double x) {
        double r609766 = 1.0;
        double r609767 = x;
        double r609768 = r609767 * r609767;
        double r609769 = r609766 - r609768;
        double r609770 = r609766 + r609767;
        double r609771 = r609770 * r609767;
        double r609772 = r609770 + r609771;
        double r609773 = r609769 / r609772;
        double r609774 = sqrt(r609773);
        double r609775 = atan(r609774);
        double r609776 = 2.0;
        double r609777 = r609775 * r609776;
        return r609777;
}

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-rgt-in0.0

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

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

Reproduce

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