x \cdot \sqrt{y \cdot y - z \cdot z}\begin{array}{l}
\mathbf{if}\;y \le -2.340986277535991647306212898834677817035 \cdot 10^{-210}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}double f(double x, double y, double z) {
double r549286 = x;
double r549287 = y;
double r549288 = r549287 * r549287;
double r549289 = z;
double r549290 = r549289 * r549289;
double r549291 = r549288 - r549290;
double r549292 = sqrt(r549291);
double r549293 = r549286 * r549292;
return r549293;
}
double f(double x, double y, double __attribute__((unused)) z) {
double r549294 = y;
double r549295 = -2.3409862775359916e-210;
bool r549296 = r549294 <= r549295;
double r549297 = x;
double r549298 = -r549294;
double r549299 = r549297 * r549298;
double r549300 = r549297 * r549294;
double r549301 = r549296 ? r549299 : r549300;
return r549301;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 25.2 |
|---|---|
| Target | 0.6 |
| Herbie | 1.1 |
if y < -2.3409862775359916e-210Initial program 24.6
Taylor expanded around -inf 0.6
Simplified0.6
if -2.3409862775359916e-210 < y Initial program 25.7
Taylor expanded around inf 1.7
Final simplification1.1
herbie shell --seed 2019235
(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)))))