\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(1 \cdot \mathsf{fma}\left(\frac{{x}^{1}}{y}, x, y\right) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r622864 = x;
double r622865 = r622864 * r622864;
double r622866 = y;
double r622867 = r622866 * r622866;
double r622868 = r622865 + r622867;
double r622869 = z;
double r622870 = r622869 * r622869;
double r622871 = r622868 - r622870;
double r622872 = 2.0;
double r622873 = r622866 * r622872;
double r622874 = r622871 / r622873;
return r622874;
}
double f(double x, double y, double z) {
double r622875 = 0.5;
double r622876 = 1.0;
double r622877 = x;
double r622878 = pow(r622877, r622876);
double r622879 = y;
double r622880 = r622878 / r622879;
double r622881 = fma(r622880, r622877, r622879);
double r622882 = r622876 * r622881;
double r622883 = z;
double r622884 = r622883 / r622879;
double r622885 = r622883 * r622884;
double r622886 = r622882 - r622885;
double r622887 = r622875 * r622886;
return r622887;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 28.8 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 28.8
Simplified28.8
Taylor expanded around 0 12.9
Simplified12.9
rmApplied sqr-pow12.9
Applied associate-/l*7.0
Simplified7.0
rmApplied *-un-lft-identity7.0
Applied add-sqr-sqrt35.7
Applied unpow-prod-down35.7
Applied times-frac32.3
Simplified32.2
Simplified0.1
rmApplied *-un-lft-identity0.1
Applied *-un-lft-identity0.1
Applied distribute-lft-out0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020081 +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)))