\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \le -8.785978400076085017966068453698854654375 \cdot 10^{123}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -5.31960586782750077819292973445156907452 \cdot 10^{-138}:\\
\;\;\;\;\left(\sqrt{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y}} + \sqrt{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right) \cdot \left(\sqrt{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y}} - \sqrt{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right)\\
\mathbf{elif}\;x \le 6.492432921720208528877157624509279301342 \cdot 10^{-45}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 2.779617689568547339288402953421560212757 \cdot 10^{95}:\\
\;\;\;\;\left(\sqrt{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y}} + \sqrt{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right) \cdot \left(\sqrt{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y}} - \sqrt{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r186795623 = x;
double r186795624 = r186795623 * r186795623;
double r186795625 = y;
double r186795626 = 4.0;
double r186795627 = r186795625 * r186795626;
double r186795628 = r186795627 * r186795625;
double r186795629 = r186795624 - r186795628;
double r186795630 = r186795624 + r186795628;
double r186795631 = r186795629 / r186795630;
return r186795631;
}
double f(double x, double y) {
double r186795632 = x;
double r186795633 = -8.785978400076085e+123;
bool r186795634 = r186795632 <= r186795633;
double r186795635 = 1.0;
double r186795636 = -5.319605867827501e-138;
bool r186795637 = r186795632 <= r186795636;
double r186795638 = r186795632 * r186795632;
double r186795639 = y;
double r186795640 = 4.0;
double r186795641 = r186795639 * r186795640;
double r186795642 = r186795641 * r186795639;
double r186795643 = r186795638 + r186795642;
double r186795644 = r186795638 / r186795643;
double r186795645 = sqrt(r186795644);
double r186795646 = r186795642 / r186795643;
double r186795647 = sqrt(r186795646);
double r186795648 = r186795645 + r186795647;
double r186795649 = r186795645 - r186795647;
double r186795650 = r186795648 * r186795649;
double r186795651 = 6.492432921720209e-45;
bool r186795652 = r186795632 <= r186795651;
double r186795653 = -1.0;
double r186795654 = 2.7796176895685473e+95;
bool r186795655 = r186795632 <= r186795654;
double r186795656 = r186795655 ? r186795650 : r186795635;
double r186795657 = r186795652 ? r186795653 : r186795656;
double r186795658 = r186795637 ? r186795650 : r186795657;
double r186795659 = r186795634 ? r186795635 : r186795658;
return r186795659;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.4 |
|---|---|
| Target | 31.1 |
| Herbie | 12.2 |
if x < -8.785978400076085e+123 or 2.7796176895685473e+95 < x Initial program 52.9
Taylor expanded around inf 10.0
if -8.785978400076085e+123 < x < -5.319605867827501e-138 or 6.492432921720209e-45 < x < 2.7796176895685473e+95Initial program 15.2
rmApplied div-sub15.2
rmApplied add-sqr-sqrt15.2
Applied add-sqr-sqrt15.2
Applied difference-of-squares15.2
if -5.319605867827501e-138 < x < 6.492432921720209e-45Initial program 26.3
Taylor expanded around 0 11.4
Final simplification12.2
herbie shell --seed 2019173
(FPCore (x y)
:name "Diagrams.TwoD.Arc:arcBetween from diagrams-lib-1.3.0.3"
:herbie-target
(if (< (/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))) 0.9743233849626781) (- (/ (* x x) (+ (* x x) (* (* y y) 4.0))) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))) (- (pow (/ x (sqrt (+ (* x x) (* (* y y) 4.0)))) 2.0) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))))
(/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))))