\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + \frac{x}{y} \cdot x\right) - \left|z\right| \cdot \frac{\left|z\right|}{y}\right)double f(double x, double y, double z) {
double r606613 = x;
double r606614 = r606613 * r606613;
double r606615 = y;
double r606616 = r606615 * r606615;
double r606617 = r606614 + r606616;
double r606618 = z;
double r606619 = r606618 * r606618;
double r606620 = r606617 - r606619;
double r606621 = 2.0;
double r606622 = r606615 * r606621;
double r606623 = r606620 / r606622;
return r606623;
}
double f(double x, double y, double z) {
double r606624 = 0.5;
double r606625 = y;
double r606626 = x;
double r606627 = r606626 / r606625;
double r606628 = r606627 * r606626;
double r606629 = r606625 + r606628;
double r606630 = z;
double r606631 = fabs(r606630);
double r606632 = r606631 / r606625;
double r606633 = r606631 * r606632;
double r606634 = r606629 - r606633;
double r606635 = r606624 * r606634;
return r606635;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 28.5
Taylor expanded around 0 12.7
Simplified12.7
rmApplied unpow212.7
Applied associate-/l*6.9
rmApplied *-un-lft-identity6.9
Applied add-sqr-sqrt6.9
Applied times-frac6.9
Simplified6.9
Simplified0.1
rmApplied associate-/r/0.1
Final simplification0.1
herbie shell --seed 2019353 +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)))