\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + x \cdot \frac{x}{y}\right) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r678410 = x;
double r678411 = r678410 * r678410;
double r678412 = y;
double r678413 = r678412 * r678412;
double r678414 = r678411 + r678413;
double r678415 = z;
double r678416 = r678415 * r678415;
double r678417 = r678414 - r678416;
double r678418 = 2.0;
double r678419 = r678412 * r678418;
double r678420 = r678417 / r678419;
return r678420;
}
double f(double x, double y, double z) {
double r678421 = 0.5;
double r678422 = y;
double r678423 = x;
double r678424 = r678423 / r678422;
double r678425 = r678423 * r678424;
double r678426 = r678422 + r678425;
double r678427 = z;
double r678428 = r678427 / r678422;
double r678429 = r678427 * r678428;
double r678430 = r678426 - r678429;
double r678431 = r678421 * r678430;
return r678431;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 28.8
Taylor expanded around 0 12.4
Simplified12.4
rmApplied unpow212.4
Applied associate-/l*6.9
rmApplied *-un-lft-identity6.9
Applied add-sqr-sqrt35.9
Applied unpow-prod-down35.9
Applied times-frac32.5
Simplified32.5
Simplified0.1
rmApplied add-sqr-sqrt32.3
Applied *-un-lft-identity32.3
Applied times-frac32.3
Applied add-sqr-sqrt32.4
Applied times-frac32.4
Simplified32.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2020018
(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)))