\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 r843001 = x;
double r843002 = r843001 * r843001;
double r843003 = y;
double r843004 = r843003 * r843003;
double r843005 = r843002 + r843004;
double r843006 = z;
double r843007 = r843006 * r843006;
double r843008 = r843005 - r843007;
double r843009 = 2.0;
double r843010 = r843003 * r843009;
double r843011 = r843008 / r843010;
return r843011;
}
double f(double x, double y, double z) {
double r843012 = 0.5;
double r843013 = y;
double r843014 = x;
double r843015 = r843014 / r843013;
double r843016 = r843014 * r843015;
double r843017 = r843013 + r843016;
double r843018 = z;
double r843019 = fabs(r843018);
double r843020 = r843019 / r843013;
double r843021 = r843019 * r843020;
double r843022 = r843017 - r843021;
double r843023 = r843012 * r843022;
return r843023;
}




Bits error versus x




Bits error versus y




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