\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 r434101 = x;
double r434102 = r434101 * r434101;
double r434103 = y;
double r434104 = r434103 * r434103;
double r434105 = r434102 + r434104;
double r434106 = z;
double r434107 = r434106 * r434106;
double r434108 = r434105 - r434107;
double r434109 = 2.0;
double r434110 = r434103 * r434109;
double r434111 = r434108 / r434110;
return r434111;
}
double f(double x, double y, double z) {
double r434112 = y;
double r434113 = z;
double r434114 = x;
double r434115 = r434113 + r434114;
double r434116 = r434113 - r434114;
double r434117 = r434112 / r434116;
double r434118 = r434115 / r434117;
double r434119 = r434112 - r434118;
double r434120 = 2.0;
double r434121 = r434119 / r434120;
return r434121;
}




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
Simplified12.9
rmApplied difference-of-squares12.9
Applied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2019322
(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)))