\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}0.5 \cdot \left(\left(y + \frac{x}{\frac{y}{x}}\right) - z \cdot \frac{z}{y}\right)double f(double x, double y, double z) {
double r619746 = x;
double r619747 = r619746 * r619746;
double r619748 = y;
double r619749 = r619748 * r619748;
double r619750 = r619747 + r619749;
double r619751 = z;
double r619752 = r619751 * r619751;
double r619753 = r619750 - r619752;
double r619754 = 2.0;
double r619755 = r619748 * r619754;
double r619756 = r619753 / r619755;
return r619756;
}
double f(double x, double y, double z) {
double r619757 = 0.5;
double r619758 = y;
double r619759 = x;
double r619760 = r619758 / r619759;
double r619761 = r619759 / r619760;
double r619762 = r619758 + r619761;
double r619763 = z;
double r619764 = r619763 / r619758;
double r619765 = r619763 * r619764;
double r619766 = r619762 - r619765;
double r619767 = r619757 * r619766;
return r619767;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 28.5
Taylor expanded around 0 12.7
Simplified12.7
rmApplied unpow212.7
Applied associate-/l*6.9
rmApplied *-un-lft-identity6.9
Applied add-sqr-sqrt35.6
Applied unpow-prod-down35.6
Applied times-frac32.0
Simplified32.0
Simplified0.1
Final simplification0.1
herbie shell --seed 2020020 +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)))