\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 r595245 = x;
double r595246 = r595245 * r595245;
double r595247 = y;
double r595248 = r595247 * r595247;
double r595249 = r595246 + r595248;
double r595250 = z;
double r595251 = r595250 * r595250;
double r595252 = r595249 - r595251;
double r595253 = 2.0;
double r595254 = r595247 * r595253;
double r595255 = r595252 / r595254;
return r595255;
}
double f(double x, double y, double z) {
double r595256 = 0.5;
double r595257 = y;
double r595258 = x;
double r595259 = r595258 / r595257;
double r595260 = r595258 * r595259;
double r595261 = r595257 + r595260;
double r595262 = z;
double r595263 = r595262 / r595257;
double r595264 = r595262 * r595263;
double r595265 = r595261 - r595264;
double r595266 = r595256 * r595265;
return r595266;
}




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.3
Simplified12.3
rmApplied *-un-lft-identity12.3
Applied add-sqr-sqrt37.7
Applied unpow-prod-down37.7
Applied times-frac34.9
Simplified34.9
Simplified6.5
rmApplied *-un-lft-identity6.5
Applied add-sqr-sqrt35.1
Applied unpow-prod-down35.1
Applied times-frac32.0
Simplified31.9
Simplified0.2
Final simplification0.2
herbie shell --seed 2020003
(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)))