\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 \cdot x \le 1.51233920017420984 \cdot 10^{-184}:\\
\;\;\;\;\log \left(e^{-1}\right)\\
\mathbf{elif}\;x \cdot x \le 259753368901583.88:\\
\;\;\;\;\log \left(e^{\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)}\right)\\
\mathbf{elif}\;x \cdot x \le 4.9513109421031689 \cdot 10^{37}:\\
\;\;\;\;\log \left(e^{-1}\right)\\
\mathbf{elif}\;x \cdot x \le 1.4348180576052783 \cdot 10^{267}:\\
\;\;\;\;\log \left(e^{\frac{x \cdot x - \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 r4053 = x;
double r4054 = r4053 * r4053;
double r4055 = y;
double r4056 = 4.0;
double r4057 = r4055 * r4056;
double r4058 = r4057 * r4055;
double r4059 = r4054 - r4058;
double r4060 = r4054 + r4058;
double r4061 = r4059 / r4060;
return r4061;
}
double f(double x, double y) {
double r4062 = x;
double r4063 = r4062 * r4062;
double r4064 = 1.5123392001742098e-184;
bool r4065 = r4063 <= r4064;
double r4066 = 1.0;
double r4067 = -r4066;
double r4068 = exp(r4067);
double r4069 = log(r4068);
double r4070 = 259753368901583.88;
bool r4071 = r4063 <= r4070;
double r4072 = y;
double r4073 = 4.0;
double r4074 = r4072 * r4073;
double r4075 = r4074 * r4072;
double r4076 = r4063 + r4075;
double r4077 = r4063 / r4076;
double r4078 = sqrt(r4077);
double r4079 = r4075 / r4076;
double r4080 = sqrt(r4079);
double r4081 = r4078 + r4080;
double r4082 = r4078 - r4080;
double r4083 = r4081 * r4082;
double r4084 = exp(r4083);
double r4085 = log(r4084);
double r4086 = 4.951310942103169e+37;
bool r4087 = r4063 <= r4086;
double r4088 = 1.4348180576052783e+267;
bool r4089 = r4063 <= r4088;
double r4090 = r4063 - r4075;
double r4091 = r4090 / r4076;
double r4092 = exp(r4091);
double r4093 = log(r4092);
double r4094 = 1.0;
double r4095 = r4089 ? r4093 : r4094;
double r4096 = r4087 ? r4069 : r4095;
double r4097 = r4071 ? r4085 : r4096;
double r4098 = r4065 ? r4069 : r4097;
return r4098;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.9 |
|---|---|
| Target | 31.6 |
| Herbie | 12.8 |
if (* x x) < 1.5123392001742098e-184 or 259753368901583.88 < (* x x) < 4.951310942103169e+37Initial program 25.9
rmApplied add-log-exp25.9
rmApplied div-sub25.9
Taylor expanded around 0 11.9
if 1.5123392001742098e-184 < (* x x) < 259753368901583.88Initial program 16.1
rmApplied add-log-exp16.1
rmApplied div-sub16.1
rmApplied add-sqr-sqrt16.1
Applied add-sqr-sqrt16.1
Applied difference-of-squares16.1
if 4.951310942103169e+37 < (* x x) < 1.4348180576052783e+267Initial program 16.4
rmApplied add-log-exp16.5
if 1.4348180576052783e+267 < (* x x) Initial program 58.6
Taylor expanded around inf 9.8
Final simplification12.8
herbie shell --seed 2020025
(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))))