\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}^{1} \cdot \frac{{z}^{1}}{y}\right)double f(double x, double y, double z) {
double r714999 = x;
double r715000 = r714999 * r714999;
double r715001 = y;
double r715002 = r715001 * r715001;
double r715003 = r715000 + r715002;
double r715004 = z;
double r715005 = r715004 * r715004;
double r715006 = r715003 - r715005;
double r715007 = 2.0;
double r715008 = r715001 * r715007;
double r715009 = r715006 / r715008;
return r715009;
}
double f(double x, double y, double z) {
double r715010 = 0.5;
double r715011 = y;
double r715012 = x;
double r715013 = r715012 / r715011;
double r715014 = r715012 * r715013;
double r715015 = r715011 + r715014;
double r715016 = z;
double r715017 = 1.0;
double r715018 = pow(r715016, r715017);
double r715019 = r715018 / r715011;
double r715020 = r715018 * r715019;
double r715021 = r715015 - r715020;
double r715022 = r715010 * r715021;
return r715022;
}




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.8
Simplified12.8
rmApplied sqr-pow12.8
Applied associate-/l*6.9
Simplified6.9
rmApplied *-un-lft-identity6.9
Applied add-sqr-sqrt35.7
Applied unpow-prod-down35.7
Applied times-frac32.3
Simplified32.3
Simplified0.2
rmApplied div-inv0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020060
(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)))