\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + \frac{{x}^{1}}{\frac{y}{x}}\right) - \frac{{z}^{1}}{\frac{y}{z}}\right)double f(double x, double y, double z) {
double r685278 = x;
double r685279 = r685278 * r685278;
double r685280 = y;
double r685281 = r685280 * r685280;
double r685282 = r685279 + r685281;
double r685283 = z;
double r685284 = r685283 * r685283;
double r685285 = r685282 - r685284;
double r685286 = 2.0;
double r685287 = r685280 * r685286;
double r685288 = r685285 / r685287;
return r685288;
}
double f(double x, double y, double z) {
double r685289 = 0.5;
double r685290 = y;
double r685291 = x;
double r685292 = 1.0;
double r685293 = pow(r685291, r685292);
double r685294 = r685290 / r685291;
double r685295 = r685293 / r685294;
double r685296 = r685290 + r685295;
double r685297 = z;
double r685298 = pow(r685297, r685292);
double r685299 = r685290 / r685297;
double r685300 = r685298 / r685299;
double r685301 = r685296 - r685300;
double r685302 = r685289 * r685301;
return r685302;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 29.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 29.3
Taylor expanded around 0 12.8
Simplified12.8
rmApplied sqr-pow12.8
Applied associate-/l*6.9
Simplified6.9
rmApplied sqr-pow6.9
Applied associate-/l*0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020036
(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)))