x \cdot \sqrt{y \cdot y - z \cdot z}
\begin{array}{l}
\mathbf{if}\;y \leq -3.7165584773607825 \cdot 10^{-270}:\\
\;\;\;\;0.5 \cdot \frac{z \cdot \left(z \cdot x\right)}{y} - y \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
(FPCore (x y z) :precision binary64 (* x (sqrt (- (* y y) (* z z)))))
(FPCore (x y z) :precision binary64 (if (<= y -3.7165584773607825e-270) (- (* 0.5 (/ (* z (* z x)) y)) (* y x)) (* y x)))
double code(double x, double y, double z) {
return x * sqrt((y * y) - (z * z));
}
double code(double x, double y, double z) {
double tmp;
if (y <= -3.7165584773607825e-270) {
tmp = (0.5 * ((z * (z * x)) / y)) - (y * x);
} else {
tmp = y * x;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 24.4 |
|---|---|
| Target | 0.6 |
| Herbie | 1.2 |
if y < -3.7165584773607825e-270Initial program 24.8
Taylor expanded in y around -inf 3.7
Applied unpow2_binary643.7
Applied associate-*l*_binary641.7
if -3.7165584773607825e-270 < y Initial program 23.9
Taylor expanded in y around inf 0.7
Final simplification1.2
herbie shell --seed 2021280
(FPCore (x y z)
:name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, B"
:precision binary64
:herbie-target
(if (< y 2.5816096488251695e-278) (- (* x y)) (* x (* (sqrt (+ y z)) (sqrt (- y z)))))
(* x (sqrt (- (* y y) (* z z)))))