\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\frac{y + \frac{x - z}{\frac{y}{z + x}}}{2}double f(double x, double y, double z) {
double r587568 = x;
double r587569 = r587568 * r587568;
double r587570 = y;
double r587571 = r587570 * r587570;
double r587572 = r587569 + r587571;
double r587573 = z;
double r587574 = r587573 * r587573;
double r587575 = r587572 - r587574;
double r587576 = 2.0;
double r587577 = r587570 * r587576;
double r587578 = r587575 / r587577;
return r587578;
}
double f(double x, double y, double z) {
double r587579 = y;
double r587580 = x;
double r587581 = z;
double r587582 = r587580 - r587581;
double r587583 = r587581 + r587580;
double r587584 = r587579 / r587583;
double r587585 = r587582 / r587584;
double r587586 = r587579 + r587585;
double r587587 = 2.0;
double r587588 = r587586 / r587587;
return r587588;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 28.5
Simplified0.1
rmApplied clear-num0.2
Simplified0.2
rmApplied *-un-lft-identity0.2
Applied *-un-lft-identity0.2
Applied times-frac0.2
Applied *-un-lft-identity0.2
Applied times-frac0.2
Applied associate-*l*0.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2019194 +o rules:numerics
(FPCore (x y z)
:name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A"
:herbie-target
(- (* y 0.5) (* (* (/ 0.5 y) (+ z x)) (- z x)))
(/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))