Average Error: 0.0 → 0.0
Time: 20.2s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\frac{1 \cdot 1 - x \cdot x}{\left(1 + x\right) \cdot 1 + x \cdot \left(1 + x\right)}}\right) \cdot 2\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
\tan^{-1} \left(\sqrt{\frac{1 \cdot 1 - x \cdot x}{\left(1 + x\right) \cdot 1 + x \cdot \left(1 + x\right)}}\right) \cdot 2
double f(double x) {
        double r560181 = 2.0;
        double r560182 = 1.0;
        double r560183 = x;
        double r560184 = r560182 - r560183;
        double r560185 = r560182 + r560183;
        double r560186 = r560184 / r560185;
        double r560187 = sqrt(r560186);
        double r560188 = atan(r560187);
        double r560189 = r560181 * r560188;
        return r560189;
}

double f(double x) {
        double r560190 = 1.0;
        double r560191 = r560190 * r560190;
        double r560192 = x;
        double r560193 = r560192 * r560192;
        double r560194 = r560191 - r560193;
        double r560195 = r560190 + r560192;
        double r560196 = r560195 * r560190;
        double r560197 = r560192 * r560195;
        double r560198 = r560196 + r560197;
        double r560199 = r560194 / r560198;
        double r560200 = sqrt(r560199);
        double r560201 = atan(r560200);
        double r560202 = 2.0;
        double r560203 = r560201 * r560202;
        return r560203;
}

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

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

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

Reproduce

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