\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}{y}}{\frac{1}{z}}\right)double f(double x, double y, double z) {
double r719314 = x;
double r719315 = r719314 * r719314;
double r719316 = y;
double r719317 = r719316 * r719316;
double r719318 = r719315 + r719317;
double r719319 = z;
double r719320 = r719319 * r719319;
double r719321 = r719318 - r719320;
double r719322 = 2.0;
double r719323 = r719316 * r719322;
double r719324 = r719321 / r719323;
return r719324;
}
double f(double x, double y, double z) {
double r719325 = 0.5;
double r719326 = y;
double r719327 = x;
double r719328 = 1.0;
double r719329 = pow(r719327, r719328);
double r719330 = r719326 / r719327;
double r719331 = r719329 / r719330;
double r719332 = r719326 + r719331;
double r719333 = z;
double r719334 = r719333 / r719326;
double r719335 = r719328 / r719333;
double r719336 = r719334 / r719335;
double r719337 = r719332 - r719336;
double r719338 = r719325 * r719337;
return r719338;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 29.0 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 29.0
Taylor expanded around 0 12.8
Simplified12.8
rmApplied unpow212.8
Applied associate-/l*7.0
rmApplied sqr-pow7.0
Applied associate-/l*0.2
Simplified0.2
rmApplied div-inv0.2
Applied associate-/r*0.2
Final simplification0.2
herbie shell --seed 2020002 +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)))