x \cdot \sqrt{y \cdot y - z \cdot z}\begin{array}{l}
\mathbf{if}\;y \le -4.17286658231481322 \cdot 10^{-249}:\\
\;\;\;\;x \cdot \left(-1 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}double f(double x, double y, double z) {
double r737006 = x;
double r737007 = y;
double r737008 = r737007 * r737007;
double r737009 = z;
double r737010 = r737009 * r737009;
double r737011 = r737008 - r737010;
double r737012 = sqrt(r737011);
double r737013 = r737006 * r737012;
return r737013;
}
double f(double x, double y, double __attribute__((unused)) z) {
double r737014 = y;
double r737015 = -4.172866582314813e-249;
bool r737016 = r737014 <= r737015;
double r737017 = x;
double r737018 = -1.0;
double r737019 = r737018 * r737014;
double r737020 = r737017 * r737019;
double r737021 = r737017 * r737014;
double r737022 = r737016 ? r737020 : r737021;
return r737022;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 25.3 |
|---|---|
| Target | 0.6 |
| Herbie | 0.8 |
if y < -4.172866582314813e-249Initial program 24.8
Taylor expanded around -inf 0.6
if -4.172866582314813e-249 < y Initial program 25.8
Taylor expanded around inf 1.1
Final simplification0.8
herbie shell --seed 2020065 +o rules:numerics
(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)))))