
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (/ (/ 1.0 (- y t)) (/ (- z y) x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((1.0 / (y - t)) / ((z - y) / x));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + ((1.0d0 / (y - t)) / ((z - y) / x))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + ((1.0 / (y - t)) / ((z - y) / x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((1.0 / (y - t)) / ((z - y) / x))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(Float64(1.0 / Float64(y - t)) / Float64(Float64(z - y) / x))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((1.0 / (y - t)) / ((z - y) / x));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[(1.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{\frac{1}{y - t}}{\frac{z - y}{x}}
\end{array}
Initial program 96.9%
sub-neg96.9%
neg-mul-196.9%
*-commutative96.9%
*-commutative96.9%
associate-/r*98.5%
associate-*r/98.5%
metadata-eval98.5%
times-frac98.5%
*-lft-identity98.5%
neg-mul-198.5%
sub-neg98.5%
+-commutative98.5%
distribute-neg-out98.5%
remove-double-neg98.5%
sub-neg98.5%
Simplified98.5%
clear-num98.4%
inv-pow98.4%
div-inv98.4%
clear-num98.9%
Applied egg-rr98.9%
unpow-198.9%
associate-/r*98.9%
Simplified98.9%
Final simplification98.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ x (* t z)))))
(if (<= t -8e-120)
t_1
(if (<= t 1.5e-82)
(+ 1.0 (/ x (* y z)))
(if (<= t 1.95e-7)
(+ 1.0 (/ x (* y t)))
(if (<= t 3.3e+97) t_1 (+ 1.0 (/ (/ x t) y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / (t * z));
double tmp;
if (t <= -8e-120) {
tmp = t_1;
} else if (t <= 1.5e-82) {
tmp = 1.0 + (x / (y * z));
} else if (t <= 1.95e-7) {
tmp = 1.0 + (x / (y * t));
} else if (t <= 3.3e+97) {
tmp = t_1;
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - (x / (t * z))
if (t <= (-8d-120)) then
tmp = t_1
else if (t <= 1.5d-82) then
tmp = 1.0d0 + (x / (y * z))
else if (t <= 1.95d-7) then
tmp = 1.0d0 + (x / (y * t))
else if (t <= 3.3d+97) then
tmp = t_1
else
tmp = 1.0d0 + ((x / t) / y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / (t * z));
double tmp;
if (t <= -8e-120) {
tmp = t_1;
} else if (t <= 1.5e-82) {
tmp = 1.0 + (x / (y * z));
} else if (t <= 1.95e-7) {
tmp = 1.0 + (x / (y * t));
} else if (t <= 3.3e+97) {
tmp = t_1;
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 - (x / (t * z)) tmp = 0 if t <= -8e-120: tmp = t_1 elif t <= 1.5e-82: tmp = 1.0 + (x / (y * z)) elif t <= 1.95e-7: tmp = 1.0 + (x / (y * t)) elif t <= 3.3e+97: tmp = t_1 else: tmp = 1.0 + ((x / t) / y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 - Float64(x / Float64(t * z))) tmp = 0.0 if (t <= -8e-120) tmp = t_1; elseif (t <= 1.5e-82) tmp = Float64(1.0 + Float64(x / Float64(y * z))); elseif (t <= 1.95e-7) tmp = Float64(1.0 + Float64(x / Float64(y * t))); elseif (t <= 3.3e+97) tmp = t_1; else tmp = Float64(1.0 + Float64(Float64(x / t) / y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 - (x / (t * z));
tmp = 0.0;
if (t <= -8e-120)
tmp = t_1;
elseif (t <= 1.5e-82)
tmp = 1.0 + (x / (y * z));
elseif (t <= 1.95e-7)
tmp = 1.0 + (x / (y * t));
elseif (t <= 3.3e+97)
tmp = t_1;
else
tmp = 1.0 + ((x / t) / y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8e-120], t$95$1, If[LessEqual[t, 1.5e-82], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e-7], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e+97], t$95$1, N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 1 - \frac{x}{t \cdot z}\\
\mathbf{if}\;t \leq -8 \cdot 10^{-120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-82}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{-7}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if t < -7.99999999999999983e-120 or 1.95000000000000012e-7 < t < 3.3000000000000001e97Initial program 99.2%
Taylor expanded in y around 0 79.3%
if -7.99999999999999983e-120 < t < 1.4999999999999999e-82Initial program 91.0%
sub-neg91.0%
neg-mul-191.0%
*-commutative91.0%
*-commutative91.0%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
*-lft-identity99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 70.6%
associate-/r*75.9%
Simplified75.9%
Taylor expanded in y around inf 63.3%
*-commutative63.3%
Simplified63.3%
if 1.4999999999999999e-82 < t < 1.95000000000000012e-7Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
*-lft-identity99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 99.9%
associate-*r/99.9%
neg-mul-199.9%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in z around 0 54.4%
if 3.3000000000000001e97 < t Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
*-lft-identity99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 99.9%
associate-*r/99.9%
neg-mul-199.9%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in z around 0 89.6%
associate-/r*89.6%
div-inv89.6%
Applied egg-rr89.6%
un-div-inv89.6%
Applied egg-rr89.6%
Final simplification74.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -1.06e-119)
(- 1.0 (/ x (* t z)))
(if (<= t 9.2e-82)
(+ 1.0 (/ x (* y z)))
(if (<= t 2.1e-7)
(+ 1.0 (/ x (* y t)))
(if (<= t 6.2e+96) (- 1.0 (/ (/ x t) z)) (+ 1.0 (/ (/ x t) y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.06e-119) {
tmp = 1.0 - (x / (t * z));
} else if (t <= 9.2e-82) {
tmp = 1.0 + (x / (y * z));
} else if (t <= 2.1e-7) {
tmp = 1.0 + (x / (y * t));
} else if (t <= 6.2e+96) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.06d-119)) then
tmp = 1.0d0 - (x / (t * z))
else if (t <= 9.2d-82) then
tmp = 1.0d0 + (x / (y * z))
else if (t <= 2.1d-7) then
tmp = 1.0d0 + (x / (y * t))
else if (t <= 6.2d+96) then
tmp = 1.0d0 - ((x / t) / z)
else
tmp = 1.0d0 + ((x / t) / y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.06e-119) {
tmp = 1.0 - (x / (t * z));
} else if (t <= 9.2e-82) {
tmp = 1.0 + (x / (y * z));
} else if (t <= 2.1e-7) {
tmp = 1.0 + (x / (y * t));
} else if (t <= 6.2e+96) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -1.06e-119: tmp = 1.0 - (x / (t * z)) elif t <= 9.2e-82: tmp = 1.0 + (x / (y * z)) elif t <= 2.1e-7: tmp = 1.0 + (x / (y * t)) elif t <= 6.2e+96: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 + ((x / t) / y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.06e-119) tmp = Float64(1.0 - Float64(x / Float64(t * z))); elseif (t <= 9.2e-82) tmp = Float64(1.0 + Float64(x / Float64(y * z))); elseif (t <= 2.1e-7) tmp = Float64(1.0 + Float64(x / Float64(y * t))); elseif (t <= 6.2e+96) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = Float64(1.0 + Float64(Float64(x / t) / y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -1.06e-119)
tmp = 1.0 - (x / (t * z));
elseif (t <= 9.2e-82)
tmp = 1.0 + (x / (y * z));
elseif (t <= 2.1e-7)
tmp = 1.0 + (x / (y * t));
elseif (t <= 6.2e+96)
tmp = 1.0 - ((x / t) / z);
else
tmp = 1.0 + ((x / t) / y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -1.06e-119], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e-82], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-7], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e+96], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.06 \cdot 10^{-119}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-82}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-7}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+96}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if t < -1.05999999999999999e-119Initial program 99.0%
Taylor expanded in y around 0 79.3%
if -1.05999999999999999e-119 < t < 9.19999999999999988e-82Initial program 91.0%
sub-neg91.0%
neg-mul-191.0%
*-commutative91.0%
*-commutative91.0%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
*-lft-identity99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 70.6%
associate-/r*75.9%
Simplified75.9%
Taylor expanded in y around inf 63.3%
*-commutative63.3%
Simplified63.3%
if 9.19999999999999988e-82 < t < 2.1e-7Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
*-lft-identity99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 99.9%
associate-*r/99.9%
neg-mul-199.9%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in z around 0 54.4%
if 2.1e-7 < t < 6.1999999999999996e96Initial program 99.9%
clear-num99.7%
associate-/r/99.8%
*-commutative99.8%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 79.0%
associate-/r*79.0%
Simplified79.0%
if 6.1999999999999996e96 < t Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
*-lft-identity99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 99.9%
associate-*r/99.9%
neg-mul-199.9%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in z around 0 89.6%
associate-/r*89.6%
div-inv89.6%
Applied egg-rr89.6%
un-div-inv89.6%
Applied egg-rr89.6%
Final simplification74.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -3.9e-123)
(- 1.0 (/ x (* t z)))
(if (<= t 1.62e-84)
(+ 1.0 (/ (/ x z) y))
(if (<= t 2.05e-7)
(+ 1.0 (/ x (* y t)))
(if (<= t 4.6e+97) (- 1.0 (/ (/ x t) z)) (+ 1.0 (/ (/ x t) y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.9e-123) {
tmp = 1.0 - (x / (t * z));
} else if (t <= 1.62e-84) {
tmp = 1.0 + ((x / z) / y);
} else if (t <= 2.05e-7) {
tmp = 1.0 + (x / (y * t));
} else if (t <= 4.6e+97) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.9d-123)) then
tmp = 1.0d0 - (x / (t * z))
else if (t <= 1.62d-84) then
tmp = 1.0d0 + ((x / z) / y)
else if (t <= 2.05d-7) then
tmp = 1.0d0 + (x / (y * t))
else if (t <= 4.6d+97) then
tmp = 1.0d0 - ((x / t) / z)
else
tmp = 1.0d0 + ((x / t) / y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.9e-123) {
tmp = 1.0 - (x / (t * z));
} else if (t <= 1.62e-84) {
tmp = 1.0 + ((x / z) / y);
} else if (t <= 2.05e-7) {
tmp = 1.0 + (x / (y * t));
} else if (t <= 4.6e+97) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -3.9e-123: tmp = 1.0 - (x / (t * z)) elif t <= 1.62e-84: tmp = 1.0 + ((x / z) / y) elif t <= 2.05e-7: tmp = 1.0 + (x / (y * t)) elif t <= 4.6e+97: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 + ((x / t) / y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -3.9e-123) tmp = Float64(1.0 - Float64(x / Float64(t * z))); elseif (t <= 1.62e-84) tmp = Float64(1.0 + Float64(Float64(x / z) / y)); elseif (t <= 2.05e-7) tmp = Float64(1.0 + Float64(x / Float64(y * t))); elseif (t <= 4.6e+97) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = Float64(1.0 + Float64(Float64(x / t) / y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -3.9e-123)
tmp = 1.0 - (x / (t * z));
elseif (t <= 1.62e-84)
tmp = 1.0 + ((x / z) / y);
elseif (t <= 2.05e-7)
tmp = 1.0 + (x / (y * t));
elseif (t <= 4.6e+97)
tmp = 1.0 - ((x / t) / z);
else
tmp = 1.0 + ((x / t) / y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -3.9e-123], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.62e-84], N[(1.0 + N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.05e-7], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+97], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{-123}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\mathbf{elif}\;t \leq 1.62 \cdot 10^{-84}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y}\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{-7}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+97}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if t < -3.89999999999999976e-123Initial program 99.0%
Taylor expanded in y around 0 79.3%
if -3.89999999999999976e-123 < t < 1.62000000000000008e-84Initial program 91.0%
Taylor expanded in t around 0 83.6%
Taylor expanded in y around 0 63.3%
associate-*r/63.3%
*-commutative63.3%
associate-/r*65.5%
associate-*r/65.5%
mul-1-neg65.5%
Simplified65.5%
if 1.62000000000000008e-84 < t < 2.05e-7Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
*-lft-identity99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 99.9%
associate-*r/99.9%
neg-mul-199.9%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in z around 0 54.4%
if 2.05e-7 < t < 4.60000000000000011e97Initial program 99.9%
clear-num99.7%
associate-/r/99.8%
*-commutative99.8%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 79.0%
associate-/r*79.0%
Simplified79.0%
if 4.60000000000000011e97 < t Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
*-lft-identity99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 99.9%
associate-*r/99.9%
neg-mul-199.9%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in z around 0 89.6%
associate-/r*89.6%
div-inv89.6%
Applied egg-rr89.6%
un-div-inv89.6%
Applied egg-rr89.6%
Final simplification75.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -4.6e-80) (not (<= y 4.2e-35))) (+ 1.0 (/ (/ x y) (- z y))) (- 1.0 (/ (/ x z) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.6e-80) || !(y <= 4.2e-35)) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 - ((x / z) / t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-4.6d-80)) .or. (.not. (y <= 4.2d-35))) then
tmp = 1.0d0 + ((x / y) / (z - y))
else
tmp = 1.0d0 - ((x / z) / t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.6e-80) || !(y <= 4.2e-35)) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 - ((x / z) / t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -4.6e-80) or not (y <= 4.2e-35): tmp = 1.0 + ((x / y) / (z - y)) else: tmp = 1.0 - ((x / z) / t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -4.6e-80) || !(y <= 4.2e-35)) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); else tmp = Float64(1.0 - Float64(Float64(x / z) / t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -4.6e-80) || ~((y <= 4.2e-35)))
tmp = 1.0 + ((x / y) / (z - y));
else
tmp = 1.0 - ((x / z) / t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.6e-80], N[Not[LessEqual[y, 4.2e-35]], $MachinePrecision]], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{-80} \lor \neg \left(y \leq 4.2 \cdot 10^{-35}\right):\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\end{array}
\end{array}
if y < -4.5999999999999996e-80 or 4.2e-35 < y Initial program 100.0%
sub-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
*-commutative100.0%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
*-lft-identity100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
clear-num99.9%
inv-pow99.9%
div-inv99.9%
clear-num100.0%
Applied egg-rr100.0%
unpow-1100.0%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in y around inf 95.3%
Taylor expanded in x around 0 95.3%
associate-/r*94.8%
Simplified94.8%
if -4.5999999999999996e-80 < y < 4.2e-35Initial program 91.9%
sub-neg91.9%
neg-mul-191.9%
*-commutative91.9%
*-commutative91.9%
associate-/r*96.0%
associate-*r/96.0%
metadata-eval96.0%
times-frac96.0%
*-lft-identity96.0%
neg-mul-196.0%
sub-neg96.0%
+-commutative96.0%
distribute-neg-out96.0%
remove-double-neg96.0%
sub-neg96.0%
Simplified96.0%
clear-num96.0%
inv-pow96.0%
div-inv96.0%
clear-num97.3%
Applied egg-rr97.3%
unpow-197.3%
associate-/r*97.3%
Simplified97.3%
Taylor expanded in y around 0 75.5%
mul-1-neg75.5%
associate-/l/73.9%
distribute-neg-frac73.9%
distribute-neg-frac73.9%
Simplified73.9%
Final simplification86.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -4.8e-80) (not (<= y 1.65e-9))) (+ 1.0 (/ (/ x y) (- z y))) (+ 1.0 (/ (/ x z) (- y t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.8e-80) || !(y <= 1.65e-9)) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 + ((x / z) / (y - t));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-4.8d-80)) .or. (.not. (y <= 1.65d-9))) then
tmp = 1.0d0 + ((x / y) / (z - y))
else
tmp = 1.0d0 + ((x / z) / (y - t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.8e-80) || !(y <= 1.65e-9)) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 + ((x / z) / (y - t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -4.8e-80) or not (y <= 1.65e-9): tmp = 1.0 + ((x / y) / (z - y)) else: tmp = 1.0 + ((x / z) / (y - t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -4.8e-80) || !(y <= 1.65e-9)) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); else tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -4.8e-80) || ~((y <= 1.65e-9)))
tmp = 1.0 + ((x / y) / (z - y));
else
tmp = 1.0 + ((x / z) / (y - t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.8e-80], N[Not[LessEqual[y, 1.65e-9]], $MachinePrecision]], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-80} \lor \neg \left(y \leq 1.65 \cdot 10^{-9}\right):\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\end{array}
\end{array}
if y < -4.7999999999999998e-80 or 1.65000000000000009e-9 < y Initial program 100.0%
sub-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
*-commutative100.0%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
*-lft-identity100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
clear-num100.0%
inv-pow100.0%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
unpow-199.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in y around inf 96.4%
Taylor expanded in x around 0 96.4%
associate-/r*95.8%
Simplified95.8%
if -4.7999999999999998e-80 < y < 1.65000000000000009e-9Initial program 92.5%
sub-neg92.5%
neg-mul-192.5%
*-commutative92.5%
*-commutative92.5%
associate-/r*96.3%
associate-*r/96.3%
metadata-eval96.3%
times-frac96.3%
*-lft-identity96.3%
neg-mul-196.3%
sub-neg96.3%
+-commutative96.3%
distribute-neg-out96.3%
remove-double-neg96.3%
sub-neg96.3%
Simplified96.3%
Taylor expanded in z around inf 83.6%
associate-/r*84.1%
Simplified84.1%
Final simplification90.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -1.55e-59) (+ 1.0 (/ (/ x z) (- y t))) (if (<= z 4.4e-78) (- 1.0 (/ x (* y (- y t)))) (- 1.0 (/ (/ x t) z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e-59) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 4.4e-78) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.55d-59)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= 4.4d-78) then
tmp = 1.0d0 - (x / (y * (y - t)))
else
tmp = 1.0d0 - ((x / t) / z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e-59) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 4.4e-78) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.55e-59: tmp = 1.0 + ((x / z) / (y - t)) elif z <= 4.4e-78: tmp = 1.0 - (x / (y * (y - t))) else: tmp = 1.0 - ((x / t) / z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.55e-59) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 4.4e-78) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); else tmp = Float64(1.0 - Float64(Float64(x / t) / z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.55e-59)
tmp = 1.0 + ((x / z) / (y - t));
elseif (z <= 4.4e-78)
tmp = 1.0 - (x / (y * (y - t)));
else
tmp = 1.0 - ((x / t) / z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e-59], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e-78], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-59}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-78}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if z < -1.55e-59Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*97.6%
associate-*r/97.6%
metadata-eval97.6%
times-frac97.6%
*-lft-identity97.6%
neg-mul-197.6%
sub-neg97.6%
+-commutative97.6%
distribute-neg-out97.6%
remove-double-neg97.6%
sub-neg97.6%
Simplified97.6%
Taylor expanded in z around inf 96.4%
associate-/r*94.0%
Simplified94.0%
if -1.55e-59 < z < 4.3999999999999998e-78Initial program 91.5%
Taylor expanded in z around 0 84.0%
if 4.3999999999999998e-78 < z Initial program 100.0%
clear-num100.0%
associate-/r/100.0%
*-commutative100.0%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 85.0%
associate-/r*83.8%
Simplified83.8%
Final simplification87.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -3.8e-57) (+ 1.0 (/ (/ x z) (- y t))) (if (<= z 7.8e-82) (- 1.0 (/ (/ x y) (- y t))) (- 1.0 (/ (/ x t) z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e-57) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 7.8e-82) {
tmp = 1.0 - ((x / y) / (y - t));
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-3.8d-57)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= 7.8d-82) then
tmp = 1.0d0 - ((x / y) / (y - t))
else
tmp = 1.0d0 - ((x / t) / z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e-57) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 7.8e-82) {
tmp = 1.0 - ((x / y) / (y - t));
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -3.8e-57: tmp = 1.0 + ((x / z) / (y - t)) elif z <= 7.8e-82: tmp = 1.0 - ((x / y) / (y - t)) else: tmp = 1.0 - ((x / t) / z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e-57) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 7.8e-82) tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - t))); else tmp = Float64(1.0 - Float64(Float64(x / t) / z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -3.8e-57)
tmp = 1.0 + ((x / z) / (y - t));
elseif (z <= 7.8e-82)
tmp = 1.0 - ((x / y) / (y - t));
else
tmp = 1.0 - ((x / t) / z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e-57], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e-82], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-57}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-82}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if z < -3.7999999999999997e-57Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*97.6%
associate-*r/97.6%
metadata-eval97.6%
times-frac97.6%
*-lft-identity97.6%
neg-mul-197.6%
sub-neg97.6%
+-commutative97.6%
distribute-neg-out97.6%
remove-double-neg97.6%
sub-neg97.6%
Simplified97.6%
Taylor expanded in z around inf 96.4%
associate-/r*94.0%
Simplified94.0%
if -3.7999999999999997e-57 < z < 7.79999999999999947e-82Initial program 91.4%
clear-num91.3%
associate-/r/90.6%
*-commutative90.6%
associate-/r*90.5%
Applied egg-rr90.5%
Taylor expanded in z around 0 83.8%
associate-/r*87.0%
Simplified87.0%
if 7.79999999999999947e-82 < z Initial program 100.0%
clear-num100.0%
associate-/r/100.0%
*-commutative100.0%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 84.0%
associate-/r*82.9%
Simplified82.9%
Final simplification87.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -4.1e-274)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 1.9e-118)
(+ 1.0 (/ (/ x y) (- z y)))
(- 1.0 (/ (/ x t) (- z y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.1e-274) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.9e-118) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4.1d-274)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 1.9d-118) then
tmp = 1.0d0 + ((x / y) / (z - y))
else
tmp = 1.0d0 - ((x / t) / (z - y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.1e-274) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.9e-118) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -4.1e-274: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 1.9e-118: tmp = 1.0 + ((x / y) / (z - y)) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -4.1e-274) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 1.9e-118) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); else tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -4.1e-274)
tmp = 1.0 + ((x / z) / (y - t));
elseif (t <= 1.9e-118)
tmp = 1.0 + ((x / y) / (z - y));
else
tmp = 1.0 - ((x / t) / (z - y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -4.1e-274], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e-118], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{-274}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-118}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if t < -4.09999999999999987e-274Initial program 98.3%
sub-neg98.3%
neg-mul-198.3%
*-commutative98.3%
*-commutative98.3%
associate-/r*97.7%
associate-*r/97.7%
metadata-eval97.7%
times-frac97.7%
*-lft-identity97.7%
neg-mul-197.7%
sub-neg97.7%
+-commutative97.7%
distribute-neg-out97.7%
remove-double-neg97.7%
sub-neg97.7%
Simplified97.7%
Taylor expanded in z around inf 80.6%
associate-/r*79.4%
Simplified79.4%
if -4.09999999999999987e-274 < t < 1.9e-118Initial program 86.1%
sub-neg86.1%
neg-mul-186.1%
*-commutative86.1%
*-commutative86.1%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
*-lft-identity100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
clear-num99.9%
inv-pow99.9%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
unpow-199.9%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in y around inf 94.3%
Taylor expanded in x around 0 83.9%
associate-/r*94.3%
Simplified94.3%
if 1.9e-118 < t Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*98.9%
associate-*r/98.9%
metadata-eval98.9%
times-frac98.9%
*-lft-identity98.9%
neg-mul-198.9%
sub-neg98.9%
+-commutative98.9%
distribute-neg-out98.9%
remove-double-neg98.9%
sub-neg98.9%
Simplified98.9%
Taylor expanded in t around inf 94.4%
associate-*r/94.4%
neg-mul-194.4%
associate-/r*94.4%
Simplified94.4%
Final simplification87.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 9e-82) (+ 1.0 (/ x (* y z))) (+ 1.0 (/ x (* y t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 9e-82) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 9d-82) then
tmp = 1.0d0 + (x / (y * z))
else
tmp = 1.0d0 + (x / (y * t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 9e-82) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 9e-82: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 + (x / (y * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 9e-82) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = Float64(1.0 + Float64(x / Float64(y * t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 9e-82)
tmp = 1.0 + (x / (y * z));
else
tmp = 1.0 + (x / (y * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 9e-82], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 9 \cdot 10^{-82}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if t < 8.9999999999999997e-82Initial program 95.5%
sub-neg95.5%
neg-mul-195.5%
*-commutative95.5%
*-commutative95.5%
associate-/r*98.3%
associate-*r/98.3%
metadata-eval98.3%
times-frac98.3%
*-lft-identity98.3%
neg-mul-198.3%
sub-neg98.3%
+-commutative98.3%
distribute-neg-out98.3%
remove-double-neg98.3%
sub-neg98.3%
Simplified98.3%
Taylor expanded in z around inf 78.0%
associate-/r*78.8%
Simplified78.8%
Taylor expanded in y around inf 59.6%
*-commutative59.6%
Simplified59.6%
if 8.9999999999999997e-82 < t Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*98.7%
associate-*r/98.7%
metadata-eval98.7%
times-frac98.7%
*-lft-identity98.7%
neg-mul-198.7%
sub-neg98.7%
+-commutative98.7%
distribute-neg-out98.7%
remove-double-neg98.7%
sub-neg98.7%
Simplified98.7%
Taylor expanded in t around inf 98.7%
associate-*r/98.7%
neg-mul-198.7%
associate-/r*98.7%
Simplified98.7%
Taylor expanded in z around 0 74.3%
Final simplification64.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (/ (/ x (- z y)) (- y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((x / (z - y)) / (y - t));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + ((x / (z - y)) / (y - t))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + ((x / (z - y)) / (y - t));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((x / (z - y)) / (y - t))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(Float64(x / Float64(z - y)) / Float64(y - t))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((x / (z - y)) / (y - t));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{\frac{x}{z - y}}{y - t}
\end{array}
Initial program 96.9%
sub-neg96.9%
neg-mul-196.9%
*-commutative96.9%
*-commutative96.9%
associate-/r*98.5%
associate-*r/98.5%
metadata-eval98.5%
times-frac98.5%
*-lft-identity98.5%
neg-mul-198.5%
sub-neg98.5%
+-commutative98.5%
distribute-neg-out98.5%
remove-double-neg98.5%
sub-neg98.5%
Simplified98.5%
Final simplification98.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (/ x (* y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (x / (y * t));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (x / (y * t))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / (y * t));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (x / (y * t))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(y * t))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (x / (y * t));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{x}{y \cdot t}
\end{array}
Initial program 96.9%
sub-neg96.9%
neg-mul-196.9%
*-commutative96.9%
*-commutative96.9%
associate-/r*98.5%
associate-*r/98.5%
metadata-eval98.5%
times-frac98.5%
*-lft-identity98.5%
neg-mul-198.5%
sub-neg98.5%
+-commutative98.5%
distribute-neg-out98.5%
remove-double-neg98.5%
sub-neg98.5%
Simplified98.5%
Taylor expanded in t around inf 80.2%
associate-*r/80.2%
neg-mul-180.2%
associate-/r*80.2%
Simplified80.2%
Taylor expanded in z around 0 57.6%
Final simplification57.6%
herbie shell --seed 2024036
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
:precision binary64
(- 1.0 (/ x (* (- y z) (- y t)))))