Average Error: 0.1 → 0.1
Time: 4.7s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
double f(double x) {
        double r67164 = 1.0;
        double r67165 = x;
        double r67166 = r67164 / r67165;
        double r67167 = r67165 * r67165;
        double r67168 = r67164 - r67167;
        double r67169 = sqrt(r67168);
        double r67170 = r67169 / r67165;
        double r67171 = r67166 + r67170;
        double r67172 = log(r67171);
        return r67172;
}

double f(double x) {
        double r67173 = 1.0;
        double r67174 = x;
        double r67175 = r67173 / r67174;
        double r67176 = r67174 * r67174;
        double r67177 = r67173 - r67176;
        double r67178 = sqrt(r67177);
        double r67179 = r67178 / r67174;
        double r67180 = r67175 + r67179;
        double r67181 = log(r67180);
        return r67181;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
  2. Final simplification0.1

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

Reproduce

herbie shell --seed 2020033 
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  :precision binary64
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))