\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) - \left|z\right| \cdot \frac{\left|z\right|}{y}\right)double f(double x, double y, double z) {
double r658060 = x;
double r658061 = r658060 * r658060;
double r658062 = y;
double r658063 = r658062 * r658062;
double r658064 = r658061 + r658063;
double r658065 = z;
double r658066 = r658065 * r658065;
double r658067 = r658064 - r658066;
double r658068 = 2.0;
double r658069 = r658062 * r658068;
double r658070 = r658067 / r658069;
return r658070;
}
double f(double x, double y, double z) {
double r658071 = 0.5;
double r658072 = y;
double r658073 = x;
double r658074 = fabs(r658073);
double r658075 = r658074 / r658072;
double r658076 = r658074 * r658075;
double r658077 = r658072 + r658076;
double r658078 = z;
double r658079 = fabs(r658078);
double r658080 = r658079 / r658072;
double r658081 = r658079 * r658080;
double r658082 = r658077 - r658081;
double r658083 = r658071 * r658082;
return r658083;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 28.3
Simplified28.3
Taylor expanded around 0 12.6
Simplified12.6
rmApplied *-un-lft-identity12.6
Applied add-sqr-sqrt12.6
Applied times-frac12.6
Simplified12.6
Simplified7.2
rmApplied *-un-lft-identity7.2
Applied add-sqr-sqrt7.2
Applied times-frac7.2
Simplified7.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020065 +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)))