x \cdot \sqrt{y \cdot y - z \cdot z}\begin{array}{l}
\mathbf{if}\;y \le -1.650359340362325641012254610154623215362 \cdot 10^{-234}:\\
\;\;\;\;\left(-x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}double f(double x, double y, double z) {
double r26589340 = x;
double r26589341 = y;
double r26589342 = r26589341 * r26589341;
double r26589343 = z;
double r26589344 = r26589343 * r26589343;
double r26589345 = r26589342 - r26589344;
double r26589346 = sqrt(r26589345);
double r26589347 = r26589340 * r26589346;
return r26589347;
}
double f(double x, double y, double __attribute__((unused)) z) {
double r26589348 = y;
double r26589349 = -1.6503593403623256e-234;
bool r26589350 = r26589348 <= r26589349;
double r26589351 = x;
double r26589352 = -r26589351;
double r26589353 = r26589352 * r26589348;
double r26589354 = r26589351 * r26589348;
double r26589355 = r26589350 ? r26589353 : r26589354;
return r26589355;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 24.8 |
|---|---|
| Target | 0.6 |
| Herbie | 0.9 |
if y < -1.6503593403623256e-234Initial program 24.9
Taylor expanded around -inf 0.5
Simplified0.5
if -1.6503593403623256e-234 < y Initial program 24.7
Taylor expanded around inf 1.4
Final simplification0.9
herbie shell --seed 2019179 +o rules:numerics
(FPCore (x y z)
:name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, B"
:herbie-target
(if (< y 2.5816096488251695e-278) (- (* x y)) (* x (* (sqrt (+ y z)) (sqrt (- y z)))))
(* x (sqrt (- (* y y) (* z z)))))