\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + x \cdot \frac{x}{y}\right) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r869595 = x;
double r869596 = r869595 * r869595;
double r869597 = y;
double r869598 = r869597 * r869597;
double r869599 = r869596 + r869598;
double r869600 = z;
double r869601 = r869600 * r869600;
double r869602 = r869599 - r869601;
double r869603 = 2.0;
double r869604 = r869597 * r869603;
double r869605 = r869602 / r869604;
return r869605;
}
double f(double x, double y, double z) {
double r869606 = 0.5;
double r869607 = y;
double r869608 = x;
double r869609 = r869608 / r869607;
double r869610 = r869608 * r869609;
double r869611 = r869607 + r869610;
double r869612 = z;
double r869613 = r869612 / r869607;
double r869614 = r869612 * r869613;
double r869615 = r869611 - r869614;
double r869616 = r869606 * r869615;
return r869616;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 27.9 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 27.9
Taylor expanded around 0 12.0
Simplified12.0
rmApplied *-un-lft-identity12.0
Applied add-sqr-sqrt37.6
Applied unpow-prod-down37.6
Applied times-frac34.9
Simplified34.9
Simplified6.8
rmApplied *-un-lft-identity6.8
Applied add-sqr-sqrt34.9
Applied unpow-prod-down34.9
Applied times-frac31.6
Simplified31.5
Simplified0.2
Final simplification0.2
herbie shell --seed 2019362
(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)))