x \cdot \sqrt{y \cdot y - z \cdot z}\begin{array}{l}
\mathbf{if}\;y \le -1.814361563492097218084667841876457735263 \cdot 10^{-270}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}double f(double x, double y, double z) {
double r392815 = x;
double r392816 = y;
double r392817 = r392816 * r392816;
double r392818 = z;
double r392819 = r392818 * r392818;
double r392820 = r392817 - r392819;
double r392821 = sqrt(r392820);
double r392822 = r392815 * r392821;
return r392822;
}
double f(double x, double y, double __attribute__((unused)) z) {
double r392823 = y;
double r392824 = -1.8143615634920972e-270;
bool r392825 = r392823 <= r392824;
double r392826 = x;
double r392827 = -r392823;
double r392828 = r392826 * r392827;
double r392829 = r392826 * r392823;
double r392830 = r392825 ? r392828 : r392829;
return r392830;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 25.0 |
|---|---|
| Target | 0.6 |
| Herbie | 0.7 |
if y < -1.8143615634920972e-270Initial program 24.9
Taylor expanded around -inf 0.6
Simplified0.6
if -1.8143615634920972e-270 < y Initial program 25.0
Taylor expanded around inf 0.9
Final simplification0.7
herbie shell --seed 2019326 +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)))))