Average Error: 0.0 → 0.0
Time: 9.5s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1}{1 + x} - \log \left(e^{\frac{x}{1 + x}}\right)}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\sqrt{\frac{1}{1 + x} - \log \left(e^{\frac{x}{1 + x}}\right)}\right)
double f(double x) {
        double r20147 = 2.0;
        double r20148 = 1.0;
        double r20149 = x;
        double r20150 = r20148 - r20149;
        double r20151 = r20148 + r20149;
        double r20152 = r20150 / r20151;
        double r20153 = sqrt(r20152);
        double r20154 = atan(r20153);
        double r20155 = r20147 * r20154;
        return r20155;
}

double f(double x) {
        double r20156 = 2.0;
        double r20157 = 1.0;
        double r20158 = x;
        double r20159 = r20157 + r20158;
        double r20160 = r20157 / r20159;
        double r20161 = r20158 / r20159;
        double r20162 = exp(r20161);
        double r20163 = log(r20162);
        double r20164 = r20160 - r20163;
        double r20165 = sqrt(r20164);
        double r20166 = atan(r20165);
        double r20167 = r20156 * r20166;
        return r20167;
}

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 div-sub0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\color{blue}{\frac{1}{1 + x} - \frac{x}{1 + x}}}\right)\]
  4. Using strategy rm
  5. Applied add-log-exp0.0

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

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

Reproduce

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