\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + \frac{x}{\frac{y}{x}}\right) - \left|z\right| \cdot \frac{\left|z\right|}{y}\right)double f(double x, double y, double z) {
double r716627 = x;
double r716628 = r716627 * r716627;
double r716629 = y;
double r716630 = r716629 * r716629;
double r716631 = r716628 + r716630;
double r716632 = z;
double r716633 = r716632 * r716632;
double r716634 = r716631 - r716633;
double r716635 = 2.0;
double r716636 = r716629 * r716635;
double r716637 = r716634 / r716636;
return r716637;
}
double f(double x, double y, double z) {
double r716638 = 0.5;
double r716639 = y;
double r716640 = x;
double r716641 = r716639 / r716640;
double r716642 = r716640 / r716641;
double r716643 = r716639 + r716642;
double r716644 = z;
double r716645 = fabs(r716644);
double r716646 = r716645 / r716639;
double r716647 = r716645 * r716646;
double r716648 = r716643 - r716647;
double r716649 = r716638 * r716648;
return r716649;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 28.6
Taylor expanded around 0 12.5
Simplified12.5
rmApplied *-un-lft-identity12.5
Applied add-sqr-sqrt12.5
Applied times-frac12.5
Simplified12.5
Simplified6.7
rmApplied unpow26.7
Applied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2020001
(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)))