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 r448163 = x;
double r448164 = y;
double r448165 = r448164 * r448164;
double r448166 = z;
double r448167 = r448166 * r448166;
double r448168 = r448165 - r448167;
double r448169 = sqrt(r448168);
double r448170 = r448163 * r448169;
return r448170;
}
double f(double x, double y, double __attribute__((unused)) z) {
double r448171 = y;
double r448172 = -2.3409862775359916e-210;
bool r448173 = r448171 <= r448172;
double r448174 = x;
double r448175 = -r448171;
double r448176 = r448174 * r448175;
double r448177 = r448174 * r448171;
double r448178 = r448173 ? r448176 : r448177;
return r448178;
}




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 +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.58160964882516951e-278) (- (* x y)) (* x (* (sqrt (+ y z)) (sqrt (- y z)))))
(* x (sqrt (- (* y y) (* z z)))))