\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}\;\left(y \cdot 4\right) \cdot y \le 6.5681746261658627 \cdot 10^{-214}:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 6.51230295658223255 \cdot 10^{-77}:\\
\;\;\;\;\log \left(e^{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \left(\sqrt[3]{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}} \cdot \sqrt[3]{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right) \cdot \sqrt[3]{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}}\right)\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 7.16324510776386085 \cdot 10^{31}:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 1.7671028773181022 \cdot 10^{187}:\\
\;\;\;\;\log \left(e^{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \left(\sqrt[3]{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}} \cdot \sqrt[3]{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right) \cdot \sqrt[3]{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}}\right)\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 2.36943602155751907 \cdot 10^{227}:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 9.4017814857528666 \cdot 10^{260}:\\
\;\;\;\;\log \left(e^{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \left(\sqrt[3]{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}} \cdot \sqrt[3]{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right) \cdot \sqrt[3]{\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 r716993 = x;
double r716994 = r716993 * r716993;
double r716995 = y;
double r716996 = 4.0;
double r716997 = r716995 * r716996;
double r716998 = r716997 * r716995;
double r716999 = r716994 - r716998;
double r717000 = r716994 + r716998;
double r717001 = r716999 / r717000;
return r717001;
}
double f(double x, double y) {
double r717002 = y;
double r717003 = 4.0;
double r717004 = r717002 * r717003;
double r717005 = r717004 * r717002;
double r717006 = 6.568174626165863e-214;
bool r717007 = r717005 <= r717006;
double r717008 = 1.0;
double r717009 = 6.5123029565822326e-77;
bool r717010 = r717005 <= r717009;
double r717011 = x;
double r717012 = r717011 * r717011;
double r717013 = r717012 + r717005;
double r717014 = r717012 / r717013;
double r717015 = r717005 / r717013;
double r717016 = cbrt(r717015);
double r717017 = r717016 * r717016;
double r717018 = r717017 * r717016;
double r717019 = r717014 - r717018;
double r717020 = exp(r717019);
double r717021 = log(r717020);
double r717022 = 7.163245107763861e+31;
bool r717023 = r717005 <= r717022;
double r717024 = 1.7671028773181022e+187;
bool r717025 = r717005 <= r717024;
double r717026 = 2.369436021557519e+227;
bool r717027 = r717005 <= r717026;
double r717028 = 9.401781485752867e+260;
bool r717029 = r717005 <= r717028;
double r717030 = -1.0;
double r717031 = r717029 ? r717021 : r717030;
double r717032 = r717027 ? r717008 : r717031;
double r717033 = r717025 ? r717021 : r717032;
double r717034 = r717023 ? r717008 : r717033;
double r717035 = r717010 ? r717021 : r717034;
double r717036 = r717007 ? r717008 : r717035;
return r717036;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.6 |
|---|---|
| Target | 31.3 |
| Herbie | 14.8 |
if (* (* y 4.0) y) < 6.568174626165863e-214 or 6.5123029565822326e-77 < (* (* y 4.0) y) < 7.163245107763861e+31 or 1.7671028773181022e+187 < (* (* y 4.0) y) < 2.369436021557519e+227Initial program 24.2
Taylor expanded around inf 17.6
if 6.568174626165863e-214 < (* (* y 4.0) y) < 6.5123029565822326e-77 or 7.163245107763861e+31 < (* (* y 4.0) y) < 1.7671028773181022e+187 or 2.369436021557519e+227 < (* (* y 4.0) y) < 9.401781485752867e+260Initial program 15.7
rmApplied div-sub15.7
rmApplied add-log-exp15.7
Applied add-log-exp15.7
Applied diff-log15.7
Simplified15.7
rmApplied add-cube-cbrt15.7
if 9.401781485752867e+260 < (* (* y 4.0) y) Initial program 57.2
Taylor expanded around 0 9.6
Final simplification14.8
herbie shell --seed 2020024
(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))))