\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\begin{array}{l}
\mathbf{if}\;x \le -1.3369798884979556 \cdot 10^{154}:\\
\;\;\;\;0.5 \cdot \left(\left(y + \frac{\frac{x}{y}}{\frac{1}{x}}\right) - \frac{{z}^{2}}{y}\right)\\
\mathbf{elif}\;x \le 9.96878875477082418 \cdot 10^{153}:\\
\;\;\;\;0.5 \cdot \left(\left(y + \frac{{x}^{2}}{y}\right) - z \cdot \frac{z}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left(y + \frac{x}{\frac{y}{x}}\right) - \frac{{z}^{2}}{y}\right)\\
\end{array}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) {
double VAR;
if ((x <= -1.3369798884979556e+154)) {
VAR = ((double) (0.5 * ((double) (((double) (y + ((double) (((double) (x / y)) / ((double) (1.0 / x)))))) - ((double) (((double) pow(z, 2.0)) / y))))));
} else {
double VAR_1;
if ((x <= 9.968788754770824e+153)) {
VAR_1 = ((double) (0.5 * ((double) (((double) (y + ((double) (((double) pow(x, 2.0)) / y)))) - ((double) (z * ((double) (z / y))))))));
} else {
VAR_1 = ((double) (0.5 * ((double) (((double) (y + ((double) (x / ((double) (y / x)))))) - ((double) (((double) pow(z, 2.0)) / y))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 28.0 |
|---|---|
| Target | 0.2 |
| Herbie | 1.7 |
if x < -1.3369798884979556e154Initial program 64.0
Taylor expanded around 0 64.0
Simplified64.0
rmApplied unpow264.0
Applied associate-/l*11.3
rmApplied div-inv11.3
Applied associate-/r*11.3
if -1.3369798884979556e154 < x < 9.96878875477082418e153Initial program 24.0
Taylor expanded around 0 7.0
Simplified7.0
rmApplied *-un-lft-identity7.0
Applied add-sqr-sqrt35.2
Applied unpow-prod-down35.2
Applied times-frac32.0
Simplified32.0
Simplified0.7
if 9.96878875477082418e153 < x Initial program 63.8
Taylor expanded around 0 63.5
Simplified63.5
rmApplied unpow263.5
Applied associate-/l*11.2
Final simplification1.7
herbie shell --seed 2020162
(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.0)))