\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + {x}^{1} \cdot \frac{x}{y}\right) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r397190 = x;
double r397191 = r397190 * r397190;
double r397192 = y;
double r397193 = r397192 * r397192;
double r397194 = r397191 + r397193;
double r397195 = z;
double r397196 = r397195 * r397195;
double r397197 = r397194 - r397196;
double r397198 = 2.0;
double r397199 = r397192 * r397198;
double r397200 = r397197 / r397199;
return r397200;
}
double f(double x, double y, double z) {
double r397201 = 0.5;
double r397202 = y;
double r397203 = x;
double r397204 = 1.0;
double r397205 = pow(r397203, r397204);
double r397206 = r397203 / r397202;
double r397207 = r397205 * r397206;
double r397208 = r397202 + r397207;
double r397209 = z;
double r397210 = r397209 / r397202;
double r397211 = r397209 * r397210;
double r397212 = r397208 - r397211;
double r397213 = r397201 * r397212;
return r397213;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 27.8 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 27.8
Taylor expanded around 0 12.3
Simplified12.3
rmApplied sqr-pow12.3
Applied associate-/l*6.7
Simplified6.7
rmApplied *-un-lft-identity6.7
Applied add-sqr-sqrt35.7
Applied unpow-prod-down35.7
Applied times-frac32.4
Simplified32.4
Simplified0.1
rmApplied div-inv0.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2019298
(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)))