x \cdot \sqrt{y \cdot y - z \cdot z}\begin{array}{l}
\mathbf{if}\;y \le -4.1007788905905145 \cdot 10^{-238}:\\
\;\;\;\;x \cdot \left(-1 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}double f(double x, double y, double z) {
double r675557 = x;
double r675558 = y;
double r675559 = r675558 * r675558;
double r675560 = z;
double r675561 = r675560 * r675560;
double r675562 = r675559 - r675561;
double r675563 = sqrt(r675562);
double r675564 = r675557 * r675563;
return r675564;
}
double f(double x, double y, double __attribute__((unused)) z) {
double r675565 = y;
double r675566 = -4.1007788905905145e-238;
bool r675567 = r675565 <= r675566;
double r675568 = x;
double r675569 = -1.0;
double r675570 = r675569 * r675565;
double r675571 = r675568 * r675570;
double r675572 = r675568 * r675565;
double r675573 = r675567 ? r675571 : r675572;
return r675573;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 25.3 |
|---|---|
| Target | 0.7 |
| Herbie | 0.9 |
if y < -4.1007788905905145e-238Initial program 25.5
Taylor expanded around -inf 0.7
if -4.1007788905905145e-238 < y Initial program 25.1
Taylor expanded around inf 1.1
Final simplification0.9
herbie shell --seed 2020018
(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)))))