\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) - \left|z\right| \cdot \frac{\left|z\right|}{y}\right)double f(double x, double y, double z) {
double r686348 = x;
double r686349 = r686348 * r686348;
double r686350 = y;
double r686351 = r686350 * r686350;
double r686352 = r686349 + r686351;
double r686353 = z;
double r686354 = r686353 * r686353;
double r686355 = r686352 - r686354;
double r686356 = 2.0;
double r686357 = r686350 * r686356;
double r686358 = r686355 / r686357;
return r686358;
}
double f(double x, double y, double z) {
double r686359 = 0.5;
double r686360 = y;
double r686361 = x;
double r686362 = r686361 / r686360;
double r686363 = r686361 * r686362;
double r686364 = r686360 + r686363;
double r686365 = z;
double r686366 = fabs(r686365);
double r686367 = r686366 / r686360;
double r686368 = r686366 * r686367;
double r686369 = r686364 - r686368;
double r686370 = r686359 * r686369;
return r686370;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 28.2
Taylor expanded around 0 12.7
Simplified12.7
rmApplied *-un-lft-identity12.7
Applied add-sqr-sqrt38.2
Applied unpow-prod-down38.2
Applied times-frac35.5
Simplified35.5
Simplified7.3
rmApplied *-un-lft-identity7.3
Applied add-sqr-sqrt7.3
Applied times-frac7.3
Simplified7.3
Simplified0.2
Final simplification0.2
herbie shell --seed 2020047
(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)))