Average Error: 0.1 → 0.1
Time: 3.1s
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 r95699 = 1.0;
        double r95700 = x;
        double r95701 = r95699 / r95700;
        double r95702 = r95700 * r95700;
        double r95703 = r95699 - r95702;
        double r95704 = sqrt(r95703);
        double r95705 = r95704 / r95700;
        double r95706 = r95701 + r95705;
        double r95707 = log(r95706);
        return r95707;
}

double f(double x) {
        double r95708 = 1.0;
        double r95709 = x;
        double r95710 = r95708 / r95709;
        double r95711 = r95709 * r95709;
        double r95712 = r95708 - r95711;
        double r95713 = sqrt(r95712);
        double r95714 = r95713 / r95709;
        double r95715 = r95710 + r95714;
        double r95716 = log(r95715);
        return r95716;
}

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