\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + \left|x\right| \cdot \frac{\left|x\right|}{y}\right) - \frac{z}{\frac{y}{z}}\right)double f(double x, double y, double z) {
double r925872 = x;
double r925873 = r925872 * r925872;
double r925874 = y;
double r925875 = r925874 * r925874;
double r925876 = r925873 + r925875;
double r925877 = z;
double r925878 = r925877 * r925877;
double r925879 = r925876 - r925878;
double r925880 = 2.0;
double r925881 = r925874 * r925880;
double r925882 = r925879 / r925881;
return r925882;
}
double f(double x, double y, double z) {
double r925883 = 0.5;
double r925884 = y;
double r925885 = x;
double r925886 = fabs(r925885);
double r925887 = r925886 / r925884;
double r925888 = r925886 * r925887;
double r925889 = r925884 + r925888;
double r925890 = z;
double r925891 = r925884 / r925890;
double r925892 = r925890 / r925891;
double r925893 = r925889 - r925892;
double r925894 = r925883 * r925893;
return r925894;
}




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-sqrt12.2
Applied times-frac12.2
Simplified12.2
Simplified6.7
rmApplied unpow26.7
Applied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2020035
(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)))