\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{z}{\frac{y}{z}}\right)double f(double x, double y, double z) {
double r618043 = x;
double r618044 = r618043 * r618043;
double r618045 = y;
double r618046 = r618045 * r618045;
double r618047 = r618044 + r618046;
double r618048 = z;
double r618049 = r618048 * r618048;
double r618050 = r618047 - r618049;
double r618051 = 2.0;
double r618052 = r618045 * r618051;
double r618053 = r618050 / r618052;
return r618053;
}
double f(double x, double y, double z) {
double r618054 = 0.5;
double r618055 = y;
double r618056 = x;
double r618057 = 1.0;
double r618058 = pow(r618056, r618057);
double r618059 = r618055 / r618056;
double r618060 = r618058 / r618059;
double r618061 = r618055 + r618060;
double r618062 = z;
double r618063 = r618055 / r618062;
double r618064 = r618062 / r618063;
double r618065 = r618061 - r618064;
double r618066 = r618054 * r618065;
return r618066;
}




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
Simplified28.5
Taylor expanded around 0 12.5
Simplified12.5
rmApplied sqr-pow12.5
Applied associate-/l*6.7
Simplified6.7
rmApplied unpow26.7
Applied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2020062 +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)))