\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) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r656608 = x;
double r656609 = r656608 * r656608;
double r656610 = y;
double r656611 = r656610 * r656610;
double r656612 = r656609 + r656611;
double r656613 = z;
double r656614 = r656613 * r656613;
double r656615 = r656612 - r656614;
double r656616 = 2.0;
double r656617 = r656610 * r656616;
double r656618 = r656615 / r656617;
return r656618;
}
double f(double x, double y, double z) {
double r656619 = 0.5;
double r656620 = y;
double r656621 = x;
double r656622 = r656620 / r656621;
double r656623 = r656621 / r656622;
double r656624 = r656620 + r656623;
double r656625 = z;
double r656626 = r656625 / r656620;
double r656627 = r656625 * r656626;
double r656628 = r656624 - r656627;
double r656629 = r656619 * r656628;
return r656629;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 28.6
Taylor expanded around 0 12.5
Simplified12.5
rmApplied *-un-lft-identity12.5
Applied add-sqr-sqrt38.7
Applied unpow-prod-down38.7
Applied times-frac36.0
Simplified36.0
Simplified6.7
rmApplied unpow26.7
Applied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2020001 +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)))