\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + \frac{x}{\frac{y}{x}}\right) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r676196 = x;
double r676197 = r676196 * r676196;
double r676198 = y;
double r676199 = r676198 * r676198;
double r676200 = r676197 + r676199;
double r676201 = z;
double r676202 = r676201 * r676201;
double r676203 = r676200 - r676202;
double r676204 = 2.0;
double r676205 = r676198 * r676204;
double r676206 = r676203 / r676205;
return r676206;
}
double f(double x, double y, double z) {
double r676207 = 0.5;
double r676208 = y;
double r676209 = x;
double r676210 = r676208 / r676209;
double r676211 = r676209 / r676210;
double r676212 = r676208 + r676211;
double r676213 = z;
double r676214 = r676213 / r676208;
double r676215 = r676213 * r676214;
double r676216 = r676212 - r676215;
double r676217 = r676207 * r676216;
return r676217;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.8 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 28.8
Taylor expanded around 0 13.2
Simplified13.2
rmApplied unpow213.2
Applied associate-/l*7.5
rmApplied *-un-lft-identity7.5
Applied add-sqr-sqrt35.3
Applied unpow-prod-down35.3
Applied times-frac31.6
Simplified31.6
Simplified0.1
Final simplification0.1
herbie shell --seed 2020024 +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)))