
(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 16 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}
(FPCore (x y) :precision binary64 (/ (* (/ x (+ x y)) (/ y (+ x y))) (+ x (+ y 1.0))))
double code(double x, double y) {
return ((x / (x + y)) * (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 / (x + y)) * (y / (x + y))) / (x + (y + 1.0d0))
end function
public static double code(double x, double y) {
return ((x / (x + y)) * (y / (x + y))) / (x + (y + 1.0));
}
def code(x, y): return ((x / (x + y)) * (y / (x + y))) / (x + (y + 1.0))
function code(x, y) return Float64(Float64(Float64(x / Float64(x + y)) * Float64(y / Float64(x + y))) / Float64(x + Float64(y + 1.0))) end
function tmp = code(x, y) tmp = ((x / (x + y)) * (y / (x + y))) / (x + (y + 1.0)); end
code[x_, y_] := N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{x + y} \cdot \frac{y}{x + y}}{x + \left(y + 1\right)}
\end{array}
Initial program 68.2%
associate-/l*77.7%
associate-+l+77.7%
Simplified77.7%
associate-*r/68.2%
associate-+r+68.2%
associate-/r*73.9%
clear-num73.4%
associate-+r+73.4%
associate-/l*85.6%
pow285.6%
Applied egg-rr85.6%
*-un-lft-identity85.6%
unpow285.6%
times-frac98.3%
+-commutative98.3%
+-commutative98.3%
Applied egg-rr98.3%
clear-num99.7%
associate-*r*99.7%
*-un-lft-identity99.7%
times-frac99.6%
un-div-inv99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
/-rgt-identity99.8%
associate-*r/99.9%
+-commutative99.9%
Simplified99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= x -5.6e+74)
(/ (/ y (+ x y)) t_0)
(if (<= x 650000000000.0)
(* x (/ (/ y (* (+ x y) t_0)) (+ x y)))
(/ 1.0 (/ t_0 (/ x y)))))))
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -5.6e+74) {
tmp = (y / (x + y)) / t_0;
} else if (x <= 650000000000.0) {
tmp = x * ((y / ((x + y) * t_0)) / (x + y));
} else {
tmp = 1.0 / (t_0 / (x / y));
}
return tmp;
}
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 + 1.0d0)
if (x <= (-5.6d+74)) then
tmp = (y / (x + y)) / t_0
else if (x <= 650000000000.0d0) then
tmp = x * ((y / ((x + y) * t_0)) / (x + y))
else
tmp = 1.0d0 / (t_0 / (x / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -5.6e+74) {
tmp = (y / (x + y)) / t_0;
} else if (x <= 650000000000.0) {
tmp = x * ((y / ((x + y) * t_0)) / (x + y));
} else {
tmp = 1.0 / (t_0 / (x / y));
}
return tmp;
}
def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if x <= -5.6e+74: tmp = (y / (x + y)) / t_0 elif x <= 650000000000.0: tmp = x * ((y / ((x + y) * t_0)) / (x + y)) else: tmp = 1.0 / (t_0 / (x / y)) return tmp
function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (x <= -5.6e+74) tmp = Float64(Float64(y / Float64(x + y)) / t_0); elseif (x <= 650000000000.0) tmp = Float64(x * Float64(Float64(y / Float64(Float64(x + y) * t_0)) / Float64(x + y))); else tmp = Float64(1.0 / Float64(t_0 / Float64(x / y))); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (y + 1.0); tmp = 0.0; if (x <= -5.6e+74) tmp = (y / (x + y)) / t_0; elseif (x <= 650000000000.0) tmp = x * ((y / ((x + y) * t_0)) / (x + y)); else tmp = 1.0 / (t_0 / (x / y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.6e+74], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x, 650000000000.0], N[(x * N[(N[(y / N[(N[(x + y), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;x \leq -5.6 \cdot 10^{+74}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{t\_0}\\
\mathbf{elif}\;x \leq 650000000000:\\
\;\;\;\;x \cdot \frac{\frac{y}{\left(x + y\right) \cdot t\_0}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{t\_0}{\frac{x}{y}}}\\
\end{array}
\end{array}
if x < -5.60000000000000003e74Initial program 51.2%
associate-/l*65.5%
associate-+l+65.5%
Simplified65.5%
associate-*r/51.2%
associate-+r+51.2%
associate-/r*58.9%
clear-num58.8%
associate-+r+58.8%
associate-/l*75.7%
pow275.7%
Applied egg-rr75.7%
*-un-lft-identity75.7%
unpow275.7%
times-frac96.2%
+-commutative96.2%
+-commutative96.2%
Applied egg-rr96.2%
clear-num99.8%
associate-*r*99.9%
*-un-lft-identity99.9%
times-frac99.7%
un-div-inv99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
/-rgt-identity99.8%
associate-*r/99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 86.4%
if -5.60000000000000003e74 < x < 6.5e11Initial program 76.4%
associate-/l*87.3%
associate-+l+87.3%
Simplified87.3%
*-un-lft-identity87.3%
associate-+r+87.3%
associate-*l*87.3%
times-frac98.5%
associate-+r+98.5%
Applied egg-rr98.5%
associate-*l/98.7%
*-lft-identity98.7%
Simplified98.7%
if 6.5e11 < x Initial program 56.4%
associate-/l*59.2%
associate-+l+59.2%
Simplified59.2%
associate-*r/56.4%
associate-+r+56.4%
associate-/r*68.8%
clear-num68.8%
associate-+r+68.8%
associate-/l*78.7%
pow278.7%
Applied egg-rr78.7%
*-un-lft-identity78.7%
unpow278.7%
times-frac98.2%
+-commutative98.2%
+-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in x around 0 20.4%
Final simplification78.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= x -1.46e+22)
(/ (/ y (+ x y)) t_0)
(if (<= x -3.3e-164)
(* x (/ y (* t_0 (* (+ x y) (+ x y)))))
(/ (/ x y) t_0)))))
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.46e+22) {
tmp = (y / (x + y)) / t_0;
} else if (x <= -3.3e-164) {
tmp = x * (y / (t_0 * ((x + y) * (x + y))));
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
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 + 1.0d0)
if (x <= (-1.46d+22)) then
tmp = (y / (x + y)) / t_0
else if (x <= (-3.3d-164)) then
tmp = x * (y / (t_0 * ((x + y) * (x + y))))
else
tmp = (x / y) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.46e+22) {
tmp = (y / (x + y)) / t_0;
} else if (x <= -3.3e-164) {
tmp = x * (y / (t_0 * ((x + y) * (x + y))));
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if x <= -1.46e+22: tmp = (y / (x + y)) / t_0 elif x <= -3.3e-164: tmp = x * (y / (t_0 * ((x + y) * (x + y)))) else: tmp = (x / y) / t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (x <= -1.46e+22) tmp = Float64(Float64(y / Float64(x + y)) / t_0); elseif (x <= -3.3e-164) tmp = Float64(x * Float64(y / Float64(t_0 * Float64(Float64(x + y) * Float64(x + y))))); else tmp = Float64(Float64(x / y) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (y + 1.0); tmp = 0.0; if (x <= -1.46e+22) tmp = (y / (x + y)) / t_0; elseif (x <= -3.3e-164) tmp = x * (y / (t_0 * ((x + y) * (x + y)))); else tmp = (x / y) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.46e+22], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x, -3.3e-164], N[(x * N[(y / N[(t$95$0 * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;x \leq -1.46 \cdot 10^{+22}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{t\_0}\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-164}:\\
\;\;\;\;x \cdot \frac{y}{t\_0 \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0}\\
\end{array}
\end{array}
if x < -1.46e22Initial program 60.5%
associate-/l*67.7%
associate-+l+67.7%
Simplified67.7%
associate-*r/60.5%
associate-+r+60.5%
associate-/r*68.4%
clear-num68.3%
associate-+r+68.3%
associate-/l*81.3%
pow281.3%
Applied egg-rr81.3%
*-un-lft-identity81.3%
unpow281.3%
times-frac96.9%
+-commutative96.9%
+-commutative96.9%
Applied egg-rr96.9%
clear-num99.7%
associate-*r*99.8%
*-un-lft-identity99.8%
times-frac99.7%
un-div-inv99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
/-rgt-identity99.8%
associate-*r/99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 82.9%
if -1.46e22 < x < -3.3e-164Initial program 88.9%
associate-/l*94.1%
associate-+l+94.1%
Simplified94.1%
if -3.3e-164 < x Initial program 64.9%
associate-/l*76.2%
associate-+l+76.2%
Simplified76.2%
associate-*r/64.9%
associate-+r+64.9%
associate-/r*70.6%
clear-num69.8%
associate-+r+69.8%
associate-/l*83.6%
pow283.6%
Applied egg-rr83.6%
*-un-lft-identity83.6%
unpow283.6%
times-frac98.4%
+-commutative98.4%
+-commutative98.4%
Applied egg-rr98.4%
clear-num99.7%
associate-*r*99.7%
*-un-lft-identity99.7%
times-frac99.7%
un-div-inv99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
/-rgt-identity99.9%
associate-*r/99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 56.7%
Final simplification67.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))) (t_1 (/ (/ y (+ x y)) t_0)))
(if (<= x -2.2e-73)
t_1
(if (<= x -3.7e-106)
(/ 1.0 (/ t_0 (/ x y)))
(if (<= x -1.85e-146) t_1 (/ (/ x y) t_0))))))
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double t_1 = (y / (x + y)) / t_0;
double tmp;
if (x <= -2.2e-73) {
tmp = t_1;
} else if (x <= -3.7e-106) {
tmp = 1.0 / (t_0 / (x / y));
} else if (x <= -1.85e-146) {
tmp = t_1;
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
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 = x + (y + 1.0d0)
t_1 = (y / (x + y)) / t_0
if (x <= (-2.2d-73)) then
tmp = t_1
else if (x <= (-3.7d-106)) then
tmp = 1.0d0 / (t_0 / (x / y))
else if (x <= (-1.85d-146)) then
tmp = t_1
else
tmp = (x / y) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double t_1 = (y / (x + y)) / t_0;
double tmp;
if (x <= -2.2e-73) {
tmp = t_1;
} else if (x <= -3.7e-106) {
tmp = 1.0 / (t_0 / (x / y));
} else if (x <= -1.85e-146) {
tmp = t_1;
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
def code(x, y): t_0 = x + (y + 1.0) t_1 = (y / (x + y)) / t_0 tmp = 0 if x <= -2.2e-73: tmp = t_1 elif x <= -3.7e-106: tmp = 1.0 / (t_0 / (x / y)) elif x <= -1.85e-146: tmp = t_1 else: tmp = (x / y) / t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) t_1 = Float64(Float64(y / Float64(x + y)) / t_0) tmp = 0.0 if (x <= -2.2e-73) tmp = t_1; elseif (x <= -3.7e-106) tmp = Float64(1.0 / Float64(t_0 / Float64(x / y))); elseif (x <= -1.85e-146) tmp = t_1; else tmp = Float64(Float64(x / y) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (y + 1.0); t_1 = (y / (x + y)) / t_0; tmp = 0.0; if (x <= -2.2e-73) tmp = t_1; elseif (x <= -3.7e-106) tmp = 1.0 / (t_0 / (x / y)); elseif (x <= -1.85e-146) tmp = t_1; else tmp = (x / y) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x, -2.2e-73], t$95$1, If[LessEqual[x, -3.7e-106], N[(1.0 / N[(t$95$0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.85e-146], t$95$1, N[(N[(x / y), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
t_1 := \frac{\frac{y}{x + y}}{t\_0}\\
\mathbf{if}\;x \leq -2.2 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-106}:\\
\;\;\;\;\frac{1}{\frac{t\_0}{\frac{x}{y}}}\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-146}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0}\\
\end{array}
\end{array}
if x < -2.2e-73 or -3.69999999999999979e-106 < x < -1.84999999999999993e-146Initial program 71.4%
associate-/l*78.1%
associate-+l+78.1%
Simplified78.1%
associate-*r/71.4%
associate-+r+71.4%
associate-/r*78.4%
clear-num78.3%
associate-+r+78.3%
associate-/l*88.6%
pow288.6%
Applied egg-rr88.6%
*-un-lft-identity88.6%
unpow288.6%
times-frac97.9%
+-commutative97.9%
+-commutative97.9%
Applied egg-rr97.9%
clear-num99.7%
associate-*r*99.7%
*-un-lft-identity99.7%
times-frac99.6%
un-div-inv99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
/-rgt-identity99.8%
associate-*r/99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 67.8%
if -2.2e-73 < x < -3.69999999999999979e-106Initial program 99.6%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
associate-*r/99.6%
associate-+r+99.6%
associate-/r*99.6%
clear-num99.8%
associate-+r+99.8%
associate-/l*99.4%
pow299.4%
Applied egg-rr99.4%
*-un-lft-identity99.4%
unpow299.4%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 87.1%
if -1.84999999999999993e-146 < x Initial program 65.4%
associate-/l*76.6%
associate-+l+76.6%
Simplified76.6%
associate-*r/65.4%
associate-+r+65.4%
associate-/r*70.8%
clear-num70.1%
associate-+r+70.1%
associate-/l*83.7%
pow283.7%
Applied egg-rr83.7%
*-un-lft-identity83.7%
unpow283.7%
times-frac98.4%
+-commutative98.4%
+-commutative98.4%
Applied egg-rr98.4%
clear-num99.7%
associate-*r*99.7%
*-un-lft-identity99.7%
times-frac99.7%
un-div-inv99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
/-rgt-identity99.9%
associate-*r/99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 57.4%
Final simplification61.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))) (t_1 (/ (/ y x) t_0)))
(if (<= x -1.25e-76)
t_1
(if (<= x -5.5e-108)
(/ 1.0 (/ t_0 (/ x y)))
(if (<= x -2e-140) t_1 (/ (/ x y) t_0))))))
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double t_1 = (y / x) / t_0;
double tmp;
if (x <= -1.25e-76) {
tmp = t_1;
} else if (x <= -5.5e-108) {
tmp = 1.0 / (t_0 / (x / y));
} else if (x <= -2e-140) {
tmp = t_1;
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
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 = x + (y + 1.0d0)
t_1 = (y / x) / t_0
if (x <= (-1.25d-76)) then
tmp = t_1
else if (x <= (-5.5d-108)) then
tmp = 1.0d0 / (t_0 / (x / y))
else if (x <= (-2d-140)) then
tmp = t_1
else
tmp = (x / y) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double t_1 = (y / x) / t_0;
double tmp;
if (x <= -1.25e-76) {
tmp = t_1;
} else if (x <= -5.5e-108) {
tmp = 1.0 / (t_0 / (x / y));
} else if (x <= -2e-140) {
tmp = t_1;
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
def code(x, y): t_0 = x + (y + 1.0) t_1 = (y / x) / t_0 tmp = 0 if x <= -1.25e-76: tmp = t_1 elif x <= -5.5e-108: tmp = 1.0 / (t_0 / (x / y)) elif x <= -2e-140: tmp = t_1 else: tmp = (x / y) / t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) t_1 = Float64(Float64(y / x) / t_0) tmp = 0.0 if (x <= -1.25e-76) tmp = t_1; elseif (x <= -5.5e-108) tmp = Float64(1.0 / Float64(t_0 / Float64(x / y))); elseif (x <= -2e-140) tmp = t_1; else tmp = Float64(Float64(x / y) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (y + 1.0); t_1 = (y / x) / t_0; tmp = 0.0; if (x <= -1.25e-76) tmp = t_1; elseif (x <= -5.5e-108) tmp = 1.0 / (t_0 / (x / y)); elseif (x <= -2e-140) tmp = t_1; else tmp = (x / y) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / x), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x, -1.25e-76], t$95$1, If[LessEqual[x, -5.5e-108], N[(1.0 / N[(t$95$0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-140], t$95$1, N[(N[(x / y), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
t_1 := \frac{\frac{y}{x}}{t\_0}\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{-76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-108}:\\
\;\;\;\;\frac{1}{\frac{t\_0}{\frac{x}{y}}}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0}\\
\end{array}
\end{array}
if x < -1.2499999999999999e-76 or -5.50000000000000031e-108 < x < -2e-140Initial program 71.0%
associate-/l*77.9%
associate-+l+77.9%
Simplified77.9%
associate-*r/71.0%
associate-+r+71.0%
associate-/r*78.2%
clear-num78.1%
associate-+r+78.1%
associate-/l*88.5%
pow288.5%
Applied egg-rr88.5%
Taylor expanded in x around inf 66.9%
clear-num67.9%
add-cube-cbrt67.1%
*-un-lft-identity67.1%
times-frac67.1%
pow267.1%
+-commutative67.1%
Applied egg-rr67.1%
/-rgt-identity67.1%
associate-*r/67.1%
unpow267.1%
rem-3cbrt-lft67.9%
+-commutative67.9%
Simplified67.9%
if -1.2499999999999999e-76 < x < -5.50000000000000031e-108Initial program 99.6%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
associate-*r/99.6%
associate-+r+99.6%
associate-/r*99.6%
clear-num99.8%
associate-+r+99.8%
associate-/l*99.4%
pow299.4%
Applied egg-rr99.4%
*-un-lft-identity99.4%
unpow299.4%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 87.1%
if -2e-140 < x Initial program 65.6%
associate-/l*76.7%
associate-+l+76.7%
Simplified76.7%
associate-*r/65.6%
associate-+r+65.6%
associate-/r*71.0%
clear-num70.3%
associate-+r+70.3%
associate-/l*83.8%
pow283.8%
Applied egg-rr83.8%
*-un-lft-identity83.8%
unpow283.8%
times-frac98.4%
+-commutative98.4%
+-commutative98.4%
Applied egg-rr98.4%
clear-num99.7%
associate-*r*99.7%
*-un-lft-identity99.7%
times-frac99.6%
un-div-inv99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
/-rgt-identity99.9%
associate-*r/99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 57.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))) (t_1 (/ (/ y x) t_0)))
(if (<= x -8.6e-75)
t_1
(if (<= x -5.5e-108)
(/ x (* y (+ y 1.0)))
(if (<= x -4.5e-140) t_1 (/ (/ x y) t_0))))))
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double t_1 = (y / x) / t_0;
double tmp;
if (x <= -8.6e-75) {
tmp = t_1;
} else if (x <= -5.5e-108) {
tmp = x / (y * (y + 1.0));
} else if (x <= -4.5e-140) {
tmp = t_1;
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
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 = x + (y + 1.0d0)
t_1 = (y / x) / t_0
if (x <= (-8.6d-75)) then
tmp = t_1
else if (x <= (-5.5d-108)) then
tmp = x / (y * (y + 1.0d0))
else if (x <= (-4.5d-140)) then
tmp = t_1
else
tmp = (x / y) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double t_1 = (y / x) / t_0;
double tmp;
if (x <= -8.6e-75) {
tmp = t_1;
} else if (x <= -5.5e-108) {
tmp = x / (y * (y + 1.0));
} else if (x <= -4.5e-140) {
tmp = t_1;
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
def code(x, y): t_0 = x + (y + 1.0) t_1 = (y / x) / t_0 tmp = 0 if x <= -8.6e-75: tmp = t_1 elif x <= -5.5e-108: tmp = x / (y * (y + 1.0)) elif x <= -4.5e-140: tmp = t_1 else: tmp = (x / y) / t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) t_1 = Float64(Float64(y / x) / t_0) tmp = 0.0 if (x <= -8.6e-75) tmp = t_1; elseif (x <= -5.5e-108) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (x <= -4.5e-140) tmp = t_1; else tmp = Float64(Float64(x / y) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (y + 1.0); t_1 = (y / x) / t_0; tmp = 0.0; if (x <= -8.6e-75) tmp = t_1; elseif (x <= -5.5e-108) tmp = x / (y * (y + 1.0)); elseif (x <= -4.5e-140) tmp = t_1; else tmp = (x / y) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / x), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x, -8.6e-75], t$95$1, If[LessEqual[x, -5.5e-108], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.5e-140], t$95$1, N[(N[(x / y), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
t_1 := \frac{\frac{y}{x}}{t\_0}\\
\mathbf{if}\;x \leq -8.6 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-108}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0}\\
\end{array}
\end{array}
if x < -8.5999999999999998e-75 or -5.50000000000000031e-108 < x < -4.50000000000000004e-140Initial program 71.0%
associate-/l*77.9%
associate-+l+77.9%
Simplified77.9%
associate-*r/71.0%
associate-+r+71.0%
associate-/r*78.2%
clear-num78.1%
associate-+r+78.1%
associate-/l*88.5%
pow288.5%
Applied egg-rr88.5%
Taylor expanded in x around inf 66.9%
clear-num67.9%
add-cube-cbrt67.1%
*-un-lft-identity67.1%
times-frac67.1%
pow267.1%
+-commutative67.1%
Applied egg-rr67.1%
/-rgt-identity67.1%
associate-*r/67.1%
unpow267.1%
rem-3cbrt-lft67.9%
+-commutative67.9%
Simplified67.9%
if -8.5999999999999998e-75 < x < -5.50000000000000031e-108Initial program 99.6%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 87.1%
+-commutative87.1%
Simplified87.1%
if -4.50000000000000004e-140 < x Initial program 65.6%
associate-/l*76.7%
associate-+l+76.7%
Simplified76.7%
associate-*r/65.6%
associate-+r+65.6%
associate-/r*71.0%
clear-num70.3%
associate-+r+70.3%
associate-/l*83.8%
pow283.8%
Applied egg-rr83.8%
*-un-lft-identity83.8%
unpow283.8%
times-frac98.4%
+-commutative98.4%
+-commutative98.4%
Applied egg-rr98.4%
clear-num99.7%
associate-*r*99.7%
*-un-lft-identity99.7%
times-frac99.6%
un-div-inv99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
/-rgt-identity99.9%
associate-*r/99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 57.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= x -1.95e-73)
(/ (/ y x) (+ x 1.0))
(if (<= x -5.5e-108)
(/ x (* y (+ y 1.0)))
(if (<= x -4.5e-140) (/ y (* x t_0)) (/ (/ x y) t_0))))))
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.95e-73) {
tmp = (y / x) / (x + 1.0);
} else if (x <= -5.5e-108) {
tmp = x / (y * (y + 1.0));
} else if (x <= -4.5e-140) {
tmp = y / (x * t_0);
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
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 + 1.0d0)
if (x <= (-1.95d-73)) then
tmp = (y / x) / (x + 1.0d0)
else if (x <= (-5.5d-108)) then
tmp = x / (y * (y + 1.0d0))
else if (x <= (-4.5d-140)) then
tmp = y / (x * t_0)
else
tmp = (x / y) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.95e-73) {
tmp = (y / x) / (x + 1.0);
} else if (x <= -5.5e-108) {
tmp = x / (y * (y + 1.0));
} else if (x <= -4.5e-140) {
tmp = y / (x * t_0);
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if x <= -1.95e-73: tmp = (y / x) / (x + 1.0) elif x <= -5.5e-108: tmp = x / (y * (y + 1.0)) elif x <= -4.5e-140: tmp = y / (x * t_0) else: tmp = (x / y) / t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (x <= -1.95e-73) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (x <= -5.5e-108) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (x <= -4.5e-140) tmp = Float64(y / Float64(x * t_0)); else tmp = Float64(Float64(x / y) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (y + 1.0); tmp = 0.0; if (x <= -1.95e-73) tmp = (y / x) / (x + 1.0); elseif (x <= -5.5e-108) tmp = x / (y * (y + 1.0)); elseif (x <= -4.5e-140) tmp = y / (x * t_0); else tmp = (x / y) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.95e-73], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.5e-108], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.5e-140], N[(y / N[(x * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;x \leq -1.95 \cdot 10^{-73}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-108}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-140}:\\
\;\;\;\;\frac{y}{x \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0}\\
\end{array}
\end{array}
if x < -1.94999999999999991e-73Initial program 70.0%
associate-/l*76.0%
associate-+l+76.0%
Simplified76.0%
Taylor expanded in y around 0 61.1%
associate-/r*68.9%
+-commutative68.9%
Simplified68.9%
if -1.94999999999999991e-73 < x < -5.50000000000000031e-108Initial program 99.6%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 87.1%
+-commutative87.1%
Simplified87.1%
if -5.50000000000000031e-108 < x < -4.50000000000000004e-140Initial program 83.5%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
associate-*r/83.5%
associate-+r+83.5%
associate-/r*83.7%
clear-num83.5%
associate-+r+83.5%
associate-/l*99.5%
pow299.5%
Applied egg-rr99.5%
Taylor expanded in x around inf 49.8%
associate-/r/50.3%
*-un-lft-identity50.3%
frac-times50.4%
*-un-lft-identity50.4%
+-commutative50.4%
Applied egg-rr50.4%
*-lft-identity50.4%
*-commutative50.4%
+-commutative50.4%
Simplified50.4%
if -4.50000000000000004e-140 < x Initial program 65.6%
associate-/l*76.7%
associate-+l+76.7%
Simplified76.7%
associate-*r/65.6%
associate-+r+65.6%
associate-/r*71.0%
clear-num70.3%
associate-+r+70.3%
associate-/l*83.8%
pow283.8%
Applied egg-rr83.8%
*-un-lft-identity83.8%
unpow283.8%
times-frac98.4%
+-commutative98.4%
+-commutative98.4%
Applied egg-rr98.4%
clear-num99.7%
associate-*r*99.7%
*-un-lft-identity99.7%
times-frac99.6%
un-div-inv99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
/-rgt-identity99.9%
associate-*r/99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 57.6%
(FPCore (x y)
:precision binary64
(if (<= x -2.2e-77)
(/ (/ y x) (+ x 1.0))
(if (<= x -5.5e-108)
(/ x (* y (+ y 1.0)))
(if (<= x -4.5e-140) (/ y (* x (+ x (+ y 1.0)))) (/ (/ x y) (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -2.2e-77) {
tmp = (y / x) / (x + 1.0);
} else if (x <= -5.5e-108) {
tmp = x / (y * (y + 1.0));
} else if (x <= -4.5e-140) {
tmp = y / (x * (x + (y + 1.0)));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.2d-77)) then
tmp = (y / x) / (x + 1.0d0)
else if (x <= (-5.5d-108)) then
tmp = x / (y * (y + 1.0d0))
else if (x <= (-4.5d-140)) then
tmp = y / (x * (x + (y + 1.0d0)))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.2e-77) {
tmp = (y / x) / (x + 1.0);
} else if (x <= -5.5e-108) {
tmp = x / (y * (y + 1.0));
} else if (x <= -4.5e-140) {
tmp = y / (x * (x + (y + 1.0)));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.2e-77: tmp = (y / x) / (x + 1.0) elif x <= -5.5e-108: tmp = x / (y * (y + 1.0)) elif x <= -4.5e-140: tmp = y / (x * (x + (y + 1.0))) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.2e-77) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (x <= -5.5e-108) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (x <= -4.5e-140) tmp = Float64(y / Float64(x * Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.2e-77) tmp = (y / x) / (x + 1.0); elseif (x <= -5.5e-108) tmp = x / (y * (y + 1.0)); elseif (x <= -4.5e-140) tmp = y / (x * (x + (y + 1.0))); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.2e-77], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.5e-108], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.5e-140], N[(y / N[(x * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-108}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-140}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.20000000000000007e-77Initial program 70.4%
associate-/l*76.3%
associate-+l+76.3%
Simplified76.3%
Taylor expanded in y around 0 60.3%
associate-/r*68.0%
+-commutative68.0%
Simplified68.0%
if -2.20000000000000007e-77 < x < -5.50000000000000031e-108Initial program 99.7%
associate-/l*99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in x around 0 84.9%
+-commutative84.9%
Simplified84.9%
if -5.50000000000000031e-108 < x < -4.50000000000000004e-140Initial program 83.5%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
associate-*r/83.5%
associate-+r+83.5%
associate-/r*83.7%
clear-num83.5%
associate-+r+83.5%
associate-/l*99.5%
pow299.5%
Applied egg-rr99.5%
Taylor expanded in x around inf 49.8%
associate-/r/50.3%
*-un-lft-identity50.3%
frac-times50.4%
*-un-lft-identity50.4%
+-commutative50.4%
Applied egg-rr50.4%
*-lft-identity50.4%
*-commutative50.4%
+-commutative50.4%
Simplified50.4%
if -4.50000000000000004e-140 < x Initial program 65.6%
associate-/l*76.7%
associate-+l+76.7%
Simplified76.7%
Taylor expanded in x around 0 55.4%
+-commutative55.4%
Simplified55.4%
div-inv55.5%
associate-/r*57.4%
Applied egg-rr57.4%
(FPCore (x y)
:precision binary64
(if (<= x -5.8e-73)
(/ (/ y x) (+ x 1.0))
(if (<= x -5.5e-108)
(/ x (* y (+ y 1.0)))
(if (<= x -4.5e-140) (* x (/ (/ y x) (+ x y))) (/ (/ x y) (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -5.8e-73) {
tmp = (y / x) / (x + 1.0);
} else if (x <= -5.5e-108) {
tmp = x / (y * (y + 1.0));
} else if (x <= -4.5e-140) {
tmp = x * ((y / x) / (x + y));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-5.8d-73)) then
tmp = (y / x) / (x + 1.0d0)
else if (x <= (-5.5d-108)) then
tmp = x / (y * (y + 1.0d0))
else if (x <= (-4.5d-140)) then
tmp = x * ((y / x) / (x + y))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -5.8e-73) {
tmp = (y / x) / (x + 1.0);
} else if (x <= -5.5e-108) {
tmp = x / (y * (y + 1.0));
} else if (x <= -4.5e-140) {
tmp = x * ((y / x) / (x + y));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -5.8e-73: tmp = (y / x) / (x + 1.0) elif x <= -5.5e-108: tmp = x / (y * (y + 1.0)) elif x <= -4.5e-140: tmp = x * ((y / x) / (x + y)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -5.8e-73) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (x <= -5.5e-108) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (x <= -4.5e-140) tmp = Float64(x * Float64(Float64(y / x) / Float64(x + y))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -5.8e-73) tmp = (y / x) / (x + 1.0); elseif (x <= -5.5e-108) tmp = x / (y * (y + 1.0)); elseif (x <= -4.5e-140) tmp = x * ((y / x) / (x + y)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -5.8e-73], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.5e-108], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.5e-140], N[(x * N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-73}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-108}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-140}:\\
\;\;\;\;x \cdot \frac{\frac{y}{x}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -5.8e-73Initial program 70.0%
associate-/l*76.0%
associate-+l+76.0%
Simplified76.0%
Taylor expanded in y around 0 61.1%
associate-/r*68.9%
+-commutative68.9%
Simplified68.9%
if -5.8e-73 < x < -5.50000000000000031e-108Initial program 99.6%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 87.1%
+-commutative87.1%
Simplified87.1%
if -5.50000000000000031e-108 < x < -4.50000000000000004e-140Initial program 83.5%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
*-un-lft-identity99.6%
associate-+r+99.6%
associate-*l*100.0%
times-frac99.5%
associate-+r+99.5%
Applied egg-rr99.5%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in y around 0 50.1%
+-commutative50.1%
Simplified50.1%
Taylor expanded in x around 0 50.1%
if -4.50000000000000004e-140 < x Initial program 65.6%
associate-/l*76.7%
associate-+l+76.7%
Simplified76.7%
Taylor expanded in x around 0 55.4%
+-commutative55.4%
Simplified55.4%
div-inv55.5%
associate-/r*57.4%
Applied egg-rr57.4%
(FPCore (x y)
:precision binary64
(if (<= x -5.8e-74)
(/ (/ y x) (+ x 1.0))
(if (<= x -5.5e-108)
(/ x (* y (+ y 1.0)))
(if (<= x -4.5e-140) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -5.8e-74) {
tmp = (y / x) / (x + 1.0);
} else if (x <= -5.5e-108) {
tmp = x / (y * (y + 1.0));
} else if (x <= -4.5e-140) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-5.8d-74)) then
tmp = (y / x) / (x + 1.0d0)
else if (x <= (-5.5d-108)) then
tmp = x / (y * (y + 1.0d0))
else if (x <= (-4.5d-140)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -5.8e-74) {
tmp = (y / x) / (x + 1.0);
} else if (x <= -5.5e-108) {
tmp = x / (y * (y + 1.0));
} else if (x <= -4.5e-140) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -5.8e-74: tmp = (y / x) / (x + 1.0) elif x <= -5.5e-108: tmp = x / (y * (y + 1.0)) elif x <= -4.5e-140: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -5.8e-74) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (x <= -5.5e-108) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (x <= -4.5e-140) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -5.8e-74) tmp = (y / x) / (x + 1.0); elseif (x <= -5.5e-108) tmp = x / (y * (y + 1.0)); elseif (x <= -4.5e-140) tmp = y / (x * (x + 1.0)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -5.8e-74], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.5e-108], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.5e-140], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-74}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-108}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-140}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -5.8e-74Initial program 70.0%
associate-/l*76.0%
associate-+l+76.0%
Simplified76.0%
Taylor expanded in y around 0 61.1%
associate-/r*68.9%
+-commutative68.9%
Simplified68.9%
if -5.8e-74 < x < -5.50000000000000031e-108Initial program 99.6%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 87.1%
+-commutative87.1%
Simplified87.1%
if -5.50000000000000031e-108 < x < -4.50000000000000004e-140Initial program 83.5%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 49.7%
if -4.50000000000000004e-140 < x Initial program 65.6%
associate-/l*76.7%
associate-+l+76.7%
Simplified76.7%
Taylor expanded in x around 0 55.4%
+-commutative55.4%
Simplified55.4%
div-inv55.5%
associate-/r*57.4%
Applied egg-rr57.4%
Final simplification61.2%
(FPCore (x y) :precision binary64 (if (<= y 3e-83) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (y <= 3e-83) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3d-83) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3e-83) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3e-83: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 3e-83) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3e-83) tmp = y / (x * (x + 1.0)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3e-83], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3 \cdot 10^{-83}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 3.0000000000000001e-83Initial program 66.3%
associate-/l*77.8%
associate-+l+77.8%
Simplified77.8%
Taylor expanded in y around 0 52.2%
if 3.0000000000000001e-83 < y Initial program 72.5%
associate-/l*77.2%
associate-+l+77.2%
Simplified77.2%
Taylor expanded in x around 0 65.0%
+-commutative65.0%
Simplified65.0%
div-inv65.0%
associate-/r*66.9%
Applied egg-rr66.9%
Final simplification56.5%
(FPCore (x y) :precision binary64 (if (<= y 1.65e-82) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 1.65e-82) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.65d-82) then
tmp = y / (x * (x + 1.0d0))
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.65e-82) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.65e-82: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.65e-82) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.65e-82) tmp = y / (x * (x + 1.0)); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.65e-82], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.65 \cdot 10^{-82}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 1.65000000000000011e-82Initial program 66.3%
associate-/l*77.8%
associate-+l+77.8%
Simplified77.8%
Taylor expanded in y around 0 52.2%
if 1.65000000000000011e-82 < y Initial program 72.5%
associate-/l*77.2%
associate-+l+77.2%
Simplified77.2%
Taylor expanded in x around 0 65.0%
+-commutative65.0%
Simplified65.0%
Final simplification56.0%
(FPCore (x y) :precision binary64 (if (<= x -105.0) (/ 1.0 x) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -105.0) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-105.0d0)) then
tmp = 1.0d0 / x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -105.0) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -105.0: tmp = 1.0 / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -105.0) tmp = Float64(1.0 / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -105.0) tmp = 1.0 / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -105.0], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -105:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -105Initial program 65.0%
associate-/l*71.3%
associate-+l+71.3%
Simplified71.3%
associate-*r/65.0%
associate-+r+65.0%
associate-/r*72.0%
clear-num71.9%
associate-+r+71.9%
associate-/l*83.4%
pow283.4%
Applied egg-rr83.4%
Taylor expanded in x around inf 79.4%
Taylor expanded in y around inf 5.8%
if -105 < x Initial program 69.0%
associate-/l*79.3%
associate-+l+79.3%
Simplified79.3%
Taylor expanded in x around 0 57.6%
+-commutative57.6%
Simplified57.6%
Taylor expanded in y around 0 34.6%
(FPCore (x y) :precision binary64 (/ x (* y (+ y 1.0))))
double code(double x, double y) {
return x / (y * (y + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / (y * (y + 1.0d0))
end function
public static double code(double x, double y) {
return x / (y * (y + 1.0));
}
def code(x, y): return x / (y * (y + 1.0))
function code(x, y) return Float64(x / Float64(y * Float64(y + 1.0))) end
function tmp = code(x, y) tmp = x / (y * (y + 1.0)); end
code[x_, y_] := N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y \cdot \left(y + 1\right)}
\end{array}
Initial program 68.2%
associate-/l*77.7%
associate-+l+77.7%
Simplified77.7%
Taylor expanded in x around 0 49.4%
+-commutative49.4%
Simplified49.4%
(FPCore (x y) :precision binary64 (/ 1.0 x))
double code(double x, double y) {
return 1.0 / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / x
end function
public static double code(double x, double y) {
return 1.0 / x;
}
def code(x, y): return 1.0 / x
function code(x, y) return Float64(1.0 / x) end
function tmp = code(x, y) tmp = 1.0 / x; end
code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x}
\end{array}
Initial program 68.2%
associate-/l*77.7%
associate-+l+77.7%
Simplified77.7%
associate-*r/68.2%
associate-+r+68.2%
associate-/r*73.9%
clear-num73.4%
associate-+r+73.4%
associate-/l*85.6%
pow285.6%
Applied egg-rr85.6%
Taylor expanded in x around inf 49.6%
Taylor expanded in y around inf 3.9%
(FPCore (x y) :precision binary64 (- x))
double code(double x, double y) {
return -x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -x
end function
public static double code(double x, double y) {
return -x;
}
def code(x, y): return -x
function code(x, y) return Float64(-x) end
function tmp = code(x, y) tmp = -x; end
code[x_, y_] := (-x)
\begin{array}{l}
\\
-x
\end{array}
Initial program 68.2%
associate-/l*77.7%
associate-+l+77.7%
Simplified77.7%
Taylor expanded in x around 0 49.4%
+-commutative49.4%
Simplified49.4%
Taylor expanded in y around 0 13.0%
neg-mul-113.0%
Simplified13.0%
Taylor expanded in y around inf 3.8%
neg-mul-13.8%
Simplified3.8%
(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 2024086
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))