Average Error: 0.0 → 0.0
Time: 10.8s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\left(1 - x\right) \cdot \frac{1 - x}{\left(1 - x\right) \cdot \left(1 + x\right)}}\right) \cdot 2\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
\tan^{-1} \left(\sqrt{\left(1 - x\right) \cdot \frac{1 - x}{\left(1 - x\right) \cdot \left(1 + x\right)}}\right) \cdot 2
double f(double x) {
        double r708135 = 2.0;
        double r708136 = 1.0;
        double r708137 = x;
        double r708138 = r708136 - r708137;
        double r708139 = r708136 + r708137;
        double r708140 = r708138 / r708139;
        double r708141 = sqrt(r708140);
        double r708142 = atan(r708141);
        double r708143 = r708135 * r708142;
        return r708143;
}

double f(double x) {
        double r708144 = 1.0;
        double r708145 = x;
        double r708146 = r708144 - r708145;
        double r708147 = r708144 + r708145;
        double r708148 = r708146 * r708147;
        double r708149 = r708146 / r708148;
        double r708150 = r708146 * r708149;
        double r708151 = sqrt(r708150);
        double r708152 = atan(r708151);
        double r708153 = 2.0;
        double r708154 = r708152 * r708153;
        return r708154;
}

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. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x)
  :name "arccos"
  (* 2.0 (atan (sqrt (/ (- 1.0 x) (+ 1.0 x))))))