\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(1 \cdot \mathsf{fma}\left(\frac{{x}^{1}}{y}, x, y\right) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r624803 = x;
double r624804 = r624803 * r624803;
double r624805 = y;
double r624806 = r624805 * r624805;
double r624807 = r624804 + r624806;
double r624808 = z;
double r624809 = r624808 * r624808;
double r624810 = r624807 - r624809;
double r624811 = 2.0;
double r624812 = r624805 * r624811;
double r624813 = r624810 / r624812;
return r624813;
}
double f(double x, double y, double z) {
double r624814 = 0.5;
double r624815 = 1.0;
double r624816 = x;
double r624817 = pow(r624816, r624815);
double r624818 = y;
double r624819 = r624817 / r624818;
double r624820 = fma(r624819, r624816, r624818);
double r624821 = r624815 * r624820;
double r624822 = z;
double r624823 = r624822 / r624818;
double r624824 = r624822 * r624823;
double r624825 = r624821 - r624824;
double r624826 = r624814 * r624825;
return r624826;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 28.4 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 28.4
Taylor expanded around 0 12.2
Simplified12.2
rmApplied *-un-lft-identity12.2
Applied add-sqr-sqrt38.0
Applied unpow-prod-down38.0
Applied times-frac35.1
Simplified35.1
Simplified6.6
rmApplied sqr-pow6.6
Applied associate-/l*0.1
Simplified0.1
rmApplied *-un-lft-identity0.1
Applied *-un-lft-identity0.1
Applied distribute-lft-out0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020064 +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)))