Average Error: 0.0 → 0.0
Time: 24.0s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\left|\frac{\frac{\sqrt{{1}^{3} - {x}^{3}}}{\sqrt{\mathsf{fma}\left(1, 1, \left(x + 1\right) \cdot x\right)}}}{\sqrt{1 + x}}\right|\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\left|\frac{\frac{\sqrt{{1}^{3} - {x}^{3}}}{\sqrt{\mathsf{fma}\left(1, 1, \left(x + 1\right) \cdot x\right)}}}{\sqrt{1 + x}}\right|\right)
double f(double x) {
        double r46324 = 2.0;
        double r46325 = 1.0;
        double r46326 = x;
        double r46327 = r46325 - r46326;
        double r46328 = r46325 + r46326;
        double r46329 = r46327 / r46328;
        double r46330 = sqrt(r46329);
        double r46331 = atan(r46330);
        double r46332 = r46324 * r46331;
        return r46332;
}

double f(double x) {
        double r46333 = 2.0;
        double r46334 = 1.0;
        double r46335 = 3.0;
        double r46336 = pow(r46334, r46335);
        double r46337 = x;
        double r46338 = pow(r46337, r46335);
        double r46339 = r46336 - r46338;
        double r46340 = sqrt(r46339);
        double r46341 = r46337 + r46334;
        double r46342 = r46341 * r46337;
        double r46343 = fma(r46334, r46334, r46342);
        double r46344 = sqrt(r46343);
        double r46345 = r46340 / r46344;
        double r46346 = r46334 + r46337;
        double r46347 = sqrt(r46346);
        double r46348 = r46345 / r46347;
        double r46349 = fabs(r46348);
        double r46350 = atan(r46349);
        double r46351 = r46333 * r46350;
        return r46351;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{\color{blue}{\sqrt{1 + x} \cdot \sqrt{1 + x}}}}\right)\]
  4. Applied add-sqr-sqrt0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{\color{blue}{\sqrt{1 - x} \cdot \sqrt{1 - x}}}{\sqrt{1 + x} \cdot \sqrt{1 + x}}}\right)\]
  5. Applied times-frac0.0

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

    \[\leadsto 2 \cdot \tan^{-1} \color{blue}{\left(\left|\frac{\sqrt{1 - x}}{\sqrt{1 + x}}\right|\right)}\]
  7. Using strategy rm
  8. Applied flip3--0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\left|\frac{\sqrt{\color{blue}{\frac{{1}^{3} - {x}^{3}}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}}}}{\sqrt{1 + x}}\right|\right)\]
  9. Applied sqrt-div0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\left|\frac{\color{blue}{\frac{\sqrt{{1}^{3} - {x}^{3}}}{\sqrt{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}}}}{\sqrt{1 + x}}\right|\right)\]
  10. Simplified0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\left|\frac{\frac{\sqrt{{1}^{3} - {x}^{3}}}{\color{blue}{\sqrt{\mathsf{fma}\left(1, 1, \left(x + 1\right) \cdot x\right)}}}}{\sqrt{1 + x}}\right|\right)\]
  11. Final simplification0.0

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

Reproduce

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