\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + \left|x\right| \cdot \frac{\left|x\right|}{y}\right) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r911240 = x;
double r911241 = r911240 * r911240;
double r911242 = y;
double r911243 = r911242 * r911242;
double r911244 = r911241 + r911243;
double r911245 = z;
double r911246 = r911245 * r911245;
double r911247 = r911244 - r911246;
double r911248 = 2.0;
double r911249 = r911242 * r911248;
double r911250 = r911247 / r911249;
return r911250;
}
double f(double x, double y, double z) {
double r911251 = 0.5;
double r911252 = y;
double r911253 = x;
double r911254 = fabs(r911253);
double r911255 = r911254 / r911252;
double r911256 = r911254 * r911255;
double r911257 = r911252 + r911256;
double r911258 = z;
double r911259 = r911258 / r911252;
double r911260 = r911258 * r911259;
double r911261 = r911257 - r911260;
double r911262 = r911251 * r911261;
return r911262;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.4 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 28.4
Taylor expanded around 0 12.8
Simplified12.8
rmApplied *-un-lft-identity12.8
Applied add-sqr-sqrt38.3
Applied unpow-prod-down38.3
Applied times-frac35.5
Simplified35.5
Simplified6.9
rmApplied *-un-lft-identity6.9
Applied add-sqr-sqrt6.9
Applied times-frac6.9
Simplified6.9
Simplified0.2
Final simplification0.2
herbie shell --seed 2020057
(FPCore (x y z)
:name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A"
:precision binary64
:herbie-target
(- (* y 0.5) (* (* (/ 0.5 y) (+ z x)) (- z x)))
(/ (- (+ (* x x) (* y y)) (* z z)) (* y 2)))