x \cdot \sqrt{y \cdot y - z \cdot z}\begin{array}{l}
\mathbf{if}\;y \le -4.17286658231481322 \cdot 10^{-249}:\\
\;\;\;\;x \cdot \left(-1 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}double f(double x, double y, double z) {
double r702960 = x;
double r702961 = y;
double r702962 = r702961 * r702961;
double r702963 = z;
double r702964 = r702963 * r702963;
double r702965 = r702962 - r702964;
double r702966 = sqrt(r702965);
double r702967 = r702960 * r702966;
return r702967;
}
double f(double x, double y, double __attribute__((unused)) z) {
double r702968 = y;
double r702969 = -4.172866582314813e-249;
bool r702970 = r702968 <= r702969;
double r702971 = x;
double r702972 = -1.0;
double r702973 = r702972 * r702968;
double r702974 = r702971 * r702973;
double r702975 = r702971 * r702968;
double r702976 = r702970 ? r702974 : r702975;
return r702976;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 25.3 |
|---|---|
| Target | 0.6 |
| Herbie | 0.8 |
if y < -4.172866582314813e-249Initial program 24.8
Taylor expanded around -inf 0.6
if -4.172866582314813e-249 < y Initial program 25.8
Taylor expanded around inf 1.1
Final simplification0.8
herbie shell --seed 2020065
(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)))))