(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (+ x (/ x (* y y))) (fma (+ x -1.0) (/ 1.0 y) (pow y -2.0)))))
(if (<= y -396.1505766906375)
t_0
(if (<= y 435.2526031412426) (fma y (/ x (+ y 1.0)) 1.0) t_0))))double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
double code(double x, double y) {
double t_0 = (x + (x / (y * y))) - fma((x + -1.0), (1.0 / y), pow(y, -2.0));
double tmp;
if (y <= -396.1505766906375) {
tmp = t_0;
} else if (y <= 435.2526031412426) {
tmp = fma(y, (x / (y + 1.0)), 1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) return Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) end
function code(x, y) t_0 = Float64(Float64(x + Float64(x / Float64(y * y))) - fma(Float64(x + -1.0), Float64(1.0 / y), (y ^ -2.0))) tmp = 0.0 if (y <= -396.1505766906375) tmp = t_0; elseif (y <= 435.2526031412426) tmp = fma(y, Float64(x / Float64(y + 1.0)), 1.0); else tmp = t_0; end return tmp end
code[x_, y_] := N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := Block[{t$95$0 = N[(N[(x + N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x + -1.0), $MachinePrecision] * N[(1.0 / y), $MachinePrecision] + N[Power[y, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -396.1505766906375], t$95$0, If[LessEqual[y, 435.2526031412426], N[(y * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], t$95$0]]]
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\begin{array}{l}
t_0 := \left(x + \frac{x}{y \cdot y}\right) - \mathsf{fma}\left(x + -1, \frac{1}{y}, {y}^{-2}\right)\\
\mathbf{if}\;y \leq -396.1505766906375:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 435.2526031412426:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{y + 1}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}




Bits error versus x




Bits error versus y
| Original | 22.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.6 |
if y < -396.150576690637479 or 435.25260314124262 < y Initial program 44.8
Simplified28.5
Taylor expanded in y around inf 0.2
Simplified0.2
Applied egg-rr0.2
if -396.150576690637479 < y < 435.25260314124262Initial program 0.0
Simplified0.0
Taylor expanded in x around inf 1.0
Final simplification0.6
herbie shell --seed 2022133
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:herbie-target
(if (< y -3693.8482788297247) (- (/ 1.0 y) (- (/ x y) x)) (if (< y 6799310503.41891) (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))) (- (/ 1.0 y) (- (/ x y) x))))
(- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))