\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + x \cdot \frac{x}{y}\right) - \left|z\right| \cdot \frac{\left|z\right|}{y}\right)double f(double x, double y, double z) {
double r671059 = x;
double r671060 = r671059 * r671059;
double r671061 = y;
double r671062 = r671061 * r671061;
double r671063 = r671060 + r671062;
double r671064 = z;
double r671065 = r671064 * r671064;
double r671066 = r671063 - r671065;
double r671067 = 2.0;
double r671068 = r671061 * r671067;
double r671069 = r671066 / r671068;
return r671069;
}
double f(double x, double y, double z) {
double r671070 = 0.5;
double r671071 = y;
double r671072 = x;
double r671073 = r671072 / r671071;
double r671074 = r671072 * r671073;
double r671075 = r671071 + r671074;
double r671076 = z;
double r671077 = fabs(r671076);
double r671078 = r671077 / r671071;
double r671079 = r671077 * r671078;
double r671080 = r671075 - r671079;
double r671081 = r671070 * r671080;
return r671081;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 28.2
Taylor expanded around 0 12.7
Simplified12.7
rmApplied *-un-lft-identity12.7
Applied add-sqr-sqrt38.2
Applied unpow-prod-down38.2
Applied times-frac35.5
Simplified35.5
Simplified7.3
rmApplied *-un-lft-identity7.3
Applied add-sqr-sqrt7.3
Applied times-frac7.3
Simplified7.3
Simplified0.2
Final simplification0.2
herbie shell --seed 2020047 +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)))