\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 r673057 = x;
double r673058 = r673057 * r673057;
double r673059 = y;
double r673060 = r673059 * r673059;
double r673061 = r673058 + r673060;
double r673062 = z;
double r673063 = r673062 * r673062;
double r673064 = r673061 - r673063;
double r673065 = 2.0;
double r673066 = r673059 * r673065;
double r673067 = r673064 / r673066;
return r673067;
}
double f(double x, double y, double z) {
double r673068 = 0.5;
double r673069 = y;
double r673070 = x;
double r673071 = r673070 / r673069;
double r673072 = r673070 * r673071;
double r673073 = r673069 + r673072;
double r673074 = z;
double r673075 = r673074 / r673069;
double r673076 = r673074 * r673075;
double r673077 = r673073 - r673076;
double r673078 = r673068 * r673077;
return r673078;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 28.6
Taylor expanded around 0 12.2
Simplified12.2
rmApplied *-un-lft-identity12.2
Applied add-sqr-sqrt38.5
Applied unpow-prod-down38.5
Applied times-frac35.9
Simplified35.9
Simplified6.7
rmApplied *-un-lft-identity6.7
Applied add-sqr-sqrt35.8
Applied unpow-prod-down35.8
Applied times-frac32.5
Simplified32.4
Simplified0.1
Final simplification0.1
herbie shell --seed 2020021 +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)))