\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}^{1} \cdot \frac{{z}^{1}}{y}\right)double f(double x, double y, double z) {
double r705550 = x;
double r705551 = r705550 * r705550;
double r705552 = y;
double r705553 = r705552 * r705552;
double r705554 = r705551 + r705553;
double r705555 = z;
double r705556 = r705555 * r705555;
double r705557 = r705554 - r705556;
double r705558 = 2.0;
double r705559 = r705552 * r705558;
double r705560 = r705557 / r705559;
return r705560;
}
double f(double x, double y, double z) {
double r705561 = 0.5;
double r705562 = y;
double r705563 = x;
double r705564 = r705563 / r705562;
double r705565 = r705563 * r705564;
double r705566 = r705562 + r705565;
double r705567 = z;
double r705568 = 1.0;
double r705569 = pow(r705567, r705568);
double r705570 = r705569 / r705562;
double r705571 = r705569 * r705570;
double r705572 = r705566 - r705571;
double r705573 = r705561 * r705572;
return r705573;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 28.5
Simplified28.5
Taylor expanded around 0 12.8
Simplified12.8
rmApplied sqr-pow12.8
Applied associate-/l*6.9
Simplified6.9
rmApplied *-un-lft-identity6.9
Applied add-sqr-sqrt35.7
Applied unpow-prod-down35.7
Applied times-frac32.3
Simplified32.3
Simplified0.2
rmApplied div-inv0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020060 +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)))