Average Error: 0.0 → 0.0
Time: 13.3s
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)\]
double f(double x) {
        double r11975625 = 1.0;
        double r11975626 = x;
        double r11975627 = r11975625 / r11975626;
        double r11975628 = r11975626 * r11975626;
        double r11975629 = r11975625 - r11975628;
        double r11975630 = sqrt(r11975629);
        double r11975631 = r11975630 / r11975626;
        double r11975632 = r11975627 + r11975631;
        double r11975633 = log(r11975632);
        return r11975633;
}

double f(double x) {
        double r11975634 = 1.0;
        double r11975635 = x;
        double r11975636 = r11975634 / r11975635;
        double r11975637 = r11975635 * r11975635;
        double r11975638 = r11975634 - r11975637;
        double r11975639 = sqrt(r11975638);
        double r11975640 = r11975639 / r11975635;
        double r11975641 = r11975636 + r11975640;
        double r11975642 = log(r11975641);
        return r11975642;
}

\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)

Error

Bits error versus x

Derivation

  1. Initial program 0.0

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

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

Reproduce

herbie shell --seed 2019102 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))