\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\frac{\mathsf{fma}\left(\frac{x + z}{y}, x - z, y\right)}{2}double f(double x, double y, double z) {
double r432523 = x;
double r432524 = r432523 * r432523;
double r432525 = y;
double r432526 = r432525 * r432525;
double r432527 = r432524 + r432526;
double r432528 = z;
double r432529 = r432528 * r432528;
double r432530 = r432527 - r432529;
double r432531 = 2.0;
double r432532 = r432525 * r432531;
double r432533 = r432530 / r432532;
return r432533;
}
double f(double x, double y, double z) {
double r432534 = x;
double r432535 = z;
double r432536 = r432534 + r432535;
double r432537 = y;
double r432538 = r432536 / r432537;
double r432539 = r432534 - r432535;
double r432540 = fma(r432538, r432539, r432537);
double r432541 = 2.0;
double r432542 = r432540 / r432541;
return r432542;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 28.7 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 28.7
Simplified12.6
rmApplied difference-of-squares12.6
Applied associate-/l*0.1
rmApplied *-un-lft-identity0.1
Applied *-un-lft-identity0.1
Applied times-frac0.1
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019305 +o rules:numerics
(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)))