\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}^{1}}{y}\right)double f(double x, double y, double z) {
double r589834 = x;
double r589835 = r589834 * r589834;
double r589836 = y;
double r589837 = r589836 * r589836;
double r589838 = r589835 + r589837;
double r589839 = z;
double r589840 = r589839 * r589839;
double r589841 = r589838 - r589840;
double r589842 = 2.0;
double r589843 = r589836 * r589842;
double r589844 = r589841 / r589843;
return r589844;
}
double f(double x, double y, double z) {
double r589845 = 0.5;
double r589846 = y;
double r589847 = x;
double r589848 = 1.0;
double r589849 = pow(r589847, r589848);
double r589850 = r589846 / r589847;
double r589851 = r589849 / r589850;
double r589852 = r589846 + r589851;
double r589853 = z;
double r589854 = pow(r589853, r589848);
double r589855 = r589854 / r589846;
double r589856 = r589853 * r589855;
double r589857 = r589852 - r589856;
double r589858 = r589845 * r589857;
return r589858;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 29.0 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 29.0
Taylor expanded around 0 12.8
Simplified12.8
rmApplied sqr-pow12.8
Applied associate-/l*7.0
Simplified7.0
rmApplied sqr-pow7.0
Applied associate-/l*0.2
Simplified0.2
rmApplied add-sqr-sqrt32.3
Applied *-un-lft-identity32.3
Applied times-frac32.3
Applied add-sqr-sqrt32.3
Applied unpow-prod-down32.3
Applied times-frac32.3
Simplified32.3
Simplified0.2
Final simplification0.2
herbie shell --seed 2020002
(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)))