\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + \frac{x}{\frac{y}{x}}\right) - \left|z\right| \cdot \frac{\left|z\right|}{y}\right)double f(double x, double y, double z) {
double r665319 = x;
double r665320 = r665319 * r665319;
double r665321 = y;
double r665322 = r665321 * r665321;
double r665323 = r665320 + r665322;
double r665324 = z;
double r665325 = r665324 * r665324;
double r665326 = r665323 - r665325;
double r665327 = 2.0;
double r665328 = r665321 * r665327;
double r665329 = r665326 / r665328;
return r665329;
}
double f(double x, double y, double z) {
double r665330 = 0.5;
double r665331 = y;
double r665332 = x;
double r665333 = r665331 / r665332;
double r665334 = r665332 / r665333;
double r665335 = r665331 + r665334;
double r665336 = z;
double r665337 = fabs(r665336);
double r665338 = r665337 / r665331;
double r665339 = r665337 * r665338;
double r665340 = r665335 - r665339;
double r665341 = r665330 * r665340;
return r665341;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.8 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 28.8
Taylor expanded around 0 13.2
Simplified13.2
rmApplied unpow213.2
Applied associate-/l*7.5
rmApplied *-un-lft-identity7.5
Applied add-sqr-sqrt7.5
Applied times-frac7.5
Simplified7.5
Simplified0.1
Final simplification0.1
herbie shell --seed 2020024
(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)))