
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (* (/ x (+ x y)) (/ (/ y (+ y (+ x 1.0))) (+ x y))))
assert(x < y);
double code(double x, double y) {
return (x / (x + y)) * ((y / (y + (x + 1.0))) / (x + y));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (x + y)) * ((y / (y + (x + 1.0d0))) / (x + y))
end function
assert x < y;
public static double code(double x, double y) {
return (x / (x + y)) * ((y / (y + (x + 1.0))) / (x + y));
}
[x, y] = sort([x, y]) def code(x, y): return (x / (x + y)) * ((y / (y + (x + 1.0))) / (x + y))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(x / Float64(x + y)) * Float64(Float64(y / Float64(y + Float64(x + 1.0))) / Float64(x + y))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (x / (x + y)) * ((y / (y + (x + 1.0))) / (x + y));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{x + y} \cdot \frac{\frac{y}{y + \left(x + 1\right)}}{x + y}
\end{array}
Initial program 68.4%
times-frac85.1%
associate-+r+85.1%
associate-*l/79.9%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -2e+125)
(/ (/ y (+ x (+ y (+ y 1.0)))) (+ x y))
(if (<= x -8e-18)
(* y (/ x (* (+ x y) (* (+ y (+ x 1.0)) (+ x y)))))
(* (/ x (+ x y)) (/ (/ y (+ y 1.0)) (+ x y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2e+125) {
tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
} else if (x <= -8e-18) {
tmp = y * (x / ((x + y) * ((y + (x + 1.0)) * (x + y))));
} else {
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2d+125)) then
tmp = (y / (x + (y + (y + 1.0d0)))) / (x + y)
else if (x <= (-8d-18)) then
tmp = y * (x / ((x + y) * ((y + (x + 1.0d0)) * (x + y))))
else
tmp = (x / (x + y)) * ((y / (y + 1.0d0)) / (x + y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2e+125) {
tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
} else if (x <= -8e-18) {
tmp = y * (x / ((x + y) * ((y + (x + 1.0)) * (x + y))));
} else {
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2e+125: tmp = (y / (x + (y + (y + 1.0)))) / (x + y) elif x <= -8e-18: tmp = y * (x / ((x + y) * ((y + (x + 1.0)) * (x + y)))) else: tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2e+125) tmp = Float64(Float64(y / Float64(x + Float64(y + Float64(y + 1.0)))) / Float64(x + y)); elseif (x <= -8e-18) tmp = Float64(y * Float64(x / Float64(Float64(x + y) * Float64(Float64(y + Float64(x + 1.0)) * Float64(x + y))))); else tmp = Float64(Float64(x / Float64(x + y)) * Float64(Float64(y / Float64(y + 1.0)) / Float64(x + y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2e+125)
tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
elseif (x <= -8e-18)
tmp = y * (x / ((x + y) * ((y + (x + 1.0)) * (x + y))));
else
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2e+125], N[(N[(y / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-18], N[(y * N[(x / N[(N[(x + y), $MachinePrecision] * N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+125}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + \left(y + 1\right)\right)}}{x + y}\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-18}:\\
\;\;\;\;y \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(y + \left(x + 1\right)\right) \cdot \left(x + y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{\frac{y}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -1.9999999999999998e125Initial program 47.6%
times-frac71.8%
associate-+r+71.8%
associate-*l/71.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
clear-num99.7%
frac-times98.2%
*-un-lft-identity98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
+-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in x around -inf 83.7%
+-commutative83.7%
mul-1-neg83.7%
unsub-neg83.7%
neg-mul-183.7%
unsub-neg83.7%
distribute-lft-in83.7%
metadata-eval83.7%
neg-mul-183.7%
unsub-neg83.7%
Simplified83.7%
if -1.9999999999999998e125 < x < -8.0000000000000006e-18Initial program 68.8%
*-commutative68.8%
associate-*r/87.0%
*-commutative87.0%
distribute-rgt1-in73.4%
fma-def87.0%
cube-unmult87.1%
Simplified87.1%
fma-udef73.5%
cube-mult73.4%
distribute-rgt1-in87.0%
associate-+r+87.0%
associate-*r*87.0%
+-commutative87.0%
associate-+l+87.0%
+-commutative87.0%
+-commutative87.0%
Applied egg-rr87.0%
if -8.0000000000000006e-18 < x Initial program 72.9%
times-frac86.3%
associate-+r+86.3%
associate-*l/79.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 85.4%
+-commutative85.4%
Simplified85.4%
Final simplification85.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.02e+126)
(/ (/ y (+ x (+ y (+ y 1.0)))) (+ x y))
(if (<= x -5e-18)
(* (/ x (* (+ x y) (+ x y))) (/ y (+ x (+ y 1.0))))
(* (/ x (+ x y)) (/ (/ y (+ y 1.0)) (+ x y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.02e+126) {
tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
} else if (x <= -5e-18) {
tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0)));
} else {
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.02d+126)) then
tmp = (y / (x + (y + (y + 1.0d0)))) / (x + y)
else if (x <= (-5d-18)) then
tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0d0)))
else
tmp = (x / (x + y)) * ((y / (y + 1.0d0)) / (x + y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.02e+126) {
tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
} else if (x <= -5e-18) {
tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0)));
} else {
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.02e+126: tmp = (y / (x + (y + (y + 1.0)))) / (x + y) elif x <= -5e-18: tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0))) else: tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.02e+126) tmp = Float64(Float64(y / Float64(x + Float64(y + Float64(y + 1.0)))) / Float64(x + y)); elseif (x <= -5e-18) tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(x + y)) * Float64(Float64(y / Float64(y + 1.0)) / Float64(x + y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.02e+126)
tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
elseif (x <= -5e-18)
tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0)));
else
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.02e+126], N[(N[(y / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5e-18], N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{+126}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + \left(y + 1\right)\right)}}{x + y}\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-18}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{\frac{y}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -1.02e126Initial program 47.6%
times-frac71.8%
associate-+r+71.8%
associate-*l/71.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
clear-num99.7%
frac-times98.2%
*-un-lft-identity98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
+-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in x around -inf 83.7%
+-commutative83.7%
mul-1-neg83.7%
unsub-neg83.7%
neg-mul-183.7%
unsub-neg83.7%
distribute-lft-in83.7%
metadata-eval83.7%
neg-mul-183.7%
unsub-neg83.7%
Simplified83.7%
if -1.02e126 < x < -5.00000000000000036e-18Initial program 68.8%
times-frac99.9%
/-rgt-identity99.9%
associate-/l/99.9%
*-lft-identity99.9%
associate-+l+99.9%
Simplified99.9%
if -5.00000000000000036e-18 < x Initial program 72.9%
times-frac86.3%
associate-+r+86.3%
associate-*l/79.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 85.4%
+-commutative85.4%
Simplified85.4%
Final simplification86.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ y (+ x (+ y (+ y 1.0)))) (+ x y))))
(if (<= x -8.5e-20)
t_0
(if (<= x -8.5e-131)
(/ x (+ y (* y y)))
(if (<= x -8.5e-167) t_0 (* (/ x (+ x y)) (/ 1.0 (+ y 1.0))))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / (x + (y + (y + 1.0)))) / (x + y);
double tmp;
if (x <= -8.5e-20) {
tmp = t_0;
} else if (x <= -8.5e-131) {
tmp = x / (y + (y * y));
} else if (x <= -8.5e-167) {
tmp = t_0;
} else {
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (y / (x + (y + (y + 1.0d0)))) / (x + y)
if (x <= (-8.5d-20)) then
tmp = t_0
else if (x <= (-8.5d-131)) then
tmp = x / (y + (y * y))
else if (x <= (-8.5d-167)) then
tmp = t_0
else
tmp = (x / (x + y)) * (1.0d0 / (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (y / (x + (y + (y + 1.0)))) / (x + y);
double tmp;
if (x <= -8.5e-20) {
tmp = t_0;
} else if (x <= -8.5e-131) {
tmp = x / (y + (y * y));
} else if (x <= -8.5e-167) {
tmp = t_0;
} else {
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / (x + (y + (y + 1.0)))) / (x + y) tmp = 0 if x <= -8.5e-20: tmp = t_0 elif x <= -8.5e-131: tmp = x / (y + (y * y)) elif x <= -8.5e-167: tmp = t_0 else: tmp = (x / (x + y)) * (1.0 / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / Float64(x + Float64(y + Float64(y + 1.0)))) / Float64(x + y)) tmp = 0.0 if (x <= -8.5e-20) tmp = t_0; elseif (x <= -8.5e-131) tmp = Float64(x / Float64(y + Float64(y * y))); elseif (x <= -8.5e-167) tmp = t_0; else tmp = Float64(Float64(x / Float64(x + y)) * Float64(1.0 / Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (y / (x + (y + (y + 1.0)))) / (x + y);
tmp = 0.0;
if (x <= -8.5e-20)
tmp = t_0;
elseif (x <= -8.5e-131)
tmp = x / (y + (y * y));
elseif (x <= -8.5e-167)
tmp = t_0;
else
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(N[(y / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e-20], t$95$0, If[LessEqual[x, -8.5e-131], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], t$95$0, N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{x + \left(y + \left(y + 1\right)\right)}}{x + y}\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{-20}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-131}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y + 1}\\
\end{array}
\end{array}
if x < -8.5000000000000005e-20 or -8.50000000000000013e-131 < x < -8.4999999999999994e-167Initial program 56.0%
times-frac81.7%
associate-+r+81.7%
associate-*l/79.3%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.8%
clear-num99.8%
frac-times98.2%
*-un-lft-identity98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
+-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in x around -inf 71.4%
+-commutative71.4%
mul-1-neg71.4%
unsub-neg71.4%
neg-mul-171.4%
unsub-neg71.4%
distribute-lft-in71.4%
metadata-eval71.4%
neg-mul-171.4%
unsub-neg71.4%
Simplified71.4%
if -8.5000000000000005e-20 < x < -8.50000000000000013e-131Initial program 98.3%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 65.7%
distribute-rgt-in65.7%
*-lft-identity65.7%
Simplified65.7%
if -8.4999999999999994e-167 < x Initial program 70.3%
times-frac84.8%
associate-+r+84.8%
associate-*l/77.9%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 65.4%
+-commutative65.4%
Simplified65.4%
Final simplification67.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -2.2e-15)
(/ (/ y (+ x (+ y (+ y 1.0)))) (+ x y))
(if (<= x -9.2e-166)
(* (/ x (* (+ x y) (+ x y))) (/ y (+ y 1.0)))
(* (/ x (+ x y)) (/ 1.0 (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.2e-15) {
tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
} else if (x <= -9.2e-166) {
tmp = (x / ((x + y) * (x + y))) * (y / (y + 1.0));
} else {
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.2d-15)) then
tmp = (y / (x + (y + (y + 1.0d0)))) / (x + y)
else if (x <= (-9.2d-166)) then
tmp = (x / ((x + y) * (x + y))) * (y / (y + 1.0d0))
else
tmp = (x / (x + y)) * (1.0d0 / (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.2e-15) {
tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
} else if (x <= -9.2e-166) {
tmp = (x / ((x + y) * (x + y))) * (y / (y + 1.0));
} else {
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.2e-15: tmp = (y / (x + (y + (y + 1.0)))) / (x + y) elif x <= -9.2e-166: tmp = (x / ((x + y) * (x + y))) * (y / (y + 1.0)) else: tmp = (x / (x + y)) * (1.0 / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.2e-15) tmp = Float64(Float64(y / Float64(x + Float64(y + Float64(y + 1.0)))) / Float64(x + y)); elseif (x <= -9.2e-166) tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / Float64(y + 1.0))); else tmp = Float64(Float64(x / Float64(x + y)) * Float64(1.0 / Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.2e-15)
tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
elseif (x <= -9.2e-166)
tmp = (x / ((x + y) * (x + y))) * (y / (y + 1.0));
else
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.2e-15], N[(N[(y / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9.2e-166], N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + \left(y + 1\right)\right)}}{x + y}\\
\mathbf{elif}\;x \leq -9.2 \cdot 10^{-166}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y + 1}\\
\end{array}
\end{array}
if x < -2.19999999999999986e-15Initial program 54.9%
times-frac81.5%
associate-+r+81.5%
associate-*l/81.4%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
clear-num99.7%
frac-times98.7%
*-un-lft-identity98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
associate-+l+98.7%
+-commutative98.7%
+-commutative98.7%
Applied egg-rr98.7%
Taylor expanded in x around -inf 74.6%
+-commutative74.6%
mul-1-neg74.6%
unsub-neg74.6%
neg-mul-174.6%
unsub-neg74.6%
distribute-lft-in74.6%
metadata-eval74.6%
neg-mul-174.6%
unsub-neg74.6%
Simplified74.6%
if -2.19999999999999986e-15 < x < -9.19999999999999995e-166Initial program 90.5%
times-frac97.7%
/-rgt-identity97.7%
associate-/l/97.7%
*-lft-identity97.7%
associate-+l+97.7%
Simplified97.7%
Taylor expanded in x around 0 97.7%
+-commutative97.7%
Simplified97.7%
if -9.19999999999999995e-166 < x Initial program 70.0%
times-frac84.4%
associate-+r+84.4%
associate-*l/77.5%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 65.3%
+-commutative65.3%
Simplified65.3%
Final simplification71.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -9.5e-63)
(* (/ y (+ x (+ y 1.0))) (/ 1.0 x))
(if (<= x -6.8e-131)
(/ x (* y (+ y 1.0)))
(if (<= x -8.5e-167)
(/ (/ y (+ x 1.0)) (+ x y))
(* (/ x (+ x y)) (/ 1.0 (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -9.5e-63) {
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
} else if (x <= -6.8e-131) {
tmp = x / (y * (y + 1.0));
} else if (x <= -8.5e-167) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-9.5d-63)) then
tmp = (y / (x + (y + 1.0d0))) * (1.0d0 / x)
else if (x <= (-6.8d-131)) then
tmp = x / (y * (y + 1.0d0))
else if (x <= (-8.5d-167)) then
tmp = (y / (x + 1.0d0)) / (x + y)
else
tmp = (x / (x + y)) * (1.0d0 / (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -9.5e-63) {
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
} else if (x <= -6.8e-131) {
tmp = x / (y * (y + 1.0));
} else if (x <= -8.5e-167) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -9.5e-63: tmp = (y / (x + (y + 1.0))) * (1.0 / x) elif x <= -6.8e-131: tmp = x / (y * (y + 1.0)) elif x <= -8.5e-167: tmp = (y / (x + 1.0)) / (x + y) else: tmp = (x / (x + y)) * (1.0 / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -9.5e-63) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(1.0 / x)); elseif (x <= -6.8e-131) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (x <= -8.5e-167) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); else tmp = Float64(Float64(x / Float64(x + y)) * Float64(1.0 / Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -9.5e-63)
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
elseif (x <= -6.8e-131)
tmp = x / (y * (y + 1.0));
elseif (x <= -8.5e-167)
tmp = (y / (x + 1.0)) / (x + y);
else
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -9.5e-63], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.8e-131], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-63}:\\
\;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-131}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y + 1}\\
\end{array}
\end{array}
if x < -9.50000000000000016e-63Initial program 58.7%
times-frac83.0%
/-rgt-identity83.0%
associate-/l/83.0%
*-lft-identity83.0%
associate-+l+83.0%
Simplified83.0%
Taylor expanded in x around inf 70.7%
if -9.50000000000000016e-63 < x < -6.7999999999999999e-131Initial program 97.8%
times-frac99.6%
/-rgt-identity99.6%
associate-/l/99.6%
*-lft-identity99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 71.0%
+-commutative71.0%
Simplified71.0%
if -6.7999999999999999e-131 < x < -8.4999999999999994e-167Initial program 64.2%
times-frac83.4%
associate-+r+83.4%
associate-*l/64.2%
times-frac100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
Applied egg-rr100.0%
associate-*r/100.0%
clear-num100.0%
frac-times94.6%
*-un-lft-identity94.6%
+-commutative94.6%
+-commutative94.6%
+-commutative94.6%
associate-+l+94.6%
+-commutative94.6%
+-commutative94.6%
Applied egg-rr94.6%
Taylor expanded in y around 0 46.2%
if -8.4999999999999994e-167 < x Initial program 70.3%
times-frac84.8%
associate-+r+84.8%
associate-*l/77.9%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 65.4%
+-commutative65.4%
Simplified65.4%
Final simplification66.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -8.2e-17)
(/ (/ 1.0 (+ x 1.0)) (/ (+ x y) y))
(if (<= x -1.1e-130)
(/ x (+ y (* y y)))
(if (<= x -8.5e-167)
(/ (/ y (+ x 1.0)) (+ x y))
(* (/ x (+ x y)) (/ 1.0 (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -8.2e-17) {
tmp = (1.0 / (x + 1.0)) / ((x + y) / y);
} else if (x <= -1.1e-130) {
tmp = x / (y + (y * y));
} else if (x <= -8.5e-167) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-8.2d-17)) then
tmp = (1.0d0 / (x + 1.0d0)) / ((x + y) / y)
else if (x <= (-1.1d-130)) then
tmp = x / (y + (y * y))
else if (x <= (-8.5d-167)) then
tmp = (y / (x + 1.0d0)) / (x + y)
else
tmp = (x / (x + y)) * (1.0d0 / (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -8.2e-17) {
tmp = (1.0 / (x + 1.0)) / ((x + y) / y);
} else if (x <= -1.1e-130) {
tmp = x / (y + (y * y));
} else if (x <= -8.5e-167) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -8.2e-17: tmp = (1.0 / (x + 1.0)) / ((x + y) / y) elif x <= -1.1e-130: tmp = x / (y + (y * y)) elif x <= -8.5e-167: tmp = (y / (x + 1.0)) / (x + y) else: tmp = (x / (x + y)) * (1.0 / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -8.2e-17) tmp = Float64(Float64(1.0 / Float64(x + 1.0)) / Float64(Float64(x + y) / y)); elseif (x <= -1.1e-130) tmp = Float64(x / Float64(y + Float64(y * y))); elseif (x <= -8.5e-167) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); else tmp = Float64(Float64(x / Float64(x + y)) * Float64(1.0 / Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -8.2e-17)
tmp = (1.0 / (x + 1.0)) / ((x + y) / y);
elseif (x <= -1.1e-130)
tmp = x / (y + (y * y));
elseif (x <= -8.5e-167)
tmp = (y / (x + 1.0)) / (x + y);
else
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -8.2e-17], N[(N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.1e-130], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.2 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{1}{x + 1}}{\frac{x + y}{y}}\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{-130}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y + 1}\\
\end{array}
\end{array}
if x < -8.2000000000000001e-17Initial program 54.9%
times-frac81.5%
associate-+r+81.5%
associate-*l/81.4%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*l/99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-/l*73.6%
associate-/l/73.6%
*-commutative73.6%
associate-+r+73.6%
Simplified73.6%
*-un-lft-identity73.6%
associate-/r/73.7%
times-frac81.4%
*-commutative81.4%
+-commutative81.4%
Applied egg-rr81.4%
associate-*l/81.4%
*-lft-identity81.4%
+-commutative81.4%
+-commutative81.4%
+-commutative81.4%
Simplified81.4%
Taylor expanded in y around 0 72.9%
if -8.2000000000000001e-17 < x < -1.0999999999999999e-130Initial program 98.3%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 65.7%
distribute-rgt-in65.7%
*-lft-identity65.7%
Simplified65.7%
if -1.0999999999999999e-130 < x < -8.4999999999999994e-167Initial program 64.2%
times-frac83.4%
associate-+r+83.4%
associate-*l/64.2%
times-frac100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
Applied egg-rr100.0%
associate-*r/100.0%
clear-num100.0%
frac-times94.6%
*-un-lft-identity94.6%
+-commutative94.6%
+-commutative94.6%
+-commutative94.6%
associate-+l+94.6%
+-commutative94.6%
+-commutative94.6%
Applied egg-rr94.6%
Taylor expanded in y around 0 46.2%
if -8.4999999999999994e-167 < x Initial program 70.3%
times-frac84.8%
associate-+r+84.8%
associate-*l/77.9%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 65.4%
+-commutative65.4%
Simplified65.4%
Final simplification66.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.2e-15) (/ (/ y (+ x (+ y (+ y 1.0)))) (+ x y)) (* (/ x (+ x y)) (/ (/ y (+ y 1.0)) (+ x y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.2e-15) {
tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
} else {
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.2d-15)) then
tmp = (y / (x + (y + (y + 1.0d0)))) / (x + y)
else
tmp = (x / (x + y)) * ((y / (y + 1.0d0)) / (x + y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.2e-15) {
tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
} else {
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.2e-15: tmp = (y / (x + (y + (y + 1.0)))) / (x + y) else: tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.2e-15) tmp = Float64(Float64(y / Float64(x + Float64(y + Float64(y + 1.0)))) / Float64(x + y)); else tmp = Float64(Float64(x / Float64(x + y)) * Float64(Float64(y / Float64(y + 1.0)) / Float64(x + y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.2e-15)
tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
else
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.2e-15], N[(N[(y / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + \left(y + 1\right)\right)}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{\frac{y}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -2.19999999999999986e-15Initial program 54.9%
times-frac81.5%
associate-+r+81.5%
associate-*l/81.4%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
clear-num99.7%
frac-times98.7%
*-un-lft-identity98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
associate-+l+98.7%
+-commutative98.7%
+-commutative98.7%
Applied egg-rr98.7%
Taylor expanded in x around -inf 74.6%
+-commutative74.6%
mul-1-neg74.6%
unsub-neg74.6%
neg-mul-174.6%
unsub-neg74.6%
distribute-lft-in74.6%
metadata-eval74.6%
neg-mul-174.6%
unsub-neg74.6%
Simplified74.6%
if -2.19999999999999986e-15 < x Initial program 72.9%
times-frac86.3%
associate-+r+86.3%
associate-*l/79.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 85.4%
+-commutative85.4%
Simplified85.4%
Final simplification82.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))) (t_1 (/ x (* y (+ y 1.0)))))
(if (<= x -6e-63)
t_0
(if (<= x -6.8e-131)
t_1
(if (<= x -4.8e-167)
t_0
(if (<= x 9500000000000.0) t_1 (* (/ 1.0 y) (/ x y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double t_1 = x / (y * (y + 1.0));
double tmp;
if (x <= -6e-63) {
tmp = t_0;
} else if (x <= -6.8e-131) {
tmp = t_1;
} else if (x <= -4.8e-167) {
tmp = t_0;
} else if (x <= 9500000000000.0) {
tmp = t_1;
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y / (x * (x + 1.0d0))
t_1 = x / (y * (y + 1.0d0))
if (x <= (-6d-63)) then
tmp = t_0
else if (x <= (-6.8d-131)) then
tmp = t_1
else if (x <= (-4.8d-167)) then
tmp = t_0
else if (x <= 9500000000000.0d0) then
tmp = t_1
else
tmp = (1.0d0 / y) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double t_1 = x / (y * (y + 1.0));
double tmp;
if (x <= -6e-63) {
tmp = t_0;
} else if (x <= -6.8e-131) {
tmp = t_1;
} else if (x <= -4.8e-167) {
tmp = t_0;
} else if (x <= 9500000000000.0) {
tmp = t_1;
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * (x + 1.0)) t_1 = x / (y * (y + 1.0)) tmp = 0 if x <= -6e-63: tmp = t_0 elif x <= -6.8e-131: tmp = t_1 elif x <= -4.8e-167: tmp = t_0 elif x <= 9500000000000.0: tmp = t_1 else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) t_1 = Float64(x / Float64(y * Float64(y + 1.0))) tmp = 0.0 if (x <= -6e-63) tmp = t_0; elseif (x <= -6.8e-131) tmp = t_1; elseif (x <= -4.8e-167) tmp = t_0; elseif (x <= 9500000000000.0) tmp = t_1; else tmp = Float64(Float64(1.0 / y) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x * (x + 1.0));
t_1 = x / (y * (y + 1.0));
tmp = 0.0;
if (x <= -6e-63)
tmp = t_0;
elseif (x <= -6.8e-131)
tmp = t_1;
elseif (x <= -4.8e-167)
tmp = t_0;
elseif (x <= 9500000000000.0)
tmp = t_1;
else
tmp = (1.0 / y) * (x / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e-63], t$95$0, If[LessEqual[x, -6.8e-131], t$95$1, If[LessEqual[x, -4.8e-167], t$95$0, If[LessEqual[x, 9500000000000.0], t$95$1, N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
t_1 := \frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{if}\;x \leq -6 \cdot 10^{-63}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-167}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 9500000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -5.99999999999999959e-63 or -6.7999999999999999e-131 < x < -4.79999999999999986e-167Initial program 59.3%
times-frac83.1%
/-rgt-identity83.1%
associate-/l/83.1%
*-lft-identity83.1%
associate-+l+83.1%
Simplified83.1%
Taylor expanded in y around 0 62.4%
if -5.99999999999999959e-63 < x < -6.7999999999999999e-131 or -4.79999999999999986e-167 < x < 9.5e12Initial program 75.1%
times-frac84.8%
/-rgt-identity84.8%
associate-/l/84.8%
*-lft-identity84.8%
associate-+l+84.8%
Simplified84.8%
Taylor expanded in x around 0 82.8%
+-commutative82.8%
Simplified82.8%
if 9.5e12 < x Initial program 66.9%
associate-*r/82.1%
*-commutative82.1%
distribute-rgt1-in73.2%
fma-def82.1%
cube-unmult82.1%
Simplified82.1%
Taylor expanded in y around inf 22.7%
unpow222.7%
Simplified22.7%
associate-/r*29.3%
div-inv29.3%
Applied egg-rr29.3%
Final simplification64.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y (+ y 1.0)))))
(if (<= x -4.2e-63)
(/ y (+ x (* x x)))
(if (<= x -7.2e-131)
t_0
(if (<= x -8.5e-167)
(/ y (* x (+ x 1.0)))
(if (<= x 490000000.0) t_0 (* (/ 1.0 y) (/ x y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y * (y + 1.0));
double tmp;
if (x <= -4.2e-63) {
tmp = y / (x + (x * x));
} else if (x <= -7.2e-131) {
tmp = t_0;
} else if (x <= -8.5e-167) {
tmp = y / (x * (x + 1.0));
} else if (x <= 490000000.0) {
tmp = t_0;
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y * (y + 1.0d0))
if (x <= (-4.2d-63)) then
tmp = y / (x + (x * x))
else if (x <= (-7.2d-131)) then
tmp = t_0
else if (x <= (-8.5d-167)) then
tmp = y / (x * (x + 1.0d0))
else if (x <= 490000000.0d0) then
tmp = t_0
else
tmp = (1.0d0 / y) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y * (y + 1.0));
double tmp;
if (x <= -4.2e-63) {
tmp = y / (x + (x * x));
} else if (x <= -7.2e-131) {
tmp = t_0;
} else if (x <= -8.5e-167) {
tmp = y / (x * (x + 1.0));
} else if (x <= 490000000.0) {
tmp = t_0;
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y * (y + 1.0)) tmp = 0 if x <= -4.2e-63: tmp = y / (x + (x * x)) elif x <= -7.2e-131: tmp = t_0 elif x <= -8.5e-167: tmp = y / (x * (x + 1.0)) elif x <= 490000000.0: tmp = t_0 else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y * Float64(y + 1.0))) tmp = 0.0 if (x <= -4.2e-63) tmp = Float64(y / Float64(x + Float64(x * x))); elseif (x <= -7.2e-131) tmp = t_0; elseif (x <= -8.5e-167) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (x <= 490000000.0) tmp = t_0; else tmp = Float64(Float64(1.0 / y) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y * (y + 1.0));
tmp = 0.0;
if (x <= -4.2e-63)
tmp = y / (x + (x * x));
elseif (x <= -7.2e-131)
tmp = t_0;
elseif (x <= -8.5e-167)
tmp = y / (x * (x + 1.0));
elseif (x <= 490000000.0)
tmp = t_0;
else
tmp = (1.0 / y) * (x / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.2e-63], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.2e-131], t$95$0, If[LessEqual[x, -8.5e-167], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 490000000.0], t$95$0, N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{-63}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{-131}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 490000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -4.2e-63Initial program 58.7%
times-frac83.0%
associate-+r+83.0%
associate-*l/83.0%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 64.6%
*-commutative64.6%
distribute-lft-in64.6%
*-rgt-identity64.6%
Simplified64.6%
if -4.2e-63 < x < -7.1999999999999999e-131 or -8.4999999999999994e-167 < x < 4.9e8Initial program 75.1%
times-frac84.8%
/-rgt-identity84.8%
associate-/l/84.8%
*-lft-identity84.8%
associate-+l+84.8%
Simplified84.8%
Taylor expanded in x around 0 82.8%
+-commutative82.8%
Simplified82.8%
if -7.1999999999999999e-131 < x < -8.4999999999999994e-167Initial program 64.2%
times-frac83.4%
/-rgt-identity83.4%
associate-/l/83.4%
*-lft-identity83.4%
associate-+l+83.4%
Simplified83.4%
Taylor expanded in y around 0 45.4%
if 4.9e8 < x Initial program 66.9%
associate-*r/82.1%
*-commutative82.1%
distribute-rgt1-in73.2%
fma-def82.1%
cube-unmult82.1%
Simplified82.1%
Taylor expanded in y around inf 22.7%
unpow222.7%
Simplified22.7%
associate-/r*29.3%
div-inv29.3%
Applied egg-rr29.3%
Final simplification64.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y (+ y 1.0)))))
(if (<= x -1.15e-62)
(/ y (+ x (* x x)))
(if (<= x -6.8e-131)
t_0
(if (<= x -8.5e-167)
(/ y (* x (+ x 1.0)))
(if (<= x 4e-16) t_0 (/ (/ x y) (+ x y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y * (y + 1.0));
double tmp;
if (x <= -1.15e-62) {
tmp = y / (x + (x * x));
} else if (x <= -6.8e-131) {
tmp = t_0;
} else if (x <= -8.5e-167) {
tmp = y / (x * (x + 1.0));
} else if (x <= 4e-16) {
tmp = t_0;
} else {
tmp = (x / y) / (x + y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y * (y + 1.0d0))
if (x <= (-1.15d-62)) then
tmp = y / (x + (x * x))
else if (x <= (-6.8d-131)) then
tmp = t_0
else if (x <= (-8.5d-167)) then
tmp = y / (x * (x + 1.0d0))
else if (x <= 4d-16) then
tmp = t_0
else
tmp = (x / y) / (x + y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y * (y + 1.0));
double tmp;
if (x <= -1.15e-62) {
tmp = y / (x + (x * x));
} else if (x <= -6.8e-131) {
tmp = t_0;
} else if (x <= -8.5e-167) {
tmp = y / (x * (x + 1.0));
} else if (x <= 4e-16) {
tmp = t_0;
} else {
tmp = (x / y) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y * (y + 1.0)) tmp = 0 if x <= -1.15e-62: tmp = y / (x + (x * x)) elif x <= -6.8e-131: tmp = t_0 elif x <= -8.5e-167: tmp = y / (x * (x + 1.0)) elif x <= 4e-16: tmp = t_0 else: tmp = (x / y) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y * Float64(y + 1.0))) tmp = 0.0 if (x <= -1.15e-62) tmp = Float64(y / Float64(x + Float64(x * x))); elseif (x <= -6.8e-131) tmp = t_0; elseif (x <= -8.5e-167) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (x <= 4e-16) tmp = t_0; else tmp = Float64(Float64(x / y) / Float64(x + y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y * (y + 1.0));
tmp = 0.0;
if (x <= -1.15e-62)
tmp = y / (x + (x * x));
elseif (x <= -6.8e-131)
tmp = t_0;
elseif (x <= -8.5e-167)
tmp = y / (x * (x + 1.0));
elseif (x <= 4e-16)
tmp = t_0;
else
tmp = (x / y) / (x + y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e-62], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.8e-131], t$95$0, If[LessEqual[x, -8.5e-167], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4e-16], t$95$0, N[(N[(x / y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{-62}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-131}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-16}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{x + y}\\
\end{array}
\end{array}
if x < -1.15e-62Initial program 58.7%
times-frac83.0%
associate-+r+83.0%
associate-*l/83.0%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 64.6%
*-commutative64.6%
distribute-lft-in64.6%
*-rgt-identity64.6%
Simplified64.6%
if -1.15e-62 < x < -6.7999999999999999e-131 or -8.4999999999999994e-167 < x < 3.9999999999999999e-16Initial program 74.0%
times-frac84.2%
/-rgt-identity84.2%
associate-/l/84.2%
*-lft-identity84.2%
associate-+l+84.2%
Simplified84.2%
Taylor expanded in x around 0 82.9%
+-commutative82.9%
Simplified82.9%
if -6.7999999999999999e-131 < x < -8.4999999999999994e-167Initial program 64.2%
times-frac83.4%
/-rgt-identity83.4%
associate-/l/83.4%
*-lft-identity83.4%
associate-+l+83.4%
Simplified83.4%
Taylor expanded in y around 0 45.4%
if 3.9999999999999999e-16 < x Initial program 69.5%
times-frac89.4%
associate-+r+89.4%
associate-*l/89.5%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
clear-num99.7%
frac-times99.6%
*-un-lft-identity99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 34.0%
Final simplification64.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -4.5e+50)
(/ (/ y x) (+ x y))
(if (<= x -8.5e-167)
(/ y (+ x (* x x)))
(if (<= x 2.6e+14) (/ x (* y (+ y 1.0))) (* (/ x (+ x y)) (/ 1.0 y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.5e+50) {
tmp = (y / x) / (x + y);
} else if (x <= -8.5e-167) {
tmp = y / (x + (x * x));
} else if (x <= 2.6e+14) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / (x + y)) * (1.0 / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.5d+50)) then
tmp = (y / x) / (x + y)
else if (x <= (-8.5d-167)) then
tmp = y / (x + (x * x))
else if (x <= 2.6d+14) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / (x + y)) * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -4.5e+50) {
tmp = (y / x) / (x + y);
} else if (x <= -8.5e-167) {
tmp = y / (x + (x * x));
} else if (x <= 2.6e+14) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / (x + y)) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.5e+50: tmp = (y / x) / (x + y) elif x <= -8.5e-167: tmp = y / (x + (x * x)) elif x <= 2.6e+14: tmp = x / (y * (y + 1.0)) else: tmp = (x / (x + y)) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -4.5e+50) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (x <= -8.5e-167) tmp = Float64(y / Float64(x + Float64(x * x))); elseif (x <= 2.6e+14) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / Float64(x + y)) * Float64(1.0 / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4.5e+50)
tmp = (y / x) / (x + y);
elseif (x <= -8.5e-167)
tmp = y / (x + (x * x));
elseif (x <= 2.6e+14)
tmp = x / (y * (y + 1.0));
else
tmp = (x / (x + y)) * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -4.5e+50], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e+14], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+50}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -4.50000000000000014e50Initial program 50.2%
times-frac79.6%
associate-+r+79.6%
associate-*l/79.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
clear-num99.8%
frac-times98.7%
*-un-lft-identity98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
associate-+l+98.7%
+-commutative98.7%
+-commutative98.7%
Applied egg-rr98.7%
Taylor expanded in x around inf 71.9%
if -4.50000000000000014e50 < x < -8.4999999999999994e-167Initial program 89.8%
times-frac95.5%
associate-+r+95.5%
associate-*l/89.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 43.9%
*-commutative43.9%
distribute-lft-in43.9%
*-rgt-identity43.9%
Simplified43.9%
if -8.4999999999999994e-167 < x < 2.6e14Initial program 72.1%
times-frac82.9%
/-rgt-identity82.9%
associate-/l/82.9%
*-lft-identity82.9%
associate-+l+82.9%
Simplified82.9%
Taylor expanded in x around 0 84.3%
+-commutative84.3%
Simplified84.3%
if 2.6e14 < x Initial program 66.9%
times-frac88.5%
associate-+r+88.5%
associate-*l/88.6%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 30.0%
Final simplification63.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ y (+ x 1.0)) (+ x y))))
(if (<= x -4.4e-16)
t_0
(if (<= x -6.8e-131)
(/ x (+ y (* y y)))
(if (<= x -8.5e-167) t_0 (/ (/ x (+ y 1.0)) (+ x y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / (x + 1.0)) / (x + y);
double tmp;
if (x <= -4.4e-16) {
tmp = t_0;
} else if (x <= -6.8e-131) {
tmp = x / (y + (y * y));
} else if (x <= -8.5e-167) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (y / (x + 1.0d0)) / (x + y)
if (x <= (-4.4d-16)) then
tmp = t_0
else if (x <= (-6.8d-131)) then
tmp = x / (y + (y * y))
else if (x <= (-8.5d-167)) then
tmp = t_0
else
tmp = (x / (y + 1.0d0)) / (x + y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (y / (x + 1.0)) / (x + y);
double tmp;
if (x <= -4.4e-16) {
tmp = t_0;
} else if (x <= -6.8e-131) {
tmp = x / (y + (y * y));
} else if (x <= -8.5e-167) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / (x + 1.0)) / (x + y) tmp = 0 if x <= -4.4e-16: tmp = t_0 elif x <= -6.8e-131: tmp = x / (y + (y * y)) elif x <= -8.5e-167: tmp = t_0 else: tmp = (x / (y + 1.0)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)) tmp = 0.0 if (x <= -4.4e-16) tmp = t_0; elseif (x <= -6.8e-131) tmp = Float64(x / Float64(y + Float64(y * y))); elseif (x <= -8.5e-167) tmp = t_0; else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(x + y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (y / (x + 1.0)) / (x + y);
tmp = 0.0;
if (x <= -4.4e-16)
tmp = t_0;
elseif (x <= -6.8e-131)
tmp = x / (y + (y * y));
elseif (x <= -8.5e-167)
tmp = t_0;
else
tmp = (x / (y + 1.0)) / (x + y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e-16], t$95$0, If[LessEqual[x, -6.8e-131], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], t$95$0, N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{-16}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-131}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -4.40000000000000001e-16 or -6.7999999999999999e-131 < x < -8.4999999999999994e-167Initial program 56.0%
times-frac81.7%
associate-+r+81.7%
associate-*l/79.3%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.8%
clear-num99.8%
frac-times98.2%
*-un-lft-identity98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
+-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in y around 0 69.6%
if -4.40000000000000001e-16 < x < -6.7999999999999999e-131Initial program 98.3%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 65.7%
distribute-rgt-in65.7%
*-lft-identity65.7%
Simplified65.7%
if -8.4999999999999994e-167 < x Initial program 70.3%
times-frac84.8%
associate-+r+84.8%
associate-*l/77.9%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
clear-num99.7%
frac-times99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 65.5%
+-commutative65.5%
Simplified65.5%
Final simplification66.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.6e-62)
(* (/ y (+ x (+ y 1.0))) (/ 1.0 x))
(if (<= x -7e-131)
(/ x (* y (+ y 1.0)))
(if (<= x -8.5e-167)
(/ (/ y (+ x 1.0)) (+ x y))
(/ (/ x (+ y 1.0)) (+ x y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.6e-62) {
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
} else if (x <= -7e-131) {
tmp = x / (y * (y + 1.0));
} else if (x <= -8.5e-167) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.6d-62)) then
tmp = (y / (x + (y + 1.0d0))) * (1.0d0 / x)
else if (x <= (-7d-131)) then
tmp = x / (y * (y + 1.0d0))
else if (x <= (-8.5d-167)) then
tmp = (y / (x + 1.0d0)) / (x + y)
else
tmp = (x / (y + 1.0d0)) / (x + y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.6e-62) {
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
} else if (x <= -7e-131) {
tmp = x / (y * (y + 1.0));
} else if (x <= -8.5e-167) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.6e-62: tmp = (y / (x + (y + 1.0))) * (1.0 / x) elif x <= -7e-131: tmp = x / (y * (y + 1.0)) elif x <= -8.5e-167: tmp = (y / (x + 1.0)) / (x + y) else: tmp = (x / (y + 1.0)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.6e-62) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(1.0 / x)); elseif (x <= -7e-131) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (x <= -8.5e-167) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(x + y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.6e-62)
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
elseif (x <= -7e-131)
tmp = x / (y * (y + 1.0));
elseif (x <= -8.5e-167)
tmp = (y / (x + 1.0)) / (x + y);
else
tmp = (x / (y + 1.0)) / (x + y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.6e-62], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7e-131], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{-62}:\\
\;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-131}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -1.60000000000000011e-62Initial program 58.7%
times-frac83.0%
/-rgt-identity83.0%
associate-/l/83.0%
*-lft-identity83.0%
associate-+l+83.0%
Simplified83.0%
Taylor expanded in x around inf 70.7%
if -1.60000000000000011e-62 < x < -7.0000000000000004e-131Initial program 97.8%
times-frac99.6%
/-rgt-identity99.6%
associate-/l/99.6%
*-lft-identity99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 71.0%
+-commutative71.0%
Simplified71.0%
if -7.0000000000000004e-131 < x < -8.4999999999999994e-167Initial program 64.2%
times-frac83.4%
associate-+r+83.4%
associate-*l/64.2%
times-frac100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
Applied egg-rr100.0%
associate-*r/100.0%
clear-num100.0%
frac-times94.6%
*-un-lft-identity94.6%
+-commutative94.6%
+-commutative94.6%
+-commutative94.6%
associate-+l+94.6%
+-commutative94.6%
+-commutative94.6%
Applied egg-rr94.6%
Taylor expanded in y around 0 46.2%
if -8.4999999999999994e-167 < x Initial program 70.3%
times-frac84.8%
associate-+r+84.8%
associate-*l/77.9%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
clear-num99.7%
frac-times99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 65.5%
+-commutative65.5%
Simplified65.5%
Final simplification66.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.0)
(/ y (* x x))
(if (<= x -4.8e-167)
(- (/ y x) y)
(if (<= x 4.1e-110) (/ x y) (* (/ 1.0 y) (/ x y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -4.8e-167) {
tmp = (y / x) - y;
} else if (x <= 4.1e-110) {
tmp = x / y;
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-4.8d-167)) then
tmp = (y / x) - y
else if (x <= 4.1d-110) then
tmp = x / y
else
tmp = (1.0d0 / y) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -4.8e-167) {
tmp = (y / x) - y;
} else if (x <= 4.1e-110) {
tmp = x / y;
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -4.8e-167: tmp = (y / x) - y elif x <= 4.1e-110: tmp = x / y else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -4.8e-167) tmp = Float64(Float64(y / x) - y); elseif (x <= 4.1e-110) tmp = Float64(x / y); else tmp = Float64(Float64(1.0 / y) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.0)
tmp = y / (x * x);
elseif (x <= -4.8e-167)
tmp = (y / x) - y;
elseif (x <= 4.1e-110)
tmp = x / y;
else
tmp = (1.0 / y) * (x / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.8e-167], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 4.1e-110], N[(x / y), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-110}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -1Initial program 54.9%
associate-*r/69.3%
*-commutative69.3%
distribute-rgt1-in27.4%
fma-def69.3%
cube-unmult69.3%
Simplified69.3%
Taylor expanded in x around inf 64.4%
unpow264.4%
Simplified64.4%
if -1 < x < -4.79999999999999986e-167Initial program 87.7%
Taylor expanded in y around 0 23.8%
*-commutative23.8%
unpow223.8%
+-commutative23.8%
Simplified23.8%
Taylor expanded in x around 0 35.7%
neg-mul-135.7%
unsub-neg35.7%
Simplified35.7%
if -4.79999999999999986e-167 < x < 4.09999999999999983e-110Initial program 67.2%
times-frac79.2%
/-rgt-identity79.2%
associate-/l/79.2%
*-lft-identity79.2%
associate-+l+79.2%
Simplified79.2%
Taylor expanded in x around 0 88.7%
+-commutative88.7%
Simplified88.7%
Taylor expanded in y around 0 71.3%
if 4.09999999999999983e-110 < x Initial program 73.8%
associate-*r/86.5%
*-commutative86.5%
distribute-rgt1-in74.6%
fma-def86.5%
cube-unmult86.6%
Simplified86.6%
Taylor expanded in y around inf 30.6%
unpow230.6%
Simplified30.6%
associate-/r*35.6%
div-inv35.5%
Applied egg-rr35.5%
Final simplification54.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -4.5e+50)
(/ (/ y x) (+ x y))
(if (<= x -8.5e-167)
(/ y (+ x (* x x)))
(if (<= x 3.9e-16) (/ x (* y (+ y 1.0))) (/ (/ x y) (+ x y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.5e+50) {
tmp = (y / x) / (x + y);
} else if (x <= -8.5e-167) {
tmp = y / (x + (x * x));
} else if (x <= 3.9e-16) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (x + y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.5d+50)) then
tmp = (y / x) / (x + y)
else if (x <= (-8.5d-167)) then
tmp = y / (x + (x * x))
else if (x <= 3.9d-16) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / (x + y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -4.5e+50) {
tmp = (y / x) / (x + y);
} else if (x <= -8.5e-167) {
tmp = y / (x + (x * x));
} else if (x <= 3.9e-16) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.5e+50: tmp = (y / x) / (x + y) elif x <= -8.5e-167: tmp = y / (x + (x * x)) elif x <= 3.9e-16: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -4.5e+50) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (x <= -8.5e-167) tmp = Float64(y / Float64(x + Float64(x * x))); elseif (x <= 3.9e-16) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / Float64(x + y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4.5e+50)
tmp = (y / x) / (x + y);
elseif (x <= -8.5e-167)
tmp = y / (x + (x * x));
elseif (x <= 3.9e-16)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) / (x + y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -4.5e+50], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.9e-16], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+50}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{x + y}\\
\end{array}
\end{array}
if x < -4.50000000000000014e50Initial program 50.2%
times-frac79.6%
associate-+r+79.6%
associate-*l/79.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
clear-num99.8%
frac-times98.7%
*-un-lft-identity98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
associate-+l+98.7%
+-commutative98.7%
+-commutative98.7%
Applied egg-rr98.7%
Taylor expanded in x around inf 71.9%
if -4.50000000000000014e50 < x < -8.4999999999999994e-167Initial program 89.8%
times-frac95.5%
associate-+r+95.5%
associate-*l/89.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 43.9%
*-commutative43.9%
distribute-lft-in43.9%
*-rgt-identity43.9%
Simplified43.9%
if -8.4999999999999994e-167 < x < 3.89999999999999977e-16Initial program 70.7%
times-frac82.0%
/-rgt-identity82.0%
associate-/l/82.0%
*-lft-identity82.0%
associate-+l+82.0%
Simplified82.0%
Taylor expanded in x around 0 84.5%
+-commutative84.5%
Simplified84.5%
if 3.89999999999999977e-16 < x Initial program 69.5%
times-frac89.4%
associate-+r+89.4%
associate-*l/89.5%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
clear-num99.7%
frac-times99.6%
*-un-lft-identity99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 34.0%
Final simplification63.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -4.8e+50) (/ (/ y x) (+ x y)) (if (<= x -8.5e-167) (/ y (+ x (* x x))) (/ (* x (/ 1.0 y)) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.8e+50) {
tmp = (y / x) / (x + y);
} else if (x <= -8.5e-167) {
tmp = y / (x + (x * x));
} else {
tmp = (x * (1.0 / y)) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.8d+50)) then
tmp = (y / x) / (x + y)
else if (x <= (-8.5d-167)) then
tmp = y / (x + (x * x))
else
tmp = (x * (1.0d0 / y)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -4.8e+50) {
tmp = (y / x) / (x + y);
} else if (x <= -8.5e-167) {
tmp = y / (x + (x * x));
} else {
tmp = (x * (1.0 / y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.8e+50: tmp = (y / x) / (x + y) elif x <= -8.5e-167: tmp = y / (x + (x * x)) else: tmp = (x * (1.0 / y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -4.8e+50) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (x <= -8.5e-167) tmp = Float64(y / Float64(x + Float64(x * x))); else tmp = Float64(Float64(x * Float64(1.0 / y)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4.8e+50)
tmp = (y / x) / (x + y);
elseif (x <= -8.5e-167)
tmp = y / (x + (x * x));
else
tmp = (x * (1.0 / y)) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -4.8e+50], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(1.0 / y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+50}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{1}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -4.8000000000000004e50Initial program 50.2%
times-frac79.6%
associate-+r+79.6%
associate-*l/79.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
clear-num99.8%
frac-times98.7%
*-un-lft-identity98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
associate-+l+98.7%
+-commutative98.7%
+-commutative98.7%
Applied egg-rr98.7%
Taylor expanded in x around inf 71.9%
if -4.8000000000000004e50 < x < -8.4999999999999994e-167Initial program 89.8%
times-frac95.5%
associate-+r+95.5%
associate-*l/89.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 43.9%
*-commutative43.9%
distribute-lft-in43.9%
*-rgt-identity43.9%
Simplified43.9%
if -8.4999999999999994e-167 < x Initial program 70.3%
times-frac84.8%
/-rgt-identity84.8%
associate-/l/84.8%
*-lft-identity84.8%
associate-+l+84.8%
Simplified84.8%
Taylor expanded in x around 0 62.8%
+-commutative62.8%
Simplified62.8%
*-un-lft-identity62.8%
times-frac65.1%
Applied egg-rr65.1%
associate-*r/65.1%
Simplified65.1%
Final simplification63.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -4.5e+50) (/ (/ y x) (+ x y)) (if (<= x -8.5e-167) (/ y (+ x (* x x))) (/ (/ x (+ y 1.0)) (+ x y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.5e+50) {
tmp = (y / x) / (x + y);
} else if (x <= -8.5e-167) {
tmp = y / (x + (x * x));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.5d+50)) then
tmp = (y / x) / (x + y)
else if (x <= (-8.5d-167)) then
tmp = y / (x + (x * x))
else
tmp = (x / (y + 1.0d0)) / (x + y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -4.5e+50) {
tmp = (y / x) / (x + y);
} else if (x <= -8.5e-167) {
tmp = y / (x + (x * x));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.5e+50: tmp = (y / x) / (x + y) elif x <= -8.5e-167: tmp = y / (x + (x * x)) else: tmp = (x / (y + 1.0)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -4.5e+50) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (x <= -8.5e-167) tmp = Float64(y / Float64(x + Float64(x * x))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(x + y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4.5e+50)
tmp = (y / x) / (x + y);
elseif (x <= -8.5e-167)
tmp = y / (x + (x * x));
else
tmp = (x / (y + 1.0)) / (x + y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -4.5e+50], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+50}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -4.50000000000000014e50Initial program 50.2%
times-frac79.6%
associate-+r+79.6%
associate-*l/79.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
clear-num99.8%
frac-times98.7%
*-un-lft-identity98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
associate-+l+98.7%
+-commutative98.7%
+-commutative98.7%
Applied egg-rr98.7%
Taylor expanded in x around inf 71.9%
if -4.50000000000000014e50 < x < -8.4999999999999994e-167Initial program 89.8%
times-frac95.5%
associate-+r+95.5%
associate-*l/89.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 43.9%
*-commutative43.9%
distribute-lft-in43.9%
*-rgt-identity43.9%
Simplified43.9%
if -8.4999999999999994e-167 < x Initial program 70.3%
times-frac84.8%
associate-+r+84.8%
associate-*l/77.9%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
clear-num99.7%
frac-times99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 65.5%
+-commutative65.5%
Simplified65.5%
Final simplification64.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.0) (/ y (* x x)) (if (<= x -8e-167) (- (/ y x) y) (if (<= x 8e-111) (/ x y) (/ x (* y y))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -8e-167) {
tmp = (y / x) - y;
} else if (x <= 8e-111) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-8d-167)) then
tmp = (y / x) - y
else if (x <= 8d-111) then
tmp = x / y
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -8e-167) {
tmp = (y / x) - y;
} else if (x <= 8e-111) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -8e-167: tmp = (y / x) - y elif x <= 8e-111: tmp = x / y else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -8e-167) tmp = Float64(Float64(y / x) - y); elseif (x <= 8e-111) tmp = Float64(x / y); else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.0)
tmp = y / (x * x);
elseif (x <= -8e-167)
tmp = (y / x) - y;
elseif (x <= 8e-111)
tmp = x / y;
else
tmp = x / (y * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-167], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 8e-111], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-111}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if x < -1Initial program 54.9%
associate-*r/69.3%
*-commutative69.3%
distribute-rgt1-in27.4%
fma-def69.3%
cube-unmult69.3%
Simplified69.3%
Taylor expanded in x around inf 64.4%
unpow264.4%
Simplified64.4%
if -1 < x < -8.00000000000000002e-167Initial program 87.7%
Taylor expanded in y around 0 23.8%
*-commutative23.8%
unpow223.8%
+-commutative23.8%
Simplified23.8%
Taylor expanded in x around 0 35.7%
neg-mul-135.7%
unsub-neg35.7%
Simplified35.7%
if -8.00000000000000002e-167 < x < 8.00000000000000071e-111Initial program 67.2%
times-frac79.2%
/-rgt-identity79.2%
associate-/l/79.2%
*-lft-identity79.2%
associate-+l+79.2%
Simplified79.2%
Taylor expanded in x around 0 88.7%
+-commutative88.7%
Simplified88.7%
Taylor expanded in y around 0 71.3%
if 8.00000000000000071e-111 < x Initial program 73.8%
associate-*r/86.5%
*-commutative86.5%
distribute-rgt1-in74.6%
fma-def86.5%
cube-unmult86.6%
Simplified86.6%
Taylor expanded in y around inf 30.6%
unpow230.6%
Simplified30.6%
Final simplification53.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.0)
(/ y (* x x))
(if (<= x -8.5e-167)
(- (/ y x) y)
(if (<= x 1.55e-197) (/ x y) (/ (/ x y) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -8.5e-167) {
tmp = (y / x) - y;
} else if (x <= 1.55e-197) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-8.5d-167)) then
tmp = (y / x) - y
else if (x <= 1.55d-197) then
tmp = x / y
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -8.5e-167) {
tmp = (y / x) - y;
} else if (x <= 1.55e-197) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -8.5e-167: tmp = (y / x) - y elif x <= 1.55e-197: tmp = x / y else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -8.5e-167) tmp = Float64(Float64(y / x) - y); elseif (x <= 1.55e-197) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.0)
tmp = y / (x * x);
elseif (x <= -8.5e-167)
tmp = (y / x) - y;
elseif (x <= 1.55e-197)
tmp = x / y;
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 1.55e-197], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-197}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1Initial program 54.9%
associate-*r/69.3%
*-commutative69.3%
distribute-rgt1-in27.4%
fma-def69.3%
cube-unmult69.3%
Simplified69.3%
Taylor expanded in x around inf 64.4%
unpow264.4%
Simplified64.4%
if -1 < x < -8.4999999999999994e-167Initial program 87.7%
Taylor expanded in y around 0 23.8%
*-commutative23.8%
unpow223.8%
+-commutative23.8%
Simplified23.8%
Taylor expanded in x around 0 35.7%
neg-mul-135.7%
unsub-neg35.7%
Simplified35.7%
if -8.4999999999999994e-167 < x < 1.55000000000000014e-197Initial program 64.5%
times-frac77.5%
/-rgt-identity77.5%
associate-/l/77.5%
*-lft-identity77.5%
associate-+l+77.5%
Simplified77.5%
Taylor expanded in x around 0 89.0%
+-commutative89.0%
Simplified89.0%
Taylor expanded in y around 0 75.7%
if 1.55000000000000014e-197 < x Initial program 74.9%
associate-*r/86.6%
*-commutative86.6%
distribute-rgt1-in75.5%
fma-def86.6%
cube-unmult86.6%
Simplified86.6%
Taylor expanded in y around inf 34.7%
unpow234.7%
Simplified34.7%
associate-/r*38.8%
div-inv38.8%
Applied egg-rr38.8%
associate-*r/38.8%
*-rgt-identity38.8%
Simplified38.8%
Final simplification55.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -430.0) (/ y (* x x)) (if (<= x 8e+22) (/ x (* y (+ y 1.0))) (* (/ 1.0 y) (/ x y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -430.0) {
tmp = y / (x * x);
} else if (x <= 8e+22) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-430.0d0)) then
tmp = y / (x * x)
else if (x <= 8d+22) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (1.0d0 / y) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -430.0) {
tmp = y / (x * x);
} else if (x <= 8e+22) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -430.0: tmp = y / (x * x) elif x <= 8e+22: tmp = x / (y * (y + 1.0)) else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -430.0) tmp = Float64(y / Float64(x * x)); elseif (x <= 8e+22) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(1.0 / y) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -430.0)
tmp = y / (x * x);
elseif (x <= 8e+22)
tmp = x / (y * (y + 1.0));
else
tmp = (1.0 / y) * (x / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -430.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e+22], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -430:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -430Initial program 54.9%
associate-*r/69.3%
*-commutative69.3%
distribute-rgt1-in27.4%
fma-def69.3%
cube-unmult69.3%
Simplified69.3%
Taylor expanded in x around inf 64.4%
unpow264.4%
Simplified64.4%
if -430 < x < 8e22Initial program 75.9%
times-frac85.7%
/-rgt-identity85.7%
associate-/l/85.7%
*-lft-identity85.7%
associate-+l+85.7%
Simplified85.7%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
Simplified78.9%
if 8e22 < x Initial program 65.1%
associate-*r/81.1%
*-commutative81.1%
distribute-rgt1-in71.8%
fma-def81.1%
cube-unmult81.2%
Simplified81.2%
Taylor expanded in y around inf 22.0%
unpow222.0%
Simplified22.0%
associate-/r*29.0%
div-inv29.0%
Applied egg-rr29.0%
Final simplification64.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.1e-236) (- (/ y x) y) (if (<= y 0.75) (- (/ x y) x) (/ x (* y y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.1e-236) {
tmp = (y / x) - y;
} else if (y <= 0.75) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.1d-236) then
tmp = (y / x) - y
else if (y <= 0.75d0) then
tmp = (x / y) - x
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 3.1e-236) {
tmp = (y / x) - y;
} else if (y <= 0.75) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.1e-236: tmp = (y / x) - y elif y <= 0.75: tmp = (x / y) - x else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.1e-236) tmp = Float64(Float64(y / x) - y); elseif (y <= 0.75) tmp = Float64(Float64(x / y) - x); else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 3.1e-236)
tmp = (y / x) - y;
elseif (y <= 0.75)
tmp = (x / y) - x;
else
tmp = x / (y * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 3.1e-236], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[y, 0.75], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{-236}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 3.0999999999999998e-236Initial program 61.9%
Taylor expanded in y around 0 29.0%
*-commutative29.0%
unpow229.0%
+-commutative29.0%
Simplified29.0%
Taylor expanded in x around 0 14.2%
neg-mul-114.2%
unsub-neg14.2%
Simplified14.2%
if 3.0999999999999998e-236 < y < 0.75Initial program 89.0%
times-frac94.1%
/-rgt-identity94.1%
associate-/l/94.1%
*-lft-identity94.1%
associate-+l+94.1%
Simplified94.1%
Taylor expanded in x around 0 34.4%
+-commutative34.4%
Simplified34.4%
Taylor expanded in y around 0 34.4%
neg-mul-134.4%
unsub-neg34.4%
Simplified34.4%
if 0.75 < y Initial program 65.0%
associate-*r/81.7%
*-commutative81.7%
distribute-rgt1-in72.1%
fma-def81.7%
cube-unmult81.6%
Simplified81.6%
Taylor expanded in y around inf 67.9%
unpow267.9%
Simplified67.9%
Final simplification32.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.1e-236) (- (/ y x) y) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.1e-236) {
tmp = (y / x) - y;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.1d-236) then
tmp = (y / x) - y
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 3.1e-236) {
tmp = (y / x) - y;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.1e-236: tmp = (y / x) - y else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.1e-236) tmp = Float64(Float64(y / x) - y); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 3.1e-236)
tmp = (y / x) - y;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 3.1e-236], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{-236}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 3.0999999999999998e-236Initial program 61.9%
Taylor expanded in y around 0 29.0%
*-commutative29.0%
unpow229.0%
+-commutative29.0%
Simplified29.0%
Taylor expanded in x around 0 14.2%
neg-mul-114.2%
unsub-neg14.2%
Simplified14.2%
if 3.0999999999999998e-236 < y Initial program 75.9%
times-frac89.7%
/-rgt-identity89.7%
associate-/l/89.7%
*-lft-identity89.7%
associate-+l+89.7%
Simplified89.7%
Taylor expanded in x around 0 53.3%
+-commutative53.3%
Simplified53.3%
Taylor expanded in y around 0 32.0%
Final simplification22.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -8e-11) (/ 1.0 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -8e-11) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-8d-11)) then
tmp = 1.0d0 / x
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -8e-11) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -8e-11: tmp = 1.0 / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -8e-11) tmp = Float64(1.0 / x); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -8e-11)
tmp = 1.0 / x;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -8e-11], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-11}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -7.99999999999999952e-11Initial program 54.9%
times-frac81.5%
/-rgt-identity81.5%
associate-/l/81.5%
*-lft-identity81.5%
associate-+l+81.5%
Simplified81.5%
Taylor expanded in y around inf 54.5%
Taylor expanded in x around inf 6.1%
if -7.99999999999999952e-11 < x Initial program 72.9%
times-frac86.3%
/-rgt-identity86.3%
associate-/l/86.3%
*-lft-identity86.3%
associate-+l+86.3%
Simplified86.3%
Taylor expanded in x around 0 62.9%
+-commutative62.9%
Simplified62.9%
Taylor expanded in y around 0 41.3%
Final simplification32.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ x y))
assert(x < y);
double code(double x, double y) {
return x / y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / y
end function
assert x < y;
public static double code(double x, double y) {
return x / y;
}
[x, y] = sort([x, y]) def code(x, y): return x / y
x, y = sort([x, y]) function code(x, y) return Float64(x / y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = x / y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{y}
\end{array}
Initial program 68.4%
times-frac85.1%
/-rgt-identity85.1%
associate-/l/85.1%
*-lft-identity85.1%
associate-+l+85.1%
Simplified85.1%
Taylor expanded in x around 0 53.0%
+-commutative53.0%
Simplified53.0%
Taylor expanded in y around 0 31.6%
Final simplification31.6%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2023199
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))