\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) - \frac{z}{\frac{y}{z}}\right)double f(double x, double y, double z) {
double r807281 = x;
double r807282 = r807281 * r807281;
double r807283 = y;
double r807284 = r807283 * r807283;
double r807285 = r807282 + r807284;
double r807286 = z;
double r807287 = r807286 * r807286;
double r807288 = r807285 - r807287;
double r807289 = 2.0;
double r807290 = r807283 * r807289;
double r807291 = r807288 / r807290;
return r807291;
}
double f(double x, double y, double z) {
double r807292 = 0.5;
double r807293 = y;
double r807294 = x;
double r807295 = r807294 / r807293;
double r807296 = r807294 * r807295;
double r807297 = r807293 + r807296;
double r807298 = z;
double r807299 = r807293 / r807298;
double r807300 = r807298 / r807299;
double r807301 = r807297 - r807300;
double r807302 = r807292 * r807301;
return r807302;
}




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 unpow212.0
Applied associate-/l*6.8
rmApplied *-un-lft-identity6.8
Applied add-sqr-sqrt35.0
Applied unpow-prod-down35.0
Applied times-frac31.6
Simplified31.5
Simplified0.2
Final simplification0.2
herbie shell --seed 2019362 +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)))