\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 -1.10209323570294511 \cdot 10^{154}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -7.05570383594217736 \cdot 10^{-134}:\\
\;\;\;\;\frac{1}{\frac{x \cdot x + \left(y \cdot 4\right) \cdot y}{x \cdot x}} - \frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\\
\mathbf{elif}\;x \le 3.30957855650517974 \cdot 10^{-97}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 2.70835173311075 \cdot 10^{105}:\\
\;\;\;\;\frac{1}{\frac{x \cdot x + \left(y \cdot 4\right) \cdot y}{x \cdot x}} - \frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r531635 = x;
double r531636 = r531635 * r531635;
double r531637 = y;
double r531638 = 4.0;
double r531639 = r531637 * r531638;
double r531640 = r531639 * r531637;
double r531641 = r531636 - r531640;
double r531642 = r531636 + r531640;
double r531643 = r531641 / r531642;
return r531643;
}
double f(double x, double y) {
double r531644 = x;
double r531645 = -1.1020932357029451e+154;
bool r531646 = r531644 <= r531645;
double r531647 = 1.0;
double r531648 = -7.055703835942177e-134;
bool r531649 = r531644 <= r531648;
double r531650 = r531644 * r531644;
double r531651 = y;
double r531652 = 4.0;
double r531653 = r531651 * r531652;
double r531654 = r531653 * r531651;
double r531655 = r531650 + r531654;
double r531656 = r531655 / r531650;
double r531657 = r531647 / r531656;
double r531658 = r531654 / r531655;
double r531659 = r531657 - r531658;
double r531660 = 3.3095785565051797e-97;
bool r531661 = r531644 <= r531660;
double r531662 = -1.0;
double r531663 = 2.70835173311075e+105;
bool r531664 = r531644 <= r531663;
double r531665 = r531664 ? r531659 : r531647;
double r531666 = r531661 ? r531662 : r531665;
double r531667 = r531649 ? r531659 : r531666;
double r531668 = r531646 ? r531647 : r531667;
return r531668;
}




Bits error versus x




Bits error versus y
Results
| Original | 32.4 |
|---|---|
| Target | 32.1 |
| Herbie | 12.2 |
if x < -1.1020932357029451e+154 or 2.70835173311075e+105 < x Initial program 57.5
Taylor expanded around inf 9.0
if -1.1020932357029451e+154 < x < -7.055703835942177e-134 or 3.3095785565051797e-97 < x < 2.70835173311075e+105Initial program 16.4
rmApplied div-sub16.4
rmApplied clear-num16.4
if -7.055703835942177e-134 < x < 3.3095785565051797e-97Initial program 28.8
Taylor expanded around 0 10.0
Final simplification12.2
herbie shell --seed 2020046
(FPCore (x y)
:name "Diagrams.TwoD.Arc:arcBetween from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(if (< (/ (- (* x x) (* (* y 4) y)) (+ (* x x) (* (* y 4) y))) 0.9743233849626781) (- (/ (* x x) (+ (* x x) (* (* y y) 4))) (/ (* (* y y) 4) (+ (* x x) (* (* y y) 4)))) (- (pow (/ x (sqrt (+ (* x x) (* (* y y) 4)))) 2) (/ (* (* y y) 4) (+ (* x x) (* (* y y) 4)))))
(/ (- (* x x) (* (* y 4) y)) (+ (* x x) (* (* y 4) y))))