\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\mathsf{fma}\left(\frac{x}{y}, x, y\right) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r759910 = x;
double r759911 = r759910 * r759910;
double r759912 = y;
double r759913 = r759912 * r759912;
double r759914 = r759911 + r759913;
double r759915 = z;
double r759916 = r759915 * r759915;
double r759917 = r759914 - r759916;
double r759918 = 2.0;
double r759919 = r759912 * r759918;
double r759920 = r759917 / r759919;
return r759920;
}
double f(double x, double y, double z) {
double r759921 = 0.5;
double r759922 = x;
double r759923 = y;
double r759924 = r759922 / r759923;
double r759925 = fma(r759924, r759922, r759923);
double r759926 = z;
double r759927 = r759926 / r759923;
double r759928 = r759926 * r759927;
double r759929 = r759925 - r759928;
double r759930 = r759921 * r759929;
return r759930;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 27.7 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 27.7
Taylor expanded around 0 12.2
Simplified12.2
rmApplied unpow212.2
Applied associate-/l*6.4
rmApplied *-un-lft-identity6.4
Applied add-sqr-sqrt35.1
Applied unpow-prod-down35.1
Applied times-frac31.9
Simplified31.9
Simplified0.2
Taylor expanded around 0 12.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020100 +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)))