\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) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r684549 = x;
double r684550 = r684549 * r684549;
double r684551 = y;
double r684552 = r684551 * r684551;
double r684553 = r684550 + r684552;
double r684554 = z;
double r684555 = r684554 * r684554;
double r684556 = r684553 - r684555;
double r684557 = 2.0;
double r684558 = r684551 * r684557;
double r684559 = r684556 / r684558;
return r684559;
}
double f(double x, double y, double z) {
double r684560 = 0.5;
double r684561 = y;
double r684562 = x;
double r684563 = fabs(r684562);
double r684564 = r684563 / r684561;
double r684565 = r684563 * r684564;
double r684566 = r684561 + r684565;
double r684567 = z;
double r684568 = r684567 / r684561;
double r684569 = r684567 * r684568;
double r684570 = r684566 - r684569;
double r684571 = r684560 * r684570;
return r684571;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.1 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 28.1
Simplified28.1
Taylor expanded around 0 12.6
Simplified12.6
rmApplied *-un-lft-identity12.6
Applied add-sqr-sqrt37.7
Applied unpow-prod-down37.7
Applied times-frac34.9
Simplified34.8
Simplified7.0
rmApplied *-un-lft-identity7.0
Applied add-sqr-sqrt7.0
Applied times-frac7.0
Simplified7.0
Simplified0.2
Final simplification0.2
herbie shell --seed 2020056 +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)))