Average Error: 0.1 → 0.1
Time: 6.5s
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 r66877 = 1.0;
        double r66878 = x;
        double r66879 = r66877 / r66878;
        double r66880 = r66878 * r66878;
        double r66881 = r66877 - r66880;
        double r66882 = sqrt(r66881);
        double r66883 = r66882 / r66878;
        double r66884 = r66879 + r66883;
        double r66885 = log(r66884);
        return r66885;
}

double f(double x) {
        double r66886 = 1.0;
        double r66887 = x;
        double r66888 = r66886 / r66887;
        double r66889 = r66887 * r66887;
        double r66890 = r66886 - r66889;
        double r66891 = sqrt(r66890);
        double r66892 = r66891 / r66887;
        double r66893 = r66888 + r66892;
        double r66894 = log(r66893);
        return r66894;
}

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 2020083 
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  :precision binary64
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))