Average Error: 0.0 → 0.0
Time: 2.2s
Precision: binary64
Cost: 20032
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{x} + \sqrt{1 + x} \cdot \frac{\sqrt{1 - x}}{x}\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{x} + \sqrt{1 + x} \cdot \frac{\sqrt{1 - x}}{x}\right)
(FPCore (x)
 :precision binary64
 (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))
(FPCore (x)
 :precision binary64
 (log (+ (/ 1.0 x) (* (sqrt (+ 1.0 x)) (/ (sqrt (- 1.0 x)) x)))))
double code(double x) {
	return log((1.0 / x) + (sqrt(1.0 - (x * x)) / x));
}
double code(double x) {
	return log((1.0 / x) + (sqrt(1.0 + x) * (sqrt(1.0 - x) / x)));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error0.0
Cost13632
\[\log \left(\frac{1}{x} + \frac{1}{x} \cdot \sqrt{1 - x \cdot x}\right)\]
Alternative 2
Error0.0
Cost13504
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
Alternative 3
Error0.3
Cost7104
\[\log \left(\frac{1}{x} + \left(\frac{1}{x} - x \cdot 0.5\right)\right)\]
Alternative 4
Error0.6
Cost6848
\[\log \left(\frac{1}{x} + \frac{1}{x}\right)\]
Alternative 5
Error55.0
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

    \[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
  2. Using strategy rm
  3. Applied *-un-lft-identity_binary64_21240.0

    \[\leadsto \log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{\color{blue}{1 \cdot x}}\right)\]
  4. Applied add-sqr-sqrt_binary64_21460.0

    \[\leadsto \log \left(\frac{1}{x} + \frac{\sqrt{\color{blue}{\sqrt{1} \cdot \sqrt{1}} - x \cdot x}}{1 \cdot x}\right)\]
  5. Applied difference-of-squares_binary64_20930.0

    \[\leadsto \log \left(\frac{1}{x} + \frac{\sqrt{\color{blue}{\left(\sqrt{1} + x\right) \cdot \left(\sqrt{1} - x\right)}}}{1 \cdot x}\right)\]
  6. Applied sqrt-prod_binary64_21400.0

    \[\leadsto \log \left(\frac{1}{x} + \frac{\color{blue}{\sqrt{\sqrt{1} + x} \cdot \sqrt{\sqrt{1} - x}}}{1 \cdot x}\right)\]
  7. Applied times-frac_binary64_21300.0

    \[\leadsto \log \left(\frac{1}{x} + \color{blue}{\frac{\sqrt{\sqrt{1} + x}}{1} \cdot \frac{\sqrt{\sqrt{1} - x}}{x}}\right)\]
  8. Simplified0.0

    \[\leadsto \log \left(\frac{1}{x} + \color{blue}{\sqrt{1 + x}} \cdot \frac{\sqrt{\sqrt{1} - x}}{x}\right)\]
  9. Simplified0.0

    \[\leadsto \log \left(\frac{1}{x} + \sqrt{1 + x} \cdot \color{blue}{\frac{\sqrt{1 - x}}{x}}\right)\]
  10. Simplified0.0

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

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

Reproduce

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