\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 r760888 = x;
double r760889 = r760888 * r760888;
double r760890 = y;
double r760891 = r760890 * r760890;
double r760892 = r760889 + r760891;
double r760893 = z;
double r760894 = r760893 * r760893;
double r760895 = r760892 - r760894;
double r760896 = 2.0;
double r760897 = r760890 * r760896;
double r760898 = r760895 / r760897;
return r760898;
}
double f(double x, double y, double z) {
double r760899 = 0.5;
double r760900 = y;
double r760901 = x;
double r760902 = r760901 / r760900;
double r760903 = r760901 * r760902;
double r760904 = r760900 + r760903;
double r760905 = z;
double r760906 = fabs(r760905);
double r760907 = r760906 / r760900;
double r760908 = r760906 * r760907;
double r760909 = r760904 - r760908;
double r760910 = r760899 * r760909;
return r760910;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 28.8
Taylor expanded around 0 12.4
Simplified12.4
rmApplied *-un-lft-identity12.4
Applied add-sqr-sqrt38.5
Applied unpow-prod-down38.5
Applied times-frac35.7
Simplified35.7
Simplified6.9
rmApplied *-un-lft-identity6.9
Applied add-sqr-sqrt6.9
Applied times-frac6.9
Simplified6.9
Simplified0.1
Final simplification0.1
herbie shell --seed 2020018 +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)))