Average Error: 0.0 → 0.2
Time: 2.0s
Precision: 64
\[\sqrt{1 - x \cdot x}\]
\[\sqrt{1} - \left(\frac{1}{8} \cdot \frac{{x}^{4}}{{\left(\sqrt{1}\right)}^{3}} + \frac{1}{2} \cdot \frac{{x}^{2}}{\sqrt{1}}\right)\]
\sqrt{1 - x \cdot x}
\sqrt{1} - \left(\frac{1}{8} \cdot \frac{{x}^{4}}{{\left(\sqrt{1}\right)}^{3}} + \frac{1}{2} \cdot \frac{{x}^{2}}{\sqrt{1}}\right)
double code(double x) {
	return sqrt((1.0 - (x * x)));
}
double code(double x) {
	return (sqrt(1.0) - ((0.125 * (pow(x, 4.0) / pow(sqrt(1.0), 3.0))) + (0.5 * (pow(x, 2.0) / sqrt(1.0)))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\sqrt{1 - x \cdot x}\]
  2. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{\sqrt{1} - \left(\frac{1}{8} \cdot \frac{{x}^{4}}{{\left(\sqrt{1}\right)}^{3}} + \frac{1}{2} \cdot \frac{{x}^{2}}{\sqrt{1}}\right)}\]
  3. Final simplification0.2

    \[\leadsto \sqrt{1} - \left(\frac{1}{8} \cdot \frac{{x}^{4}}{{\left(\sqrt{1}\right)}^{3}} + \frac{1}{2} \cdot \frac{{x}^{2}}{\sqrt{1}}\right)\]

Reproduce

herbie shell --seed 2020060 +o rules:numerics
(FPCore (x)
  :name "Diagrams.TwoD.Ellipse:ellipse from diagrams-lib-1.3.0.3"
  :precision binary64
  (sqrt (- 1 (* x x))))