Average Error: 0.1 → 0.1
Time: 5.2s
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 r74637 = 1.0;
        double r74638 = x;
        double r74639 = r74637 / r74638;
        double r74640 = r74638 * r74638;
        double r74641 = r74637 - r74640;
        double r74642 = sqrt(r74641);
        double r74643 = r74642 / r74638;
        double r74644 = r74639 + r74643;
        double r74645 = log(r74644);
        return r74645;
}

double f(double x) {
        double r74646 = 1.0;
        double r74647 = x;
        double r74648 = r74646 / r74647;
        double r74649 = r74647 * r74647;
        double r74650 = r74646 - r74649;
        double r74651 = sqrt(r74650);
        double r74652 = r74651 / r74647;
        double r74653 = r74648 + r74652;
        double r74654 = log(r74653);
        return r74654;
}

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