\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) - \frac{z}{\frac{y}{z}}\right)double f(double x, double y, double z) {
double r582608 = x;
double r582609 = r582608 * r582608;
double r582610 = y;
double r582611 = r582610 * r582610;
double r582612 = r582609 + r582611;
double r582613 = z;
double r582614 = r582613 * r582613;
double r582615 = r582612 - r582614;
double r582616 = 2.0;
double r582617 = r582610 * r582616;
double r582618 = r582615 / r582617;
return r582618;
}
double f(double x, double y, double z) {
double r582619 = 0.5;
double r582620 = y;
double r582621 = x;
double r582622 = r582621 / r582620;
double r582623 = r582621 * r582622;
double r582624 = r582620 + r582623;
double r582625 = z;
double r582626 = r582620 / r582625;
double r582627 = r582625 / r582626;
double r582628 = r582624 - r582627;
double r582629 = r582619 * r582628;
return r582629;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.0 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 28.0
Taylor expanded around 0 12.2
Simplified12.2
rmApplied *-un-lft-identity12.2
Applied add-sqr-sqrt37.7
Applied unpow-prod-down37.7
Applied times-frac34.9
Simplified34.9
Simplified6.7
rmApplied unpow26.7
Applied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2020035 +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)))