\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) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r571858 = x;
double r571859 = r571858 * r571858;
double r571860 = y;
double r571861 = r571860 * r571860;
double r571862 = r571859 + r571861;
double r571863 = z;
double r571864 = r571863 * r571863;
double r571865 = r571862 - r571864;
double r571866 = 2.0;
double r571867 = r571860 * r571866;
double r571868 = r571865 / r571867;
return r571868;
}
double f(double x, double y, double z) {
double r571869 = 0.5;
double r571870 = y;
double r571871 = x;
double r571872 = 1.0;
double r571873 = pow(r571871, r571872);
double r571874 = r571870 / r571871;
double r571875 = r571873 / r571874;
double r571876 = r571870 + r571875;
double r571877 = z;
double r571878 = r571877 / r571870;
double r571879 = r571877 * r571878;
double r571880 = r571876 - r571879;
double r571881 = r571869 * r571880;
return r571881;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 28.6
Taylor expanded around 0 12.5
Simplified12.5
rmApplied *-un-lft-identity12.5
Applied add-sqr-sqrt38.7
Applied unpow-prod-down38.7
Applied times-frac36.0
Simplified36.0
Simplified6.7
rmApplied sqr-pow6.7
Applied associate-/l*0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020001 +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)))