\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 r895698 = x;
double r895699 = r895698 * r895698;
double r895700 = y;
double r895701 = r895700 * r895700;
double r895702 = r895699 + r895701;
double r895703 = z;
double r895704 = r895703 * r895703;
double r895705 = r895702 - r895704;
double r895706 = 2.0;
double r895707 = r895700 * r895706;
double r895708 = r895705 / r895707;
return r895708;
}
double f(double x, double y, double z) {
double r895709 = 0.5;
double r895710 = y;
double r895711 = x;
double r895712 = 1.0;
double r895713 = pow(r895711, r895712);
double r895714 = r895710 / r895711;
double r895715 = r895713 / r895714;
double r895716 = r895710 + r895715;
double r895717 = z;
double r895718 = r895717 / r895710;
double r895719 = r895717 * r895718;
double r895720 = r895716 - r895719;
double r895721 = r895709 * r895720;
return r895721;
}




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
(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)))