\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + x \cdot \frac{x}{y}\right) - \left|z\right| \cdot \frac{\left|z\right|}{y}\right)double f(double x, double y, double z) {
double r3239 = x;
double r3240 = r3239 * r3239;
double r3241 = y;
double r3242 = r3241 * r3241;
double r3243 = r3240 + r3242;
double r3244 = z;
double r3245 = r3244 * r3244;
double r3246 = r3243 - r3245;
double r3247 = 2.0;
double r3248 = r3241 * r3247;
double r3249 = r3246 / r3248;
return r3249;
}
double f(double x, double y, double z) {
double r3250 = 0.5;
double r3251 = y;
double r3252 = x;
double r3253 = r3252 / r3251;
double r3254 = r3252 * r3253;
double r3255 = r3251 + r3254;
double r3256 = z;
double r3257 = fabs(r3256);
double r3258 = r3257 / r3251;
double r3259 = r3257 * r3258;
double r3260 = r3255 - r3259;
double r3261 = r3250 * r3260;
return r3261;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.8 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 28.8
Taylor expanded around 0 12.8
Simplified12.8
rmApplied *-un-lft-identity12.8
Applied add-sqr-sqrt38.0
Applied unpow-prod-down38.0
Applied times-frac35.2
Simplified35.2
Simplified7.2
rmApplied *-un-lft-identity7.2
Applied add-sqr-sqrt7.2
Applied times-frac7.2
Simplified7.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020025 +o rules:numerics
(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)))