\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\frac{y - \frac{z + x}{\frac{y}{z - x}}}{2}double f(double x, double y, double z) {
double r447152 = x;
double r447153 = r447152 * r447152;
double r447154 = y;
double r447155 = r447154 * r447154;
double r447156 = r447153 + r447155;
double r447157 = z;
double r447158 = r447157 * r447157;
double r447159 = r447156 - r447158;
double r447160 = 2.0;
double r447161 = r447154 * r447160;
double r447162 = r447159 / r447161;
return r447162;
}
double f(double x, double y, double z) {
double r447163 = y;
double r447164 = z;
double r447165 = x;
double r447166 = r447164 + r447165;
double r447167 = r447164 - r447165;
double r447168 = r447163 / r447167;
double r447169 = r447166 / r447168;
double r447170 = r447163 - r447169;
double r447171 = 2.0;
double r447172 = r447170 / r447171;
return r447172;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.6 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 28.6
Simplified12.5
rmApplied difference-of-squares12.5
Applied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2019323
(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)))