\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\frac{y - \frac{z + x}{\frac{y}{z - x}}}{2}double f(double x, double y, double z) {
double r421886 = x;
double r421887 = r421886 * r421886;
double r421888 = y;
double r421889 = r421888 * r421888;
double r421890 = r421887 + r421889;
double r421891 = z;
double r421892 = r421891 * r421891;
double r421893 = r421890 - r421892;
double r421894 = 2.0;
double r421895 = r421888 * r421894;
double r421896 = r421893 / r421895;
return r421896;
}
double f(double x, double y, double z) {
double r421897 = y;
double r421898 = z;
double r421899 = x;
double r421900 = r421898 + r421899;
double r421901 = r421898 - r421899;
double r421902 = r421897 / r421901;
double r421903 = r421900 / r421902;
double r421904 = r421897 - r421903;
double r421905 = 2.0;
double r421906 = r421904 / r421905;
return r421906;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.4 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 28.4
Simplified12.9
rmApplied difference-of-squares12.9
Applied associate-/l*0.1
Final simplification0.1
herbie shell --seed 2019304
(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)))