\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 r426731 = x;
double r426732 = r426731 * r426731;
double r426733 = y;
double r426734 = r426733 * r426733;
double r426735 = r426732 + r426734;
double r426736 = z;
double r426737 = r426736 * r426736;
double r426738 = r426735 - r426737;
double r426739 = 2.0;
double r426740 = r426733 * r426739;
double r426741 = r426738 / r426740;
return r426741;
}
double f(double x, double y, double z) {
double r426742 = y;
double r426743 = z;
double r426744 = x;
double r426745 = r426743 + r426744;
double r426746 = r426743 - r426744;
double r426747 = r426742 / r426746;
double r426748 = r426745 / r426747;
double r426749 = r426742 - r426748;
double r426750 = 2.0;
double r426751 = r426749 / r426750;
return r426751;
}




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)))