\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) - \frac{z}{y} \cdot z\right)double f(double x, double y, double z) {
double r756411 = x;
double r756412 = r756411 * r756411;
double r756413 = y;
double r756414 = r756413 * r756413;
double r756415 = r756412 + r756414;
double r756416 = z;
double r756417 = r756416 * r756416;
double r756418 = r756415 - r756417;
double r756419 = 2.0;
double r756420 = r756413 * r756419;
double r756421 = r756418 / r756420;
return r756421;
}
double f(double x, double y, double z) {
double r756422 = 0.5;
double r756423 = y;
double r756424 = x;
double r756425 = fabs(r756424);
double r756426 = r756425 / r756423;
double r756427 = r756425 * r756426;
double r756428 = r756423 + r756427;
double r756429 = z;
double r756430 = r756429 / r756423;
double r756431 = r756430 * r756429;
double r756432 = r756428 - r756431;
double r756433 = r756422 * r756432;
return r756433;
}




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.8
Simplified12.8
rmApplied unpow212.8
Applied associate-/l*6.9
rmApplied *-un-lft-identity6.9
Applied add-sqr-sqrt6.9
Applied times-frac6.9
Simplified6.9
Simplified0.2
rmApplied associate-/r/0.2
Final simplification0.2
herbie shell --seed 2020060
(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)))