\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) - \frac{\frac{{z}^{1}}{y}}{\frac{1}{z}}\right)double f(double x, double y, double z) {
double r611062 = x;
double r611063 = r611062 * r611062;
double r611064 = y;
double r611065 = r611064 * r611064;
double r611066 = r611063 + r611065;
double r611067 = z;
double r611068 = r611067 * r611067;
double r611069 = r611066 - r611068;
double r611070 = 2.0;
double r611071 = r611064 * r611070;
double r611072 = r611069 / r611071;
return r611072;
}
double f(double x, double y, double z) {
double r611073 = 0.5;
double r611074 = y;
double r611075 = x;
double r611076 = 1.0;
double r611077 = pow(r611075, r611076);
double r611078 = r611074 / r611075;
double r611079 = r611077 / r611078;
double r611080 = r611074 + r611079;
double r611081 = z;
double r611082 = pow(r611081, r611076);
double r611083 = r611082 / r611074;
double r611084 = r611076 / r611081;
double r611085 = r611083 / r611084;
double r611086 = r611080 - r611085;
double r611087 = r611073 * r611086;
return r611087;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 28.5
Taylor expanded around 0 12.9
Simplified12.9
rmApplied sqr-pow12.9
Applied associate-/l*7.2
Simplified7.2
rmApplied sqr-pow7.2
Applied associate-/l*0.2
Simplified0.2
rmApplied div-inv0.2
Applied associate-/r*0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019322
(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)))