x \cdot \sqrt{y \cdot y - z \cdot z}\begin{array}{l}
\mathbf{if}\;y \le -2.576758446294661598578923068565248078396 \cdot 10^{-248}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}double f(double x, double y, double z) {
double r566615 = x;
double r566616 = y;
double r566617 = r566616 * r566616;
double r566618 = z;
double r566619 = r566618 * r566618;
double r566620 = r566617 - r566619;
double r566621 = sqrt(r566620);
double r566622 = r566615 * r566621;
return r566622;
}
double f(double x, double y, double __attribute__((unused)) z) {
double r566623 = y;
double r566624 = -2.5767584462946616e-248;
bool r566625 = r566623 <= r566624;
double r566626 = -1.0;
double r566627 = x;
double r566628 = r566627 * r566623;
double r566629 = r566626 * r566628;
double r566630 = r566625 ? r566629 : r566628;
return r566630;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 25.8 |
|---|---|
| Target | 0.6 |
| Herbie | 0.9 |
if y < -2.5767584462946616e-248Initial program 25.9
Taylor expanded around -inf 0.6
if -2.5767584462946616e-248 < y Initial program 25.7
Taylor expanded around inf 1.1
Final simplification0.9
herbie shell --seed 2019297
(FPCore (x y z)
:name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, B"
:precision binary64
:herbie-target
(if (< y 2.58160964882516951e-278) (- (* x y)) (* x (* (sqrt (+ y z)) (sqrt (- y z)))))
(* x (sqrt (- (* y y) (* z z)))))