\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + \left|x\right| \cdot \frac{\left|x\right|}{y}\right) - \left(z \cdot \left(\sqrt[3]{\frac{z}{y}} \cdot \sqrt[3]{\frac{z}{y}}\right)\right) \cdot \sqrt[3]{\frac{z}{y}}\right)double f(double x, double y, double z) {
double r722649 = x;
double r722650 = r722649 * r722649;
double r722651 = y;
double r722652 = r722651 * r722651;
double r722653 = r722650 + r722652;
double r722654 = z;
double r722655 = r722654 * r722654;
double r722656 = r722653 - r722655;
double r722657 = 2.0;
double r722658 = r722651 * r722657;
double r722659 = r722656 / r722658;
return r722659;
}
double f(double x, double y, double z) {
double r722660 = 0.5;
double r722661 = y;
double r722662 = x;
double r722663 = fabs(r722662);
double r722664 = r722663 / r722661;
double r722665 = r722663 * r722664;
double r722666 = r722661 + r722665;
double r722667 = z;
double r722668 = r722667 / r722661;
double r722669 = cbrt(r722668);
double r722670 = r722669 * r722669;
double r722671 = r722667 * r722670;
double r722672 = r722671 * r722669;
double r722673 = r722666 - r722672;
double r722674 = r722660 * r722673;
return r722674;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 27.9 |
|---|---|
| Target | 0.2 |
| Herbie | 0.4 |
Initial program 27.9
Taylor expanded around 0 12.2
Simplified12.2
rmApplied *-un-lft-identity12.2
Applied add-sqr-sqrt38.2
Applied unpow-prod-down38.2
Applied times-frac35.8
Simplified35.8
Simplified6.9
rmApplied *-un-lft-identity6.9
Applied add-sqr-sqrt6.9
Applied times-frac6.9
Simplified6.9
Simplified0.2
rmApplied add-cube-cbrt0.4
Applied associate-*r*0.4
Final simplification0.4
herbie shell --seed 2020049
(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)))