
(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 11 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 (/ (/ 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 98.8%
sub-neg98.8%
neg-mul-198.8%
*-commutative98.8%
*-commutative98.8%
associate-/r*98.8%
associate-*r/98.8%
metadata-eval98.8%
times-frac98.8%
*-lft-identity98.8%
neg-mul-198.8%
sub-neg98.8%
+-commutative98.8%
distribute-neg-out98.8%
remove-double-neg98.8%
sub-neg98.8%
Simplified98.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 (* z t)))) (t_2 (+ 1.0 (/ x (* z y)))))
(if (<= z -3.9e+18)
t_2
(if (<= z -3.2e-50)
t_1
(if (<= z -3e-71)
t_2
(if (<= z 1.45e-155) (+ 1.0 (/ x (* y t))) 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 / (z * t));
double t_2 = 1.0 + (x / (z * y));
double tmp;
if (z <= -3.9e+18) {
tmp = t_2;
} else if (z <= -3.2e-50) {
tmp = t_1;
} else if (z <= -3e-71) {
tmp = t_2;
} else if (z <= 1.45e-155) {
tmp = 1.0 + (x / (y * t));
} 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) :: t_2
real(8) :: tmp
t_1 = 1.0d0 - (x / (z * t))
t_2 = 1.0d0 + (x / (z * y))
if (z <= (-3.9d+18)) then
tmp = t_2
else if (z <= (-3.2d-50)) then
tmp = t_1
else if (z <= (-3d-71)) then
tmp = t_2
else if (z <= 1.45d-155) then
tmp = 1.0d0 + (x / (y * t))
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 / (z * t));
double t_2 = 1.0 + (x / (z * y));
double tmp;
if (z <= -3.9e+18) {
tmp = t_2;
} else if (z <= -3.2e-50) {
tmp = t_1;
} else if (z <= -3e-71) {
tmp = t_2;
} else if (z <= 1.45e-155) {
tmp = 1.0 + (x / (y * t));
} 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 / (z * t)) t_2 = 1.0 + (x / (z * y)) tmp = 0 if z <= -3.9e+18: tmp = t_2 elif z <= -3.2e-50: tmp = t_1 elif z <= -3e-71: tmp = t_2 elif z <= 1.45e-155: tmp = 1.0 + (x / (y * t)) 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(x / Float64(z * t))) t_2 = Float64(1.0 + Float64(x / Float64(z * y))) tmp = 0.0 if (z <= -3.9e+18) tmp = t_2; elseif (z <= -3.2e-50) tmp = t_1; elseif (z <= -3e-71) tmp = t_2; elseif (z <= 1.45e-155) tmp = Float64(1.0 + Float64(x / Float64(y * t))); 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 / (z * t));
t_2 = 1.0 + (x / (z * y));
tmp = 0.0;
if (z <= -3.9e+18)
tmp = t_2;
elseif (z <= -3.2e-50)
tmp = t_1;
elseif (z <= -3e-71)
tmp = t_2;
elseif (z <= 1.45e-155)
tmp = 1.0 + (x / (y * t));
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[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.9e+18], t$95$2, If[LessEqual[z, -3.2e-50], t$95$1, If[LessEqual[z, -3e-71], t$95$2, If[LessEqual[z, 1.45e-155], N[(1.0 + N[(x / N[(y * t), $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{x}{z \cdot t}\\
t_2 := 1 + \frac{x}{z \cdot y}\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-71}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-155}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.9e18 or -3.2e-50 < z < -3.0000000000000001e-71Initial 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%
Taylor expanded in z around inf 97.4%
associate-/r*97.4%
Simplified97.4%
Taylor expanded in y around inf 82.8%
*-commutative82.8%
Simplified82.8%
if -3.9e18 < z < -3.2e-50 or 1.45000000000000005e-155 < z Initial program 99.9%
Taylor expanded in y around 0 73.9%
if -3.0000000000000001e-71 < z < 1.45000000000000005e-155Initial program 95.9%
sub-neg95.9%
neg-mul-195.9%
*-commutative95.9%
*-commutative95.9%
associate-/r*95.8%
associate-*r/95.8%
metadata-eval95.8%
times-frac95.8%
*-lft-identity95.8%
neg-mul-195.8%
sub-neg95.8%
+-commutative95.8%
distribute-neg-out95.8%
remove-double-neg95.8%
sub-neg95.8%
Simplified95.8%
Taylor expanded in t around inf 73.5%
associate-*r/73.5%
neg-mul-173.5%
associate-/r*76.2%
Simplified76.2%
Taylor expanded in z around 0 67.7%
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
(let* ((t_1 (+ 1.0 (/ x (* z y)))))
(if (<= z -3.6e+18)
t_1
(if (<= z -3e-50)
(- 1.0 (/ x (* z t)))
(if (<= z -3.3e-71)
t_1
(if (<= z 2.8e-155) (+ 1.0 (/ x (* 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 t_1 = 1.0 + (x / (z * y));
double tmp;
if (z <= -3.6e+18) {
tmp = t_1;
} else if (z <= -3e-50) {
tmp = 1.0 - (x / (z * t));
} else if (z <= -3.3e-71) {
tmp = t_1;
} else if (z <= 2.8e-155) {
tmp = 1.0 + (x / (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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 + (x / (z * y))
if (z <= (-3.6d+18)) then
tmp = t_1
else if (z <= (-3d-50)) then
tmp = 1.0d0 - (x / (z * t))
else if (z <= (-3.3d-71)) then
tmp = t_1
else if (z <= 2.8d-155) then
tmp = 1.0d0 + (x / (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 t_1 = 1.0 + (x / (z * y));
double tmp;
if (z <= -3.6e+18) {
tmp = t_1;
} else if (z <= -3e-50) {
tmp = 1.0 - (x / (z * t));
} else if (z <= -3.3e-71) {
tmp = t_1;
} else if (z <= 2.8e-155) {
tmp = 1.0 + (x / (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): t_1 = 1.0 + (x / (z * y)) tmp = 0 if z <= -3.6e+18: tmp = t_1 elif z <= -3e-50: tmp = 1.0 - (x / (z * t)) elif z <= -3.3e-71: tmp = t_1 elif z <= 2.8e-155: tmp = 1.0 + (x / (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) t_1 = Float64(1.0 + Float64(x / Float64(z * y))) tmp = 0.0 if (z <= -3.6e+18) tmp = t_1; elseif (z <= -3e-50) tmp = Float64(1.0 - Float64(x / Float64(z * t))); elseif (z <= -3.3e-71) tmp = t_1; elseif (z <= 2.8e-155) tmp = Float64(1.0 + Float64(x / 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)
t_1 = 1.0 + (x / (z * y));
tmp = 0.0;
if (z <= -3.6e+18)
tmp = t_1;
elseif (z <= -3e-50)
tmp = 1.0 - (x / (z * t));
elseif (z <= -3.3e-71)
tmp = t_1;
elseif (z <= 2.8e-155)
tmp = 1.0 + (x / (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_] := Block[{t$95$1 = N[(1.0 + N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e+18], t$95$1, If[LessEqual[z, -3e-50], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.3e-71], t$95$1, If[LessEqual[z, 2.8e-155], N[(1.0 + N[(x / 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}
t_1 := 1 + \frac{x}{z \cdot y}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-50}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-155}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if z < -3.6e18 or -2.9999999999999999e-50 < z < -3.3000000000000002e-71Initial 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%
Taylor expanded in z around inf 97.4%
associate-/r*97.4%
Simplified97.4%
Taylor expanded in y around inf 82.8%
*-commutative82.8%
Simplified82.8%
if -3.6e18 < z < -2.9999999999999999e-50Initial program 100.0%
Taylor expanded in y around 0 68.4%
if -3.3000000000000002e-71 < z < 2.8e-155Initial program 95.9%
sub-neg95.9%
neg-mul-195.9%
*-commutative95.9%
*-commutative95.9%
associate-/r*95.8%
associate-*r/95.8%
metadata-eval95.8%
times-frac95.8%
*-lft-identity95.8%
neg-mul-195.8%
sub-neg95.8%
+-commutative95.8%
distribute-neg-out95.8%
remove-double-neg95.8%
sub-neg95.8%
Simplified95.8%
Taylor expanded in t around inf 73.5%
associate-*r/73.5%
neg-mul-173.5%
associate-/r*76.2%
Simplified76.2%
Taylor expanded in z around 0 67.7%
if 2.8e-155 < z Initial program 99.9%
clear-num99.9%
associate-/r/99.9%
*-commutative99.9%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 74.7%
associate-/r*74.4%
Simplified74.4%
Final simplification74.6%
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 (* z y)))))
(if (<= z -3.8e+18)
t_1
(if (<= z -3.2e-50)
(- 1.0 (/ x (* z t)))
(if (<= z -3.3e-71)
t_1
(if (<= z 8.6e-155) (+ 1.0 (/ (/ x t) y)) (- 1.0 (/ (/ x t) z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + (x / (z * y));
double tmp;
if (z <= -3.8e+18) {
tmp = t_1;
} else if (z <= -3.2e-50) {
tmp = 1.0 - (x / (z * t));
} else if (z <= -3.3e-71) {
tmp = t_1;
} else if (z <= 8.6e-155) {
tmp = 1.0 + ((x / t) / y);
} 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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 + (x / (z * y))
if (z <= (-3.8d+18)) then
tmp = t_1
else if (z <= (-3.2d-50)) then
tmp = 1.0d0 - (x / (z * t))
else if (z <= (-3.3d-71)) then
tmp = t_1
else if (z <= 8.6d-155) then
tmp = 1.0d0 + ((x / t) / y)
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 t_1 = 1.0 + (x / (z * y));
double tmp;
if (z <= -3.8e+18) {
tmp = t_1;
} else if (z <= -3.2e-50) {
tmp = 1.0 - (x / (z * t));
} else if (z <= -3.3e-71) {
tmp = t_1;
} else if (z <= 8.6e-155) {
tmp = 1.0 + ((x / t) / y);
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 + (x / (z * y)) tmp = 0 if z <= -3.8e+18: tmp = t_1 elif z <= -3.2e-50: tmp = 1.0 - (x / (z * t)) elif z <= -3.3e-71: tmp = t_1 elif z <= 8.6e-155: tmp = 1.0 + ((x / t) / y) else: tmp = 1.0 - ((x / t) / z) 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(z * y))) tmp = 0.0 if (z <= -3.8e+18) tmp = t_1; elseif (z <= -3.2e-50) tmp = Float64(1.0 - Float64(x / Float64(z * t))); elseif (z <= -3.3e-71) tmp = t_1; elseif (z <= 8.6e-155) tmp = Float64(1.0 + Float64(Float64(x / t) / y)); 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)
t_1 = 1.0 + (x / (z * y));
tmp = 0.0;
if (z <= -3.8e+18)
tmp = t_1;
elseif (z <= -3.2e-50)
tmp = 1.0 - (x / (z * t));
elseif (z <= -3.3e-71)
tmp = t_1;
elseif (z <= 8.6e-155)
tmp = 1.0 + ((x / t) / y);
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_] := Block[{t$95$1 = N[(1.0 + N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+18], t$95$1, If[LessEqual[z, -3.2e-50], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.3e-71], t$95$1, If[LessEqual[z, 8.6e-155], N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $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}
t_1 := 1 + \frac{x}{z \cdot y}\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-50}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-155}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if z < -3.8e18 or -3.2e-50 < z < -3.3000000000000002e-71Initial 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%
Taylor expanded in z around inf 97.4%
associate-/r*97.4%
Simplified97.4%
Taylor expanded in y around inf 82.8%
*-commutative82.8%
Simplified82.8%
if -3.8e18 < z < -3.2e-50Initial program 100.0%
Taylor expanded in y around 0 68.4%
if -3.3000000000000002e-71 < z < 8.60000000000000016e-155Initial program 95.9%
clear-num95.8%
associate-/r/95.8%
*-commutative95.8%
associate-/r*95.8%
Applied egg-rr95.8%
Taylor expanded in z around 0 89.0%
associate-/r*85.4%
Simplified85.4%
Taylor expanded in y around 0 67.7%
mul-1-neg67.7%
associate-/r*68.0%
distribute-neg-frac68.0%
Simplified68.0%
if 8.60000000000000016e-155 < z Initial program 99.9%
clear-num99.9%
associate-/r/99.9%
*-commutative99.9%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 74.7%
associate-/r*74.4%
Simplified74.4%
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 (or (<= z -2.85e-195) (not (<= z 4.5e-159))) (+ 1.0 (/ (/ x z) (- y t))) (+ 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 ((z <= -2.85e-195) || !(z <= 4.5e-159)) {
tmp = 1.0 + ((x / z) / (y - t));
} 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 ((z <= (-2.85d-195)) .or. (.not. (z <= 4.5d-159))) then
tmp = 1.0d0 + ((x / z) / (y - t))
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 ((z <= -2.85e-195) || !(z <= 4.5e-159)) {
tmp = 1.0 + ((x / z) / (y - t));
} 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 (z <= -2.85e-195) or not (z <= 4.5e-159): tmp = 1.0 + ((x / z) / (y - t)) 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 ((z <= -2.85e-195) || !(z <= 4.5e-159)) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); 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 ((z <= -2.85e-195) || ~((z <= 4.5e-159)))
tmp = 1.0 + ((x / z) / (y - t));
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[Or[LessEqual[z, -2.85e-195], N[Not[LessEqual[z, 4.5e-159]], $MachinePrecision]], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $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}\;z \leq -2.85 \cdot 10^{-195} \lor \neg \left(z \leq 4.5 \cdot 10^{-159}\right):\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -2.85e-195 or 4.49999999999999989e-159 < z 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 z around inf 88.6%
associate-/r*88.6%
Simplified88.6%
if -2.85e-195 < z < 4.49999999999999989e-159Initial program 94.4%
clear-num94.4%
associate-/r/94.4%
*-commutative94.4%
associate-/r*94.4%
Applied egg-rr94.4%
Taylor expanded in z around 0 90.1%
associate-/r*85.2%
Simplified85.2%
Taylor expanded in y around 0 70.5%
mul-1-neg70.5%
associate-/r*70.9%
distribute-neg-frac70.9%
Simplified70.9%
Final simplification85.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 (or (<= z -3.3e-62) (not (<= z 9.8e-155))) (+ 1.0 (/ (/ x z) (- y t))) (- 1.0 (/ x (* y (- y t))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.3e-62) || !(z <= 9.8e-155)) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 - (x / (y * (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 ((z <= (-3.3d-62)) .or. (.not. (z <= 9.8d-155))) then
tmp = 1.0d0 + ((x / z) / (y - t))
else
tmp = 1.0d0 - (x / (y * (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 ((z <= -3.3e-62) || !(z <= 9.8e-155)) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 - (x / (y * (y - t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -3.3e-62) or not (z <= 9.8e-155): tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 - (x / (y * (y - t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3.3e-62) || !(z <= 9.8e-155)) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(1.0 - Float64(x / Float64(y * 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 ((z <= -3.3e-62) || ~((z <= 9.8e-155)))
tmp = 1.0 + ((x / z) / (y - t));
else
tmp = 1.0 - (x / (y * (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[z, -3.3e-62], N[Not[LessEqual[z, 9.8e-155]], $MachinePrecision]], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-62} \lor \neg \left(z \leq 9.8 \cdot 10^{-155}\right):\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if z < -3.30000000000000004e-62 or 9.80000000000000026e-155 < z Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
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%
Taylor expanded in z around inf 93.7%
associate-/r*93.7%
Simplified93.7%
if -3.30000000000000004e-62 < z < 9.80000000000000026e-155Initial program 96.0%
Taylor expanded in z around 0 89.3%
Final simplification92.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 (<= z -2.2e-60) (not (<= z 9.8e-155))) (+ 1.0 (/ (/ x z) (- y t))) (- 1.0 (/ (/ x y) (- y t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.2e-60) || !(z <= 9.8e-155)) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 - ((x / y) / (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 ((z <= (-2.2d-60)) .or. (.not. (z <= 9.8d-155))) then
tmp = 1.0d0 + ((x / z) / (y - t))
else
tmp = 1.0d0 - ((x / y) / (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 ((z <= -2.2e-60) || !(z <= 9.8e-155)) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 - ((x / y) / (y - t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -2.2e-60) or not (z <= 9.8e-155): tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 - ((x / y) / (y - t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -2.2e-60) || !(z <= 9.8e-155)) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(1.0 - Float64(Float64(x / y) / 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 ((z <= -2.2e-60) || ~((z <= 9.8e-155)))
tmp = 1.0 + ((x / z) / (y - t));
else
tmp = 1.0 - ((x / y) / (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[z, -2.2e-60], N[Not[LessEqual[z, 9.8e-155]], $MachinePrecision]], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / y), $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}\;z \leq -2.2 \cdot 10^{-60} \lor \neg \left(z \leq 9.8 \cdot 10^{-155}\right):\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\
\end{array}
\end{array}
if z < -2.1999999999999999e-60 or 9.80000000000000026e-155 < z Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
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%
Taylor expanded in z around inf 93.7%
associate-/r*93.7%
Simplified93.7%
if -2.1999999999999999e-60 < z < 9.80000000000000026e-155Initial program 96.0%
clear-num96.0%
associate-/r/96.0%
*-commutative96.0%
associate-/r*96.0%
Applied egg-rr96.0%
Taylor expanded in z around 0 89.3%
associate-/r*85.8%
Simplified85.8%
Final simplification91.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 (<= z -8.8e-28) (not (<= z 9e-54))) (+ 1.0 (/ x (* z t))) (+ 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 ((z <= -8.8e-28) || !(z <= 9e-54)) {
tmp = 1.0 + (x / (z * t));
} 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 ((z <= (-8.8d-28)) .or. (.not. (z <= 9d-54))) then
tmp = 1.0d0 + (x / (z * t))
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 ((z <= -8.8e-28) || !(z <= 9e-54)) {
tmp = 1.0 + (x / (z * t));
} 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 (z <= -8.8e-28) or not (z <= 9e-54): tmp = 1.0 + (x / (z * t)) 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 ((z <= -8.8e-28) || !(z <= 9e-54)) tmp = Float64(1.0 + Float64(x / Float64(z * t))); 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 ((z <= -8.8e-28) || ~((z <= 9e-54)))
tmp = 1.0 + (x / (z * t));
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[Or[LessEqual[z, -8.8e-28], N[Not[LessEqual[z, 9e-54]], $MachinePrecision]], N[(1.0 + N[(x / N[(z * t), $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}\;z \leq -8.8 \cdot 10^{-28} \lor \neg \left(z \leq 9 \cdot 10^{-54}\right):\\
\;\;\;\;1 + \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -8.79999999999999984e-28 or 8.9999999999999997e-54 < z Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
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.9%
Simplified99.9%
Taylor expanded in y around 0 77.5%
mul-1-neg77.5%
associate-/l/77.5%
distribute-neg-frac77.5%
distribute-neg-frac77.5%
Simplified77.5%
expm1-log1p-u75.3%
expm1-udef75.3%
add-cbrt-cube74.6%
add-cbrt-cube75.3%
frac-2neg75.3%
remove-double-neg75.3%
associate-/l/75.3%
frac-2neg75.3%
add-sqr-sqrt33.3%
sqrt-unprod67.0%
sqr-neg67.0%
sqrt-unprod40.7%
add-sqr-sqrt73.2%
distribute-rgt-neg-out73.2%
remove-double-neg73.2%
Applied egg-rr73.2%
expm1-def73.2%
expm1-log1p75.5%
*-commutative75.5%
Simplified75.5%
if -8.79999999999999984e-28 < z < 8.9999999999999997e-54Initial program 97.3%
sub-neg97.3%
neg-mul-197.3%
*-commutative97.3%
*-commutative97.3%
associate-/r*97.2%
associate-*r/97.2%
metadata-eval97.2%
times-frac97.2%
*-lft-identity97.2%
neg-mul-197.2%
sub-neg97.2%
+-commutative97.2%
distribute-neg-out97.2%
remove-double-neg97.2%
sub-neg97.2%
Simplified97.2%
Taylor expanded in t around inf 74.6%
associate-*r/74.6%
neg-mul-174.6%
associate-/r*76.4%
Simplified76.4%
Taylor expanded in z around 0 63.8%
Final simplification70.5%
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 -2e-71) (+ 1.0 (/ x (* z y))) (if (<= z 2.7e-54) (+ 1.0 (/ x (* y t))) (+ 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 (z <= -2e-71) {
tmp = 1.0 + (x / (z * y));
} else if (z <= 2.7e-54) {
tmp = 1.0 + (x / (y * t));
} 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 (z <= (-2d-71)) then
tmp = 1.0d0 + (x / (z * y))
else if (z <= 2.7d-54) then
tmp = 1.0d0 + (x / (y * t))
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 (z <= -2e-71) {
tmp = 1.0 + (x / (z * y));
} else if (z <= 2.7e-54) {
tmp = 1.0 + (x / (y * t));
} 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 z <= -2e-71: tmp = 1.0 + (x / (z * y)) elif z <= 2.7e-54: tmp = 1.0 + (x / (y * t)) 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 (z <= -2e-71) tmp = Float64(1.0 + Float64(x / Float64(z * y))); elseif (z <= 2.7e-54) tmp = Float64(1.0 + Float64(x / Float64(y * t))); else tmp = Float64(1.0 + Float64(x / Float64(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 (z <= -2e-71)
tmp = 1.0 + (x / (z * y));
elseif (z <= 2.7e-54)
tmp = 1.0 + (x / (y * t));
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[LessEqual[z, -2e-71], N[(1.0 + N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e-54], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-71}:\\
\;\;\;\;1 + \frac{x}{z \cdot y}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-54}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if z < -1.9999999999999998e-71Initial 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%
Taylor expanded in z around inf 93.7%
associate-/r*93.6%
Simplified93.6%
Taylor expanded in y around inf 78.4%
*-commutative78.4%
Simplified78.4%
if -1.9999999999999998e-71 < z < 2.70000000000000026e-54Initial program 96.9%
sub-neg96.9%
neg-mul-196.9%
*-commutative96.9%
*-commutative96.9%
associate-/r*96.8%
associate-*r/96.8%
metadata-eval96.8%
times-frac96.8%
*-lft-identity96.8%
neg-mul-196.8%
sub-neg96.8%
+-commutative96.8%
distribute-neg-out96.8%
remove-double-neg96.8%
sub-neg96.8%
Simplified96.8%
Taylor expanded in t around inf 73.7%
associate-*r/73.7%
neg-mul-173.7%
associate-/r*75.7%
Simplified75.7%
Taylor expanded in z around 0 63.2%
if 2.70000000000000026e-54 < z 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%
clear-num99.9%
inv-pow99.9%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
unpow-199.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in y around 0 78.5%
mul-1-neg78.5%
associate-/l/78.5%
distribute-neg-frac78.5%
distribute-neg-frac78.5%
Simplified78.5%
expm1-log1p-u74.3%
expm1-udef74.3%
add-cbrt-cube74.2%
add-cbrt-cube74.3%
frac-2neg74.3%
remove-double-neg74.3%
associate-/l/74.3%
frac-2neg74.3%
add-sqr-sqrt33.9%
sqrt-unprod66.4%
sqr-neg66.4%
sqrt-unprod39.9%
add-sqr-sqrt73.7%
distribute-rgt-neg-out73.7%
remove-double-neg73.7%
Applied egg-rr73.7%
expm1-def73.7%
expm1-log1p76.5%
*-commutative76.5%
Simplified76.5%
Final simplification72.3%
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 9.8e-132) (- 1.0 (/ x (* y (- y z)))) (- 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 <= 9.8e-132) {
tmp = 1.0 - (x / (y * (y - z)));
} 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 <= 9.8d-132) then
tmp = 1.0d0 - (x / (y * (y - z)))
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 <= 9.8e-132) {
tmp = 1.0 - (x / (y * (y - z)));
} 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 <= 9.8e-132: tmp = 1.0 - (x / (y * (y - z))) 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 <= 9.8e-132) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); 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 <= 9.8e-132)
tmp = 1.0 - (x / (y * (y - z)));
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, 9.8e-132], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $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 9.8 \cdot 10^{-132}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if t < 9.79999999999999961e-132Initial program 98.8%
Taylor expanded in t around 0 78.2%
if 9.79999999999999961e-132 < t Initial program 98.8%
sub-neg98.8%
neg-mul-198.8%
*-commutative98.8%
*-commutative98.8%
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%
Taylor expanded in t around inf 93.2%
associate-*r/93.2%
neg-mul-193.2%
associate-/r*94.3%
Simplified94.3%
Final simplification83.4%
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 98.8%
sub-neg98.8%
neg-mul-198.8%
*-commutative98.8%
*-commutative98.8%
associate-/r*98.8%
associate-*r/98.8%
metadata-eval98.8%
times-frac98.8%
*-lft-identity98.8%
neg-mul-198.8%
sub-neg98.8%
+-commutative98.8%
distribute-neg-out98.8%
remove-double-neg98.8%
sub-neg98.8%
Simplified98.8%
Taylor expanded in t around inf 78.3%
associate-*r/78.3%
neg-mul-178.3%
associate-/r*78.9%
Simplified78.9%
Taylor expanded in z around 0 58.0%
Final simplification58.0%
herbie shell --seed 2024031
(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)))))