\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\left(z + \mathsf{hypot}\left(x, y\right)\right) \cdot \left(\frac{1}{2 \cdot 1} \cdot \left(\frac{\mathsf{hypot}\left(x, y\right)}{y} - \frac{z}{y}\right)\right)double code(double x, double y, double z) {
return ((double) (((double) (((double) (((double) (x * x)) + ((double) (y * y)))) - ((double) (z * z)))) / ((double) (y * 2.0))));
}
double code(double x, double y, double z) {
return ((double) (((double) (z + ((double) hypot(x, y)))) * ((double) (((double) (1.0 / ((double) (2.0 * 1.0)))) * ((double) (((double) (((double) hypot(x, y)) / y)) - ((double) (z / y))))))));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.7 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 28.7
rmApplied *-commutative28.7
Applied add-sqr-sqrt28.7
Applied difference-of-squares28.7
Applied times-frac27.0
Simplified27.0
Simplified0.1
rmApplied div-inv0.1
Applied associate-*l*0.1
Final simplification0.1
herbie shell --seed 2020114 +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)))