(FPCore (x) :precision binary64 (sqrt (- 1.0 (* x x))))
(FPCore (x) :precision binary64 (fma x (* x -0.5) 1.0))
double code(double x) {
return sqrt((1.0 - (x * x)));
}
double code(double x) {
return fma(x, (x * -0.5), 1.0);
}
function code(x) return sqrt(Float64(1.0 - Float64(x * x))) end
function code(x) return fma(x, Float64(x * -0.5), 1.0) end
code[x_] := N[Sqrt[N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[x_] := N[(x * N[(x * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]
\sqrt{1 - x \cdot x}
\mathsf{fma}\left(x, x \cdot -0.5, 1\right)



Bits error versus x
Initial program 0.0
Taylor expanded in x around 0 0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2022131
(FPCore (x)
:name "Diagrams.TwoD.Ellipse:ellipse from diagrams-lib-1.3.0.3"
:precision binary64
(sqrt (- 1.0 (* x x))))