
(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 10 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 z) (/ x (- t y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (1.0 / ((y - z) / (x / (t - y))));
}
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 - z) / (x / (t - y))))
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 - z) / (x / (t - y))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (1.0 / ((y - z) / (x / (t - y))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(1.0 / Float64(Float64(y - z) / Float64(x / Float64(t - y))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (1.0 / ((y - z) / (x / (t - y))));
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[(1.0 / N[(N[(y - z), $MachinePrecision] / N[(x / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{1}{\frac{y - z}{\frac{x}{t - y}}}
\end{array}
Initial program 98.8%
*-commutativeN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6498.8%
Applied egg-rr98.8%
Final simplification98.8%
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 (* y y)))) (t_2 (+ 1.0 (/ (/ x (- y z)) t))))
(if (<= t -6.2e-222)
t_2
(if (<= t 1.45e-272)
t_1
(if (<= t 2e-197)
(+ 1.0 (/ (/ x y) z))
(if (<= t 2.5e-102) t_1 t_2))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / (y * y));
double t_2 = 1.0 + ((x / (y - z)) / t);
double tmp;
if (t <= -6.2e-222) {
tmp = t_2;
} else if (t <= 1.45e-272) {
tmp = t_1;
} else if (t <= 2e-197) {
tmp = 1.0 + ((x / y) / z);
} else if (t <= 2.5e-102) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = 1.0d0 - (x / (y * y))
t_2 = 1.0d0 + ((x / (y - z)) / t)
if (t <= (-6.2d-222)) then
tmp = t_2
else if (t <= 1.45d-272) then
tmp = t_1
else if (t <= 2d-197) then
tmp = 1.0d0 + ((x / y) / z)
else if (t <= 2.5d-102) then
tmp = t_1
else
tmp = t_2
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 / (y * y));
double t_2 = 1.0 + ((x / (y - z)) / t);
double tmp;
if (t <= -6.2e-222) {
tmp = t_2;
} else if (t <= 1.45e-272) {
tmp = t_1;
} else if (t <= 2e-197) {
tmp = 1.0 + ((x / y) / z);
} else if (t <= 2.5e-102) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 - (x / (y * y)) t_2 = 1.0 + ((x / (y - z)) / t) tmp = 0 if t <= -6.2e-222: tmp = t_2 elif t <= 1.45e-272: tmp = t_1 elif t <= 2e-197: tmp = 1.0 + ((x / y) / z) elif t <= 2.5e-102: tmp = t_1 else: tmp = t_2 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(y * y))) t_2 = Float64(1.0 + Float64(Float64(x / Float64(y - z)) / t)) tmp = 0.0 if (t <= -6.2e-222) tmp = t_2; elseif (t <= 1.45e-272) tmp = t_1; elseif (t <= 2e-197) tmp = Float64(1.0 + Float64(Float64(x / y) / z)); elseif (t <= 2.5e-102) tmp = t_1; else tmp = t_2; 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 / (y * y));
t_2 = 1.0 + ((x / (y - z)) / t);
tmp = 0.0;
if (t <= -6.2e-222)
tmp = t_2;
elseif (t <= 1.45e-272)
tmp = t_1;
elseif (t <= 2e-197)
tmp = 1.0 + ((x / y) / z);
elseif (t <= 2.5e-102)
tmp = t_1;
else
tmp = t_2;
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[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.2e-222], t$95$2, If[LessEqual[t, 1.45e-272], t$95$1, If[LessEqual[t, 2e-197], N[(1.0 + N[(N[(x / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e-102], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 1 - \frac{x}{y \cdot y}\\
t_2 := 1 + \frac{\frac{x}{y - z}}{t}\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{-222}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-197}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-102}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -6.19999999999999959e-222 or 2.50000000000000013e-102 < t Initial program 98.9%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6489.1%
Simplified89.1%
if -6.19999999999999959e-222 < t < 1.44999999999999997e-272 or 2e-197 < t < 2.50000000000000013e-102Initial program 100.0%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6487.2%
Simplified87.2%
if 1.44999999999999997e-272 < t < 2e-197Initial program 91.9%
Taylor expanded in y around inf
Simplified83.6%
Taylor expanded in z around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6475.1%
Simplified75.1%
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 (/ (/ 1.0 t) (/ (- y z) x)))))
(if (<= t -4.4e-78)
t_1
(if (<= t 7e-101) (+ 1.0 (/ (/ x (- z y)) y)) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((1.0 / t) / ((y - z) / x));
double tmp;
if (t <= -4.4e-78) {
tmp = t_1;
} else if (t <= 7e-101) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = t_1;
}
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 + ((1.0d0 / t) / ((y - z) / x))
if (t <= (-4.4d-78)) then
tmp = t_1
else if (t <= 7d-101) then
tmp = 1.0d0 + ((x / (z - y)) / y)
else
tmp = t_1
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 + ((1.0 / t) / ((y - z) / x));
double tmp;
if (t <= -4.4e-78) {
tmp = t_1;
} else if (t <= 7e-101) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 + ((1.0 / t) / ((y - z) / x)) tmp = 0 if t <= -4.4e-78: tmp = t_1 elif t <= 7e-101: tmp = 1.0 + ((x / (z - y)) / y) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 + Float64(Float64(1.0 / t) / Float64(Float64(y - z) / x))) tmp = 0.0 if (t <= -4.4e-78) tmp = t_1; elseif (t <= 7e-101) tmp = Float64(1.0 + Float64(Float64(x / Float64(z - y)) / y)); else tmp = t_1; 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 + ((1.0 / t) / ((y - z) / x));
tmp = 0.0;
if (t <= -4.4e-78)
tmp = t_1;
elseif (t <= 7e-101)
tmp = 1.0 + ((x / (z - y)) / y);
else
tmp = t_1;
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[(N[(1.0 / t), $MachinePrecision] / N[(N[(y - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.4e-78], t$95$1, If[LessEqual[t, 7e-101], N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 1 + \frac{\frac{1}{t}}{\frac{y - z}{x}}\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-101}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.3999999999999998e-78 or 6.99999999999999989e-101 < t Initial program 99.9%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6495.6%
Simplified95.6%
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6495.5%
Applied egg-rr95.5%
if -4.3999999999999998e-78 < t < 6.99999999999999989e-101Initial program 96.8%
Taylor expanded in t around 0
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6492.5%
Simplified92.5%
Final simplification94.5%
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 (- y z)) t))))
(if (<= t -5.1e-70)
t_1
(if (<= t 7e-101) (+ 1.0 (/ (/ x (- z y)) y)) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((x / (y - z)) / t);
double tmp;
if (t <= -5.1e-70) {
tmp = t_1;
} else if (t <= 7e-101) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = t_1;
}
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 / (y - z)) / t)
if (t <= (-5.1d-70)) then
tmp = t_1
else if (t <= 7d-101) then
tmp = 1.0d0 + ((x / (z - y)) / y)
else
tmp = t_1
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 / (y - z)) / t);
double tmp;
if (t <= -5.1e-70) {
tmp = t_1;
} else if (t <= 7e-101) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 + ((x / (y - z)) / t) tmp = 0 if t <= -5.1e-70: tmp = t_1 elif t <= 7e-101: tmp = 1.0 + ((x / (z - y)) / y) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 + Float64(Float64(x / Float64(y - z)) / t)) tmp = 0.0 if (t <= -5.1e-70) tmp = t_1; elseif (t <= 7e-101) tmp = Float64(1.0 + Float64(Float64(x / Float64(z - y)) / y)); else tmp = t_1; 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 / (y - z)) / t);
tmp = 0.0;
if (t <= -5.1e-70)
tmp = t_1;
elseif (t <= 7e-101)
tmp = 1.0 + ((x / (z - y)) / y);
else
tmp = t_1;
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[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.1e-70], t$95$1, If[LessEqual[t, 7e-101], N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 1 + \frac{\frac{x}{y - z}}{t}\\
\mathbf{if}\;t \leq -5.1 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-101}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.10000000000000025e-70 or 6.99999999999999989e-101 < t Initial program 99.9%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6495.6%
Simplified95.6%
if -5.10000000000000025e-70 < t < 6.99999999999999989e-101Initial program 96.8%
Taylor expanded in t around 0
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6492.5%
Simplified92.5%
Final simplification94.5%
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 (- y z)) t))))
(if (<= t -4.3e-82)
t_1
(if (<= t 2.75e-101) (+ 1.0 (/ x (* y (- z y)))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((x / (y - z)) / t);
double tmp;
if (t <= -4.3e-82) {
tmp = t_1;
} else if (t <= 2.75e-101) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = t_1;
}
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 / (y - z)) / t)
if (t <= (-4.3d-82)) then
tmp = t_1
else if (t <= 2.75d-101) then
tmp = 1.0d0 + (x / (y * (z - y)))
else
tmp = t_1
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 / (y - z)) / t);
double tmp;
if (t <= -4.3e-82) {
tmp = t_1;
} else if (t <= 2.75e-101) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 + ((x / (y - z)) / t) tmp = 0 if t <= -4.3e-82: tmp = t_1 elif t <= 2.75e-101: tmp = 1.0 + (x / (y * (z - y))) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 + Float64(Float64(x / Float64(y - z)) / t)) tmp = 0.0 if (t <= -4.3e-82) tmp = t_1; elseif (t <= 2.75e-101) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); else tmp = t_1; 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 / (y - z)) / t);
tmp = 0.0;
if (t <= -4.3e-82)
tmp = t_1;
elseif (t <= 2.75e-101)
tmp = 1.0 + (x / (y * (z - y)));
else
tmp = t_1;
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[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.3e-82], t$95$1, If[LessEqual[t, 2.75e-101], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 1 + \frac{\frac{x}{y - z}}{t}\\
\mathbf{if}\;t \leq -4.3 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.75 \cdot 10^{-101}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.30000000000000019e-82 or 2.74999999999999986e-101 < t Initial program 99.9%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6495.0%
Simplified95.0%
if -4.30000000000000019e-82 < t < 2.74999999999999986e-101Initial program 96.8%
Taylor expanded in y around inf
Simplified91.4%
Final simplification93.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 (<= y -2.65e-142) 1.0 (if (<= y 2.55e-83) (- 1.0 (/ (/ x t) z)) (- 1.0 (/ x (* y y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.65e-142) {
tmp = 1.0;
} else if (y <= 2.55e-83) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 - (x / (y * 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 (y <= (-2.65d-142)) then
tmp = 1.0d0
else if (y <= 2.55d-83) then
tmp = 1.0d0 - ((x / t) / z)
else
tmp = 1.0d0 - (x / (y * 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 (y <= -2.65e-142) {
tmp = 1.0;
} else if (y <= 2.55e-83) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 - (x / (y * y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -2.65e-142: tmp = 1.0 elif y <= 2.55e-83: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 - (x / (y * y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.65e-142) tmp = 1.0; elseif (y <= 2.55e-83) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = Float64(1.0 - Float64(x / Float64(y * 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 (y <= -2.65e-142)
tmp = 1.0;
elseif (y <= 2.55e-83)
tmp = 1.0 - ((x / t) / z);
else
tmp = 1.0 - (x / (y * 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[y, -2.65e-142], 1.0, If[LessEqual[y, 2.55e-83], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{-142}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{-83}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -2.6499999999999999e-142Initial program 100.0%
Taylor expanded in x around 0
Simplified85.9%
if -2.6499999999999999e-142 < y < 2.55000000000000018e-83Initial program 96.2%
Taylor expanded in y around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6475.4%
Simplified75.4%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.6%
Applied egg-rr76.6%
if 2.55000000000000018e-83 < y Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6486.2%
Simplified86.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.05e-142) 1.0 (if (<= y 3.7e-84) (- 1.0 (/ x (* z t))) (- 1.0 (/ x (* y y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e-142) {
tmp = 1.0;
} else if (y <= 3.7e-84) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - (x / (y * 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 (y <= (-1.05d-142)) then
tmp = 1.0d0
else if (y <= 3.7d-84) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0 - (x / (y * 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 (y <= -1.05e-142) {
tmp = 1.0;
} else if (y <= 3.7e-84) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - (x / (y * y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.05e-142: tmp = 1.0 elif y <= 3.7e-84: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 - (x / (y * y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.05e-142) tmp = 1.0; elseif (y <= 3.7e-84) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = Float64(1.0 - Float64(x / Float64(y * 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 (y <= -1.05e-142)
tmp = 1.0;
elseif (y <= 3.7e-84)
tmp = 1.0 - (x / (z * t));
else
tmp = 1.0 - (x / (y * 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[y, -1.05e-142], 1.0, If[LessEqual[y, 3.7e-84], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-142}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-84}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -1.05e-142Initial program 100.0%
Taylor expanded in x around 0
Simplified85.9%
if -1.05e-142 < y < 3.6999999999999999e-84Initial program 96.2%
Taylor expanded in y around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6475.4%
Simplified75.4%
if 3.6999999999999999e-84 < y Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6486.2%
Simplified86.2%
Final simplification82.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 (<= y -2.65e-142) 1.0 (if (<= y 1.95e-113) (- 1.0 (/ x (* z t))) 1.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.65e-142) {
tmp = 1.0;
} else if (y <= 1.95e-113) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
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 <= (-2.65d-142)) then
tmp = 1.0d0
else if (y <= 1.95d-113) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0
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 <= -2.65e-142) {
tmp = 1.0;
} else if (y <= 1.95e-113) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -2.65e-142: tmp = 1.0 elif y <= 1.95e-113: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.65e-142) tmp = 1.0; elseif (y <= 1.95e-113) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = 1.0; 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 <= -2.65e-142)
tmp = 1.0;
elseif (y <= 1.95e-113)
tmp = 1.0 - (x / (z * t));
else
tmp = 1.0;
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[y, -2.65e-142], 1.0, If[LessEqual[y, 1.95e-113], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{-142}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-113}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.6499999999999999e-142 or 1.9499999999999999e-113 < y Initial program 100.0%
Taylor expanded in x around 0
Simplified84.9%
if -2.6499999999999999e-142 < y < 1.9499999999999999e-113Initial program 95.8%
Taylor expanded in y around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6474.8%
Simplified74.8%
Final simplification82.0%
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 z) (- t y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
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 - z) * (t - y)))
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 - z) * (t - y)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (x / ((y - z) * (t - y)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - z) * Float64(t - y)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (x / ((y - z) * (t - y)));
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[(N[(y - z), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{x}{\left(y - z\right) \cdot \left(t - y\right)}
\end{array}
Initial program 98.8%
Final simplification98.8%
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)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0;
}
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
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, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return 1.0 end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1
\end{array}
Initial program 98.8%
Taylor expanded in x around 0
Simplified74.7%
herbie shell --seed 2024139
(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)))))