
(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 19 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 (+ x (+ y 1.0))) (+ x y))))
assert(x < y);
double code(double x, double y) {
return (x / (x + y)) * ((y / (x + (y + 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 / (x + (y + 1.0d0))) / (x + y))
end function
assert x < y;
public static double code(double x, double y) {
return (x / (x + y)) * ((y / (x + (y + 1.0))) / (x + y));
}
[x, y] = sort([x, y]) def code(x, y): return (x / (x + y)) * ((y / (x + (y + 1.0))) / (x + y))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(x / Float64(x + y)) * Float64(Float64(y / Float64(x + Float64(y + 1.0))) / Float64(x + y))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (x / (x + y)) * ((y / (x + (y + 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[(x + N[(y + 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}{x + \left(y + 1\right)}}{x + y}
\end{array}
Initial program 67.0%
times-frac87.9%
associate-+r+87.9%
associate-*l/81.9%
times-frac99.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
(let* ((t_0 (/ y (+ x (+ y 1.0)))))
(if (<= x -1.35e+154)
(/ t_0 (+ x y))
(if (<= x -4e-16)
(* t_0 (/ x (* (+ x y) (+ x y))))
(* (/ x (+ x y)) (/ (/ y (+ y 1.0)) (+ x y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x + (y + 1.0));
double tmp;
if (x <= -1.35e+154) {
tmp = t_0 / (x + y);
} else if (x <= -4e-16) {
tmp = t_0 * (x / ((x + y) * (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) :: t_0
real(8) :: tmp
t_0 = y / (x + (y + 1.0d0))
if (x <= (-1.35d+154)) then
tmp = t_0 / (x + y)
else if (x <= (-4d-16)) then
tmp = t_0 * (x / ((x + y) * (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 t_0 = y / (x + (y + 1.0));
double tmp;
if (x <= -1.35e+154) {
tmp = t_0 / (x + y);
} else if (x <= -4e-16) {
tmp = t_0 * (x / ((x + y) * (x + y)));
} else {
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x + (y + 1.0)) tmp = 0 if x <= -1.35e+154: tmp = t_0 / (x + y) elif x <= -4e-16: tmp = t_0 * (x / ((x + y) * (x + y))) else: tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x + Float64(y + 1.0))) tmp = 0.0 if (x <= -1.35e+154) tmp = Float64(t_0 / Float64(x + y)); elseif (x <= -4e-16) tmp = Float64(t_0 * Float64(x / Float64(Float64(x + y) * 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)
t_0 = y / (x + (y + 1.0));
tmp = 0.0;
if (x <= -1.35e+154)
tmp = t_0 / (x + y);
elseif (x <= -4e-16)
tmp = t_0 * (x / ((x + y) * (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_] := Block[{t$95$0 = N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+154], N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4e-16], N[(t$95$0 * N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $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}
t_0 := \frac{y}{x + \left(y + 1\right)}\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{t_0}{x + y}\\
\mathbf{elif}\;x \leq -4 \cdot 10^{-16}:\\
\;\;\;\;t_0 \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{\frac{y}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -1.35000000000000003e154Initial program 50.2%
times-frac75.3%
associate-+r+75.3%
associate-*l/75.3%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 82.2%
if -1.35000000000000003e154 < x < -3.9999999999999999e-16Initial program 70.6%
times-frac91.6%
/-rgt-identity91.6%
associate-/l/91.6%
*-lft-identity91.6%
associate-+l+91.6%
Simplified91.6%
if -3.9999999999999999e-16 < x Initial program 68.8%
times-frac89.1%
associate-+r+89.1%
associate-*l/80.5%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 83.8%
+-commutative83.8%
Simplified83.8%
Final simplification85.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.36e+141)
(/ (/ y (+ x (+ y 1.0))) (+ x y))
(if (<= x -1.3e-145)
(* (/ x (* (+ x y) (+ x y))) (/ y (+ x 1.0)))
(/ (/ x (+ y 1.0)) (+ x y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.36e+141) {
tmp = (y / (x + (y + 1.0))) / (x + y);
} else if (x <= -1.3e-145) {
tmp = (x / ((x + y) * (x + y))) * (y / (x + 1.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) :: tmp
if (x <= (-1.36d+141)) then
tmp = (y / (x + (y + 1.0d0))) / (x + y)
else if (x <= (-1.3d-145)) then
tmp = (x / ((x + y) * (x + y))) * (y / (x + 1.0d0))
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.36e+141) {
tmp = (y / (x + (y + 1.0))) / (x + y);
} else if (x <= -1.3e-145) {
tmp = (x / ((x + y) * (x + y))) * (y / (x + 1.0));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.36e+141: tmp = (y / (x + (y + 1.0))) / (x + y) elif x <= -1.3e-145: tmp = (x / ((x + y) * (x + y))) * (y / (x + 1.0)) 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.36e+141) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) / Float64(x + y)); elseif (x <= -1.3e-145) tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / Float64(x + 1.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)
tmp = 0.0;
if (x <= -1.36e+141)
tmp = (y / (x + (y + 1.0))) / (x + y);
elseif (x <= -1.3e-145)
tmp = (x / ((x + y) * (x + y))) * (y / (x + 1.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_] := If[LessEqual[x, -1.36e+141], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.3e-145], N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + 1.0), $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 -1.36 \cdot 10^{+141}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x + y}\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-145}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -1.36e141Initial program 48.0%
times-frac79.3%
associate-+r+79.3%
associate-*l/79.4%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 83.7%
if -1.36e141 < x < -1.3e-145Initial program 77.5%
times-frac94.0%
/-rgt-identity94.0%
associate-/l/94.0%
*-lft-identity94.0%
associate-+l+94.0%
Simplified94.0%
Taylor expanded in y around 0 79.4%
+-commutative79.4%
Simplified79.4%
if -1.3e-145 < x Initial program 67.0%
times-frac87.4%
associate-+r+87.4%
associate-*l/80.5%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 81.2%
+-commutative81.2%
Simplified81.2%
associate-*l/81.2%
associate-/l/81.5%
+-commutative81.5%
+-commutative81.5%
+-commutative81.5%
Applied egg-rr81.5%
Taylor expanded in x around 0 62.2%
+-commutative62.2%
Simplified62.2%
Final simplification69.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.46e+16) (/ (/ y (+ x (+ 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 <= -1.46e+16) {
tmp = (y / (x + (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 <= (-1.46d+16)) then
tmp = (y / (x + (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 <= -1.46e+16) {
tmp = (y / (x + (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 <= -1.46e+16: tmp = (y / (x + (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 <= -1.46e+16) tmp = Float64(Float64(y / Float64(x + 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 <= -1.46e+16)
tmp = (y / (x + (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, -1.46e+16], N[(N[(y / N[(x + N[(y + 1.0), $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 -1.46 \cdot 10^{+16}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{\frac{y}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -1.46e16Initial program 58.9%
times-frac83.2%
associate-+r+83.2%
associate-*l/83.3%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 75.8%
if -1.46e16 < x Initial program 69.8%
times-frac89.6%
associate-+r+89.6%
associate-*l/81.4%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 84.4%
+-commutative84.4%
Simplified84.4%
Final simplification82.1%
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 -3.4e-108)
(/ y (+ x y))
(if (<= x 2.5e-33) (/ x (* y (+ y 1.0))) (/ (/ 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 <= -3.4e-108) {
tmp = y / (x + y);
} else if (x <= 2.5e-33) {
tmp = x / (y * (y + 1.0));
} 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 <= (-3.4d-108)) then
tmp = y / (x + y)
else if (x <= 2.5d-33) then
tmp = x / (y * (y + 1.0d0))
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 <= -3.4e-108) {
tmp = y / (x + y);
} else if (x <= 2.5e-33) {
tmp = x / (y * (y + 1.0));
} 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 <= -3.4e-108: tmp = y / (x + y) elif x <= 2.5e-33: tmp = x / (y * (y + 1.0)) 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 <= -3.4e-108) tmp = Float64(y / Float64(x + y)); elseif (x <= 2.5e-33) tmp = Float64(x / Float64(y * Float64(y + 1.0))); 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 <= -3.4e-108)
tmp = y / (x + y);
elseif (x <= 2.5e-33)
tmp = x / (y * (y + 1.0));
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, -3.4e-108], N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e-33], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $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 -3.4 \cdot 10^{-108}:\\
\;\;\;\;\frac{y}{x + y}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1Initial program 60.7%
associate-*r/71.5%
*-commutative71.5%
distribute-rgt1-in34.6%
fma-def71.5%
cube-unmult71.5%
Simplified71.5%
Taylor expanded in x around inf 69.2%
unpow269.2%
Simplified69.2%
if -1 < x < -3.40000000000000002e-108Initial program 84.3%
times-frac99.6%
associate-+r+99.6%
associate-*l/88.1%
times-frac99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 98.4%
+-commutative98.4%
Simplified98.4%
associate-*l/98.4%
associate-/l/98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Applied egg-rr98.4%
Taylor expanded in y around 0 52.5%
if -3.40000000000000002e-108 < x < 2.50000000000000014e-33Initial program 72.6%
times-frac88.6%
/-rgt-identity88.6%
associate-/l/88.6%
*-lft-identity88.6%
associate-+l+88.6%
Simplified88.6%
Taylor expanded in x around 0 83.8%
+-commutative83.8%
Simplified83.8%
if 2.50000000000000014e-33 < x Initial program 60.0%
associate-*r/75.1%
*-commutative75.1%
distribute-rgt1-in69.3%
fma-def75.1%
cube-unmult75.1%
Simplified75.1%
Taylor expanded in y around inf 29.7%
unpow229.7%
Simplified29.7%
associate-/r*33.1%
div-inv33.0%
Applied egg-rr33.0%
associate-*r/33.1%
*-rgt-identity33.1%
Simplified33.1%
Final simplification62.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.4e-108) (/ (/ y (+ x (+ y 1.0))) (+ x y)) (/ (/ x (+ y 1.0)) (+ x y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4e-108) {
tmp = (y / (x + (y + 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 <= (-3.4d-108)) then
tmp = (y / (x + (y + 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 <= -3.4e-108) {
tmp = (y / (x + (y + 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 <= -3.4e-108: tmp = (y / (x + (y + 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 <= -3.4e-108) tmp = Float64(Float64(y / Float64(x + Float64(y + 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 <= -3.4e-108)
tmp = (y / (x + (y + 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, -3.4e-108], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $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 -3.4 \cdot 10^{-108}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -3.40000000000000002e-108Initial program 66.9%
times-frac88.1%
associate-+r+88.1%
associate-*l/85.1%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 68.1%
if -3.40000000000000002e-108 < x Initial program 67.0%
times-frac87.8%
associate-+r+87.8%
associate-*l/80.0%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 81.9%
+-commutative81.9%
Simplified81.9%
associate-*l/81.9%
associate-/l/82.2%
+-commutative82.2%
+-commutative82.2%
+-commutative82.2%
Applied egg-rr82.2%
Taylor expanded in x around 0 61.8%
+-commutative61.8%
Simplified61.8%
Final simplification64.2%
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))))
(if (<= y -9e+80)
t_0
(if (<= y 4.4e-119) (/ y x) (if (<= y 200.0) (- (/ x y) x) t_0)))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (y <= -9e+80) {
tmp = t_0;
} else if (y <= 4.4e-119) {
tmp = y / x;
} else if (y <= 200.0) {
tmp = (x / y) - x;
} else {
tmp = t_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 = x / (y * y)
if (y <= (-9d+80)) then
tmp = t_0
else if (y <= 4.4d-119) then
tmp = y / x
else if (y <= 200.0d0) then
tmp = (x / y) - x
else
tmp = t_0
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (y <= -9e+80) {
tmp = t_0;
} else if (y <= 4.4e-119) {
tmp = y / x;
} else if (y <= 200.0) {
tmp = (x / y) - x;
} else {
tmp = t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y * y) tmp = 0 if y <= -9e+80: tmp = t_0 elif y <= 4.4e-119: tmp = y / x elif y <= 200.0: tmp = (x / y) - x else: tmp = t_0 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y * y)) tmp = 0.0 if (y <= -9e+80) tmp = t_0; elseif (y <= 4.4e-119) tmp = Float64(y / x); elseif (y <= 200.0) tmp = Float64(Float64(x / y) - x); else tmp = t_0; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y * y);
tmp = 0.0;
if (y <= -9e+80)
tmp = t_0;
elseif (y <= 4.4e-119)
tmp = y / x;
elseif (y <= 200.0)
tmp = (x / y) - x;
else
tmp = t_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[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e+80], t$95$0, If[LessEqual[y, 4.4e-119], N[(y / x), $MachinePrecision], If[LessEqual[y, 200.0], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot y}\\
\mathbf{if}\;y \leq -9 \cdot 10^{+80}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-119}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 200:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -9.00000000000000013e80 or 200 < y Initial program 51.5%
associate-*r/69.3%
*-commutative69.3%
distribute-rgt1-in47.6%
fma-def69.3%
cube-unmult69.3%
Simplified69.3%
Taylor expanded in y around inf 67.8%
unpow267.8%
Simplified67.8%
if -9.00000000000000013e80 < y < 4.4000000000000001e-119Initial program 78.7%
times-frac91.0%
associate-+r+91.0%
associate-*l/80.3%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 77.4%
+-commutative77.4%
Simplified77.4%
Taylor expanded in y around 0 48.3%
if 4.4000000000000001e-119 < y < 200Initial program 84.0%
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 43.1%
distribute-rgt-in43.1%
*-lft-identity43.1%
Simplified43.1%
Taylor expanded in y around 0 40.9%
neg-mul-140.9%
unsub-neg40.9%
Simplified40.9%
Final simplification56.4%
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 -2.25e-122) (/ y x) (if (<= x 1e-100) (/ 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 <= -2.25e-122) {
tmp = y / x;
} else if (x <= 1e-100) {
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 <= (-2.25d-122)) then
tmp = y / x
else if (x <= 1d-100) 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 <= -2.25e-122) {
tmp = y / x;
} else if (x <= 1e-100) {
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 <= -2.25e-122: tmp = y / x elif x <= 1e-100: 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 <= -2.25e-122) tmp = Float64(y / x); elseif (x <= 1e-100) 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 <= -2.25e-122)
tmp = y / x;
elseif (x <= 1e-100)
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, -2.25e-122], N[(y / x), $MachinePrecision], If[LessEqual[x, 1e-100], 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 -2.25 \cdot 10^{-122}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 10^{-100}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if x < -1Initial program 60.7%
associate-*r/71.5%
*-commutative71.5%
distribute-rgt1-in34.6%
fma-def71.5%
cube-unmult71.5%
Simplified71.5%
Taylor expanded in x around inf 69.2%
unpow269.2%
Simplified69.2%
if -1 < x < -2.2499999999999999e-122Initial program 83.1%
times-frac99.5%
associate-+r+99.5%
associate-*l/86.5%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in y around 0 49.1%
if -2.2499999999999999e-122 < x < 1e-100Initial program 68.7%
times-frac85.4%
/-rgt-identity85.4%
associate-/l/85.4%
*-lft-identity85.4%
associate-+l+85.4%
Simplified85.4%
Taylor expanded in x around 0 84.6%
distribute-rgt-in84.6%
*-lft-identity84.6%
Simplified84.6%
Taylor expanded in y around 0 69.2%
if 1e-100 < x Initial program 65.2%
associate-*r/77.5%
*-commutative77.5%
distribute-rgt1-in68.2%
fma-def77.5%
cube-unmult77.5%
Simplified77.5%
Taylor expanded in y around inf 37.2%
unpow237.2%
Simplified37.2%
Final simplification56.1%
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 -1.86e-121)
(/ y (+ x y))
(if (<= x 9.2e-101) (/ 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 <= -1.86e-121) {
tmp = y / (x + y);
} else if (x <= 9.2e-101) {
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 <= (-1.86d-121)) then
tmp = y / (x + y)
else if (x <= 9.2d-101) 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 <= -1.86e-121) {
tmp = y / (x + y);
} else if (x <= 9.2e-101) {
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 <= -1.86e-121: tmp = y / (x + y) elif x <= 9.2e-101: 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 <= -1.86e-121) tmp = Float64(y / Float64(x + y)); elseif (x <= 9.2e-101) 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 <= -1.86e-121)
tmp = y / (x + y);
elseif (x <= 9.2e-101)
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, -1.86e-121], N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.2e-101], 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 -1.86 \cdot 10^{-121}:\\
\;\;\;\;\frac{y}{x + y}\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if x < -1Initial program 60.7%
associate-*r/71.5%
*-commutative71.5%
distribute-rgt1-in34.6%
fma-def71.5%
cube-unmult71.5%
Simplified71.5%
Taylor expanded in x around inf 69.2%
unpow269.2%
Simplified69.2%
if -1 < x < -1.8599999999999999e-121Initial program 83.1%
times-frac99.5%
associate-+r+99.5%
associate-*l/86.5%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 98.7%
+-commutative98.7%
Simplified98.7%
associate-*l/98.6%
associate-/l/98.6%
+-commutative98.6%
+-commutative98.6%
+-commutative98.6%
Applied egg-rr98.6%
Taylor expanded in y around 0 49.4%
if -1.8599999999999999e-121 < x < 9.1999999999999998e-101Initial program 68.7%
times-frac85.4%
/-rgt-identity85.4%
associate-/l/85.4%
*-lft-identity85.4%
associate-+l+85.4%
Simplified85.4%
Taylor expanded in x around 0 84.6%
distribute-rgt-in84.6%
*-lft-identity84.6%
Simplified84.6%
Taylor expanded in y around 0 69.2%
if 9.1999999999999998e-101 < x Initial program 65.2%
associate-*r/77.5%
*-commutative77.5%
distribute-rgt1-in68.2%
fma-def77.5%
cube-unmult77.5%
Simplified77.5%
Taylor expanded in y around inf 37.2%
unpow237.2%
Simplified37.2%
Final simplification56.1%
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 -1.85e-121)
(/ y (+ x y))
(if (<= x 3.5e-100) (/ 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 <= -1.85e-121) {
tmp = y / (x + y);
} else if (x <= 3.5e-100) {
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 <= (-1.85d-121)) then
tmp = y / (x + y)
else if (x <= 3.5d-100) 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 <= -1.85e-121) {
tmp = y / (x + y);
} else if (x <= 3.5e-100) {
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 <= -1.85e-121: tmp = y / (x + y) elif x <= 3.5e-100: 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 <= -1.85e-121) tmp = Float64(y / Float64(x + y)); elseif (x <= 3.5e-100) 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 <= -1.85e-121)
tmp = y / (x + y);
elseif (x <= 3.5e-100)
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, -1.85e-121], N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e-100], 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 -1.85 \cdot 10^{-121}:\\
\;\;\;\;\frac{y}{x + y}\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-100}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1Initial program 60.7%
associate-*r/71.5%
*-commutative71.5%
distribute-rgt1-in34.6%
fma-def71.5%
cube-unmult71.5%
Simplified71.5%
Taylor expanded in x around inf 69.2%
unpow269.2%
Simplified69.2%
if -1 < x < -1.8500000000000001e-121Initial program 83.1%
times-frac99.5%
associate-+r+99.5%
associate-*l/86.5%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 98.7%
+-commutative98.7%
Simplified98.7%
associate-*l/98.6%
associate-/l/98.6%
+-commutative98.6%
+-commutative98.6%
+-commutative98.6%
Applied egg-rr98.6%
Taylor expanded in y around 0 49.4%
if -1.8500000000000001e-121 < x < 3.5000000000000001e-100Initial program 68.7%
times-frac85.4%
/-rgt-identity85.4%
associate-/l/85.4%
*-lft-identity85.4%
associate-+l+85.4%
Simplified85.4%
Taylor expanded in x around 0 84.6%
distribute-rgt-in84.6%
*-lft-identity84.6%
Simplified84.6%
Taylor expanded in y around 0 69.2%
if 3.5000000000000001e-100 < x Initial program 65.2%
associate-*r/77.5%
*-commutative77.5%
distribute-rgt1-in68.2%
fma-def77.5%
cube-unmult77.5%
Simplified77.5%
Taylor expanded in y around inf 37.2%
unpow237.2%
Simplified37.2%
associate-/r*39.9%
div-inv39.9%
Applied egg-rr39.9%
associate-*r/39.9%
*-rgt-identity39.9%
Simplified39.9%
Final simplification57.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -7.6e-110) (/ y (* x (+ x 1.0))) (if (<= x 2.5e-33) (/ x (* y (+ y 1.0))) (/ (/ x y) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -7.6e-110) {
tmp = y / (x * (x + 1.0));
} else if (x <= 2.5e-33) {
tmp = x / (y * (y + 1.0));
} 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 <= (-7.6d-110)) then
tmp = y / (x * (x + 1.0d0))
else if (x <= 2.5d-33) then
tmp = x / (y * (y + 1.0d0))
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 <= -7.6e-110) {
tmp = y / (x * (x + 1.0));
} else if (x <= 2.5e-33) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -7.6e-110: tmp = y / (x * (x + 1.0)) elif x <= 2.5e-33: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -7.6e-110) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (x <= 2.5e-33) tmp = Float64(x / Float64(y * Float64(y + 1.0))); 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 <= -7.6e-110)
tmp = y / (x * (x + 1.0));
elseif (x <= 2.5e-33)
tmp = x / (y * (y + 1.0));
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, -7.6e-110], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e-33], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{-110}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -7.5999999999999996e-110Initial program 67.3%
times-frac88.2%
/-rgt-identity88.2%
associate-/l/88.2%
*-lft-identity88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around 0 64.5%
if -7.5999999999999996e-110 < x < 2.50000000000000014e-33Initial program 72.3%
times-frac88.5%
/-rgt-identity88.5%
associate-/l/88.5%
*-lft-identity88.5%
associate-+l+88.5%
Simplified88.5%
Taylor expanded in x around 0 83.6%
+-commutative83.6%
Simplified83.6%
if 2.50000000000000014e-33 < x Initial program 60.0%
associate-*r/75.1%
*-commutative75.1%
distribute-rgt1-in69.3%
fma-def75.1%
cube-unmult75.1%
Simplified75.1%
Taylor expanded in y around inf 29.7%
unpow229.7%
Simplified29.7%
associate-/r*33.1%
div-inv33.0%
Applied egg-rr33.0%
associate-*r/33.1%
*-rgt-identity33.1%
Simplified33.1%
Final simplification62.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.3e-108) (/ y (* x (+ x 1.0))) (if (<= x 2.4e-33) (/ x (* y (+ y 1.0))) (/ (/ x y) (+ x y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.3e-108) {
tmp = y / (x * (x + 1.0));
} else if (x <= 2.4e-33) {
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 <= (-3.3d-108)) then
tmp = y / (x * (x + 1.0d0))
else if (x <= 2.4d-33) 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 <= -3.3e-108) {
tmp = y / (x * (x + 1.0));
} else if (x <= 2.4e-33) {
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 <= -3.3e-108: tmp = y / (x * (x + 1.0)) elif x <= 2.4e-33: 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 <= -3.3e-108) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (x <= 2.4e-33) 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 <= -3.3e-108)
tmp = y / (x * (x + 1.0));
elseif (x <= 2.4e-33)
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, -3.3e-108], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.4e-33], 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 -3.3 \cdot 10^{-108}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{x + y}\\
\end{array}
\end{array}
if x < -3.3000000000000002e-108Initial program 66.9%
times-frac88.1%
/-rgt-identity88.1%
associate-/l/88.1%
*-lft-identity88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in y around 0 65.1%
if -3.3000000000000002e-108 < x < 2.4e-33Initial program 72.6%
times-frac88.6%
/-rgt-identity88.6%
associate-/l/88.6%
*-lft-identity88.6%
associate-+l+88.6%
Simplified88.6%
Taylor expanded in x around 0 83.8%
+-commutative83.8%
Simplified83.8%
if 2.4e-33 < x Initial program 60.0%
times-frac86.9%
associate-+r+86.9%
associate-*l/86.9%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 59.1%
+-commutative59.1%
Simplified59.1%
associate-*l/59.1%
associate-/l/59.9%
+-commutative59.9%
+-commutative59.9%
+-commutative59.9%
Applied egg-rr59.9%
Taylor expanded in y around inf 33.8%
Final simplification63.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.4e-108) (/ y (* x (+ x 1.0))) (* (/ x (+ y 1.0)) (/ 1.0 y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4e-108) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (y + 1.0)) * (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 <= (-3.4d-108)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / (y + 1.0d0)) * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.4e-108) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (y + 1.0)) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.4e-108: tmp = y / (x * (x + 1.0)) else: tmp = (x / (y + 1.0)) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.4e-108) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(y + 1.0)) * 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 <= -3.4e-108)
tmp = y / (x * (x + 1.0));
else
tmp = (x / (y + 1.0)) * (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, -3.4e-108], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-108}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + 1} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -3.40000000000000002e-108Initial program 66.9%
times-frac88.1%
/-rgt-identity88.1%
associate-/l/88.1%
*-lft-identity88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in y around 0 65.1%
if -3.40000000000000002e-108 < x Initial program 67.0%
times-frac87.8%
/-rgt-identity87.8%
associate-/l/87.8%
*-lft-identity87.8%
associate-+l+87.8%
Simplified87.8%
Taylor expanded in x around 0 60.0%
distribute-rgt-in60.0%
*-lft-identity60.0%
Simplified60.0%
distribute-rgt1-in60.0%
Applied egg-rr60.0%
associate-/r*61.5%
div-inv61.4%
+-commutative61.4%
Applied egg-rr61.4%
Final simplification62.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.4e-108) (/ y (* x (+ x (+ y 1.0)))) (* (/ x (+ y 1.0)) (/ 1.0 y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4e-108) {
tmp = y / (x * (x + (y + 1.0)));
} else {
tmp = (x / (y + 1.0)) * (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 <= (-3.4d-108)) then
tmp = y / (x * (x + (y + 1.0d0)))
else
tmp = (x / (y + 1.0d0)) * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.4e-108) {
tmp = y / (x * (x + (y + 1.0)));
} else {
tmp = (x / (y + 1.0)) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.4e-108: tmp = y / (x * (x + (y + 1.0))) else: tmp = (x / (y + 1.0)) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.4e-108) tmp = Float64(y / Float64(x * Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) * 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 <= -3.4e-108)
tmp = y / (x * (x + (y + 1.0)));
else
tmp = (x / (y + 1.0)) * (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, -3.4e-108], N[(y / N[(x * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-108}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + 1} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -3.40000000000000002e-108Initial program 66.9%
times-frac88.1%
/-rgt-identity88.1%
associate-/l/88.1%
*-lft-identity88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in x around inf 65.3%
unpow265.3%
Simplified65.3%
*-commutative65.3%
associate-/r*67.3%
*-inverses67.3%
frac-times67.6%
*-rgt-identity67.6%
Applied egg-rr67.6%
if -3.40000000000000002e-108 < x Initial program 67.0%
times-frac87.8%
/-rgt-identity87.8%
associate-/l/87.8%
*-lft-identity87.8%
associate-+l+87.8%
Simplified87.8%
Taylor expanded in x around 0 60.0%
distribute-rgt-in60.0%
*-lft-identity60.0%
Simplified60.0%
distribute-rgt1-in60.0%
Applied egg-rr60.0%
associate-/r*61.5%
div-inv61.4%
+-commutative61.4%
Applied egg-rr61.4%
Final simplification63.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -7.8e-109) (/ y (* x (+ x (+ y 1.0)))) (/ (/ x (+ y 1.0)) (+ x y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -7.8e-109) {
tmp = y / (x * (x + (y + 1.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) :: tmp
if (x <= (-7.8d-109)) then
tmp = y / (x * (x + (y + 1.0d0)))
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 <= -7.8e-109) {
tmp = y / (x * (x + (y + 1.0)));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -7.8e-109: tmp = y / (x * (x + (y + 1.0))) else: tmp = (x / (y + 1.0)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -7.8e-109) tmp = Float64(y / Float64(x * Float64(x + Float64(y + 1.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)
tmp = 0.0;
if (x <= -7.8e-109)
tmp = y / (x * (x + (y + 1.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_] := If[LessEqual[x, -7.8e-109], N[(y / N[(x * N[(x + N[(y + 1.0), $MachinePrecision]), $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 -7.8 \cdot 10^{-109}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -7.80000000000000046e-109Initial program 66.9%
times-frac88.1%
/-rgt-identity88.1%
associate-/l/88.1%
*-lft-identity88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in x around inf 65.3%
unpow265.3%
Simplified65.3%
*-commutative65.3%
associate-/r*67.3%
*-inverses67.3%
frac-times67.6%
*-rgt-identity67.6%
Applied egg-rr67.6%
if -7.80000000000000046e-109 < x Initial program 67.0%
times-frac87.8%
associate-+r+87.8%
associate-*l/80.0%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 81.9%
+-commutative81.9%
Simplified81.9%
associate-*l/81.9%
associate-/l/82.2%
+-commutative82.2%
+-commutative82.2%
+-commutative82.2%
Applied egg-rr82.2%
Taylor expanded in x around 0 61.8%
+-commutative61.8%
Simplified61.8%
Final simplification64.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.4e-108) (/ (/ y x) (+ x (+ y 1.0))) (/ (/ x (+ y 1.0)) (+ x y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4e-108) {
tmp = (y / x) / (x + (y + 1.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) :: tmp
if (x <= (-3.4d-108)) then
tmp = (y / x) / (x + (y + 1.0d0))
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 <= -3.4e-108) {
tmp = (y / x) / (x + (y + 1.0));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.4e-108: tmp = (y / x) / (x + (y + 1.0)) else: tmp = (x / (y + 1.0)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.4e-108) tmp = Float64(Float64(y / x) / Float64(x + Float64(y + 1.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)
tmp = 0.0;
if (x <= -3.4e-108)
tmp = (y / x) / (x + (y + 1.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_] := If[LessEqual[x, -3.4e-108], N[(N[(y / x), $MachinePrecision] / N[(x + N[(y + 1.0), $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 -3.4 \cdot 10^{-108}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -3.40000000000000002e-108Initial program 66.9%
times-frac88.1%
/-rgt-identity88.1%
associate-/l/88.1%
*-lft-identity88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in x around inf 65.3%
unpow265.3%
Simplified65.3%
expm1-log1p-u64.9%
expm1-udef42.2%
*-commutative42.2%
associate-/r*42.2%
*-inverses42.2%
frac-times42.2%
*-rgt-identity42.2%
Applied egg-rr42.2%
expm1-def67.2%
expm1-log1p67.6%
*-commutative67.6%
associate-/r*67.4%
Simplified67.4%
if -3.40000000000000002e-108 < x Initial program 67.0%
times-frac87.8%
associate-+r+87.8%
associate-*l/80.0%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 81.9%
+-commutative81.9%
Simplified81.9%
associate-*l/81.9%
associate-/l/82.2%
+-commutative82.2%
+-commutative82.2%
+-commutative82.2%
Applied egg-rr82.2%
Taylor expanded in x around 0 61.8%
+-commutative61.8%
Simplified61.8%
Final simplification63.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -8.3e-122) (/ y x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -8.3e-122) {
tmp = y / 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 <= (-8.3d-122)) then
tmp = y / 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 <= -8.3e-122) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -8.3e-122: tmp = y / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -8.3e-122) tmp = Float64(y / 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 <= -8.3e-122)
tmp = y / 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, -8.3e-122], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.3 \cdot 10^{-122}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -8.3000000000000004e-122Initial program 67.3%
times-frac88.5%
associate-+r+88.5%
associate-*l/84.7%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 64.9%
+-commutative64.9%
Simplified64.9%
Taylor expanded in y around 0 30.9%
if -8.3000000000000004e-122 < x Initial program 66.8%
times-frac87.5%
/-rgt-identity87.5%
associate-/l/87.5%
*-lft-identity87.5%
associate-+l+87.5%
Simplified87.5%
Taylor expanded in x around 0 59.6%
distribute-rgt-in59.6%
*-lft-identity59.6%
Simplified59.6%
Taylor expanded in y around 0 35.2%
Final simplification33.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 1.0 x))
assert(x < y);
double code(double x, double y) {
return 1.0 / x;
}
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 = 1.0d0 / x
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / x;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / x
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{x}
\end{array}
Initial program 67.0%
times-frac87.9%
associate-+r+87.9%
associate-*l/81.9%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 39.1%
Taylor expanded in x around inf 4.1%
Final simplification4.1%
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 67.0%
times-frac87.9%
/-rgt-identity87.9%
associate-/l/87.9%
*-lft-identity87.9%
associate-+l+87.9%
Simplified87.9%
Taylor expanded in x around 0 48.9%
distribute-rgt-in48.9%
*-lft-identity48.9%
Simplified48.9%
Taylor expanded in y around 0 24.4%
Final simplification24.4%
(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 2023240
(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))))