\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + \frac{{x}^{1}}{\frac{y}{x}}\right) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r647816 = x;
double r647817 = r647816 * r647816;
double r647818 = y;
double r647819 = r647818 * r647818;
double r647820 = r647817 + r647819;
double r647821 = z;
double r647822 = r647821 * r647821;
double r647823 = r647820 - r647822;
double r647824 = 2.0;
double r647825 = r647818 * r647824;
double r647826 = r647823 / r647825;
return r647826;
}
double f(double x, double y, double z) {
double r647827 = 0.5;
double r647828 = y;
double r647829 = x;
double r647830 = 1.0;
double r647831 = pow(r647829, r647830);
double r647832 = r647828 / r647829;
double r647833 = r647831 / r647832;
double r647834 = r647828 + r647833;
double r647835 = z;
double r647836 = r647835 / r647828;
double r647837 = r647835 * r647836;
double r647838 = r647834 - r647837;
double r647839 = r647827 * r647838;
return r647839;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 28.5
Taylor expanded around 0 12.7
Simplified12.7
rmApplied sqr-pow12.7
Applied associate-/l*6.9
Simplified6.9
rmApplied *-un-lft-identity6.9
Applied add-sqr-sqrt34.7
Applied unpow-prod-down34.7
Applied times-frac31.3
Simplified31.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2019353 +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)))