\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 r916283 = x;
double r916284 = r916283 * r916283;
double r916285 = y;
double r916286 = r916285 * r916285;
double r916287 = r916284 + r916286;
double r916288 = z;
double r916289 = r916288 * r916288;
double r916290 = r916287 - r916289;
double r916291 = 2.0;
double r916292 = r916285 * r916291;
double r916293 = r916290 / r916292;
return r916293;
}
double f(double x, double y, double z) {
double r916294 = 0.5;
double r916295 = y;
double r916296 = x;
double r916297 = r916296 / r916295;
double r916298 = r916296 * r916297;
double r916299 = r916295 + r916298;
double r916300 = z;
double r916301 = fabs(r916300);
double r916302 = r916301 / r916295;
double r916303 = r916301 * r916302;
double r916304 = r916299 - r916303;
double r916305 = r916294 * r916304;
return r916305;
}




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
(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)))