\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + \frac{{x}^{1}}{\frac{y}{x}}\right) - \frac{{z}^{1}}{\frac{y}{z}}\right)double f(double x, double y, double z) {
double r691630 = x;
double r691631 = r691630 * r691630;
double r691632 = y;
double r691633 = r691632 * r691632;
double r691634 = r691631 + r691633;
double r691635 = z;
double r691636 = r691635 * r691635;
double r691637 = r691634 - r691636;
double r691638 = 2.0;
double r691639 = r691632 * r691638;
double r691640 = r691637 / r691639;
return r691640;
}
double f(double x, double y, double z) {
double r691641 = 0.5;
double r691642 = y;
double r691643 = x;
double r691644 = 1.0;
double r691645 = pow(r691643, r691644);
double r691646 = r691642 / r691643;
double r691647 = r691645 / r691646;
double r691648 = r691642 + r691647;
double r691649 = z;
double r691650 = pow(r691649, r691644);
double r691651 = r691642 / r691649;
double r691652 = r691650 / r691651;
double r691653 = r691648 - r691652;
double r691654 = r691641 * r691653;
return r691654;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 29.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 29.3
Taylor expanded around 0 12.8
Simplified12.8
rmApplied sqr-pow12.8
Applied associate-/l*6.9
Simplified6.9
rmApplied sqr-pow6.9
Applied associate-/l*0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020036 +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)))