
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
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 = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
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 = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ (/ x (- t z)) (- y z)))
assert(y < t);
double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
NOTE: y 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 = (x / (t - z)) / (y - z)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return (x / (t - z)) / (y - z)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(t - z)) / Float64(y - z)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (t - z)) / (y - z);
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{\frac{x}{t - z}}{y - z}
\end{array}
Initial program 89.7%
frac-2neg89.7%
div-inv89.3%
distribute-rgt-neg-in89.3%
Applied egg-rr89.3%
associate-*r/89.7%
*-commutative89.7%
*-rgt-identity89.7%
associate-/r*97.2%
Simplified97.2%
expm1-log1p-u82.3%
expm1-udef59.6%
frac-2neg59.6%
Applied egg-rr59.6%
expm1-def82.3%
expm1-log1p97.2%
Simplified97.2%
Final simplification97.2%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -2.1e-43)
(/ x (* (- t z) y))
(if (<= y -1.75e-304)
(/ 1.0 (* z (/ z x)))
(if (<= y 1.02e-73)
(/ x (* t (- y z)))
(if (<= y 8.2e-58) (/ x (* z z)) (/ (/ x t) (- y z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e-43) {
tmp = x / ((t - z) * y);
} else if (y <= -1.75e-304) {
tmp = 1.0 / (z * (z / x));
} else if (y <= 1.02e-73) {
tmp = x / (t * (y - z));
} else if (y <= 8.2e-58) {
tmp = x / (z * z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y 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.1d-43)) then
tmp = x / ((t - z) * y)
else if (y <= (-1.75d-304)) then
tmp = 1.0d0 / (z * (z / x))
else if (y <= 1.02d-73) then
tmp = x / (t * (y - z))
else if (y <= 8.2d-58) then
tmp = x / (z * z)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e-43) {
tmp = x / ((t - z) * y);
} else if (y <= -1.75e-304) {
tmp = 1.0 / (z * (z / x));
} else if (y <= 1.02e-73) {
tmp = x / (t * (y - z));
} else if (y <= 8.2e-58) {
tmp = x / (z * z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -2.1e-43: tmp = x / ((t - z) * y) elif y <= -1.75e-304: tmp = 1.0 / (z * (z / x)) elif y <= 1.02e-73: tmp = x / (t * (y - z)) elif y <= 8.2e-58: tmp = x / (z * z) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e-43) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (y <= -1.75e-304) tmp = Float64(1.0 / Float64(z * Float64(z / x))); elseif (y <= 1.02e-73) tmp = Float64(x / Float64(t * Float64(y - z))); elseif (y <= 8.2e-58) tmp = Float64(x / Float64(z * z)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -2.1e-43)
tmp = x / ((t - z) * y);
elseif (y <= -1.75e-304)
tmp = 1.0 / (z * (z / x));
elseif (y <= 1.02e-73)
tmp = x / (t * (y - z));
elseif (y <= 8.2e-58)
tmp = x / (z * z);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e-43], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.75e-304], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e-73], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-58], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;y \leq -1.75 \cdot 10^{-304}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{-73}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-58}:\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.1000000000000001e-43Initial program 87.1%
Taylor expanded in y around inf 81.3%
*-commutative81.3%
Simplified81.3%
if -2.1000000000000001e-43 < y < -1.75e-304Initial program 93.9%
Taylor expanded in z around inf 71.3%
unpow271.3%
Simplified71.3%
clear-num72.3%
inv-pow72.3%
Applied egg-rr72.3%
unpow-172.3%
*-lft-identity72.3%
times-frac76.3%
/-rgt-identity76.3%
Simplified76.3%
if -1.75e-304 < y < 1.0199999999999999e-73Initial program 88.1%
Taylor expanded in t around inf 63.7%
if 1.0199999999999999e-73 < y < 8.20000000000000056e-58Initial program 91.9%
Taylor expanded in z around inf 53.5%
unpow253.5%
Simplified53.5%
if 8.20000000000000056e-58 < y Initial program 90.5%
Taylor expanded in t around inf 56.6%
associate-/r*61.3%
Simplified61.3%
Final simplification70.7%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -5.8e-44)
(/ (/ x y) (- t z))
(if (<= y 2e-308)
(/ 1.0 (* z (/ z x)))
(if (<= y 5.5e-84)
(/ x (* t (- y z)))
(if (<= y 1.65e-57) (/ x (* z z)) (/ (/ x t) (- y z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.8e-44) {
tmp = (x / y) / (t - z);
} else if (y <= 2e-308) {
tmp = 1.0 / (z * (z / x));
} else if (y <= 5.5e-84) {
tmp = x / (t * (y - z));
} else if (y <= 1.65e-57) {
tmp = x / (z * z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y 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 <= (-5.8d-44)) then
tmp = (x / y) / (t - z)
else if (y <= 2d-308) then
tmp = 1.0d0 / (z * (z / x))
else if (y <= 5.5d-84) then
tmp = x / (t * (y - z))
else if (y <= 1.65d-57) then
tmp = x / (z * z)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.8e-44) {
tmp = (x / y) / (t - z);
} else if (y <= 2e-308) {
tmp = 1.0 / (z * (z / x));
} else if (y <= 5.5e-84) {
tmp = x / (t * (y - z));
} else if (y <= 1.65e-57) {
tmp = x / (z * z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -5.8e-44: tmp = (x / y) / (t - z) elif y <= 2e-308: tmp = 1.0 / (z * (z / x)) elif y <= 5.5e-84: tmp = x / (t * (y - z)) elif y <= 1.65e-57: tmp = x / (z * z) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -5.8e-44) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 2e-308) tmp = Float64(1.0 / Float64(z * Float64(z / x))); elseif (y <= 5.5e-84) tmp = Float64(x / Float64(t * Float64(y - z))); elseif (y <= 1.65e-57) tmp = Float64(x / Float64(z * z)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -5.8e-44)
tmp = (x / y) / (t - z);
elseif (y <= 2e-308)
tmp = 1.0 / (z * (z / x));
elseif (y <= 5.5e-84)
tmp = x / (t * (y - z));
elseif (y <= 1.65e-57)
tmp = x / (z * z);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -5.8e-44], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-308], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e-84], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e-57], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-308}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-84}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-57}:\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -5.8000000000000003e-44Initial program 87.1%
Taylor expanded in y around inf 81.3%
associate-/r*87.2%
Simplified87.2%
if -5.8000000000000003e-44 < y < 1.9999999999999998e-308Initial program 93.9%
Taylor expanded in z around inf 71.3%
unpow271.3%
Simplified71.3%
clear-num72.3%
inv-pow72.3%
Applied egg-rr72.3%
unpow-172.3%
*-lft-identity72.3%
times-frac76.3%
/-rgt-identity76.3%
Simplified76.3%
if 1.9999999999999998e-308 < y < 5.50000000000000019e-84Initial program 87.8%
Taylor expanded in t around inf 65.2%
if 5.50000000000000019e-84 < y < 1.6499999999999999e-57Initial program 93.3%
Taylor expanded in z around inf 61.3%
unpow261.3%
Simplified61.3%
if 1.6499999999999999e-57 < y Initial program 90.5%
Taylor expanded in t around inf 56.6%
associate-/r*61.3%
Simplified61.3%
Final simplification73.0%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -7.6e+42)
(/ (/ x y) (- t z))
(if (<= y -3.3e-13)
(/ (/ (- x) z) (- y z))
(if (<= y -1.9e-43)
(/ x (* (- t z) y))
(if (<= y 1.7e-57) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.6e+42) {
tmp = (x / y) / (t - z);
} else if (y <= -3.3e-13) {
tmp = (-x / z) / (y - z);
} else if (y <= -1.9e-43) {
tmp = x / ((t - z) * y);
} else if (y <= 1.7e-57) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y 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 <= (-7.6d+42)) then
tmp = (x / y) / (t - z)
else if (y <= (-3.3d-13)) then
tmp = (-x / z) / (y - z)
else if (y <= (-1.9d-43)) then
tmp = x / ((t - z) * y)
else if (y <= 1.7d-57) then
tmp = (x / z) / (z - t)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.6e+42) {
tmp = (x / y) / (t - z);
} else if (y <= -3.3e-13) {
tmp = (-x / z) / (y - z);
} else if (y <= -1.9e-43) {
tmp = x / ((t - z) * y);
} else if (y <= 1.7e-57) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -7.6e+42: tmp = (x / y) / (t - z) elif y <= -3.3e-13: tmp = (-x / z) / (y - z) elif y <= -1.9e-43: tmp = x / ((t - z) * y) elif y <= 1.7e-57: tmp = (x / z) / (z - t) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -7.6e+42) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= -3.3e-13) tmp = Float64(Float64(Float64(-x) / z) / Float64(y - z)); elseif (y <= -1.9e-43) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (y <= 1.7e-57) tmp = Float64(Float64(x / z) / Float64(z - t)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -7.6e+42)
tmp = (x / y) / (t - z);
elseif (y <= -3.3e-13)
tmp = (-x / z) / (y - z);
elseif (y <= -1.9e-43)
tmp = x / ((t - z) * y);
elseif (y <= 1.7e-57)
tmp = (x / z) / (z - t);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -7.6e+42], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.3e-13], N[(N[((-x) / z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.9e-43], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-57], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+42}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y - z}\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-57}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -7.5999999999999997e42Initial program 84.0%
Taylor expanded in y around inf 84.0%
associate-/r*91.4%
Simplified91.4%
if -7.5999999999999997e42 < y < -3.3000000000000001e-13Initial program 100.0%
Taylor expanded in t around 0 68.5%
mul-1-neg68.5%
distribute-frac-neg68.5%
associate-/r*68.4%
Simplified68.4%
if -3.3000000000000001e-13 < y < -1.89999999999999985e-43Initial program 99.6%
Taylor expanded in y around inf 99.6%
*-commutative99.6%
Simplified99.6%
if -1.89999999999999985e-43 < y < 1.70000000000000008e-57Initial program 91.3%
frac-2neg91.3%
div-inv90.3%
distribute-rgt-neg-in90.3%
Applied egg-rr90.3%
associate-*r/91.3%
*-commutative91.3%
*-rgt-identity91.3%
associate-/r*95.8%
Simplified95.8%
Taylor expanded in y around 0 75.4%
associate-/r*81.8%
Simplified81.8%
if 1.70000000000000008e-57 < y Initial program 90.5%
Taylor expanded in t around inf 56.6%
associate-/r*61.3%
Simplified61.3%
Final simplification77.5%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (* z (/ z x)))))
(if (<= z -6.2e+46)
t_1
(if (<= z -1.7e-13)
(/ (- x) (* z y))
(if (<= z 2.15e+17) (/ (/ x t) y) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (z * (z / x));
double tmp;
if (z <= -6.2e+46) {
tmp = t_1;
} else if (z <= -1.7e-13) {
tmp = -x / (z * y);
} else if (z <= 2.15e+17) {
tmp = (x / t) / y;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y 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 / (z * (z / x))
if (z <= (-6.2d+46)) then
tmp = t_1
else if (z <= (-1.7d-13)) then
tmp = -x / (z * y)
else if (z <= 2.15d+17) then
tmp = (x / t) / y
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (z * (z / x));
double tmp;
if (z <= -6.2e+46) {
tmp = t_1;
} else if (z <= -1.7e-13) {
tmp = -x / (z * y);
} else if (z <= 2.15e+17) {
tmp = (x / t) / y;
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = 1.0 / (z * (z / x)) tmp = 0 if z <= -6.2e+46: tmp = t_1 elif z <= -1.7e-13: tmp = -x / (z * y) elif z <= 2.15e+17: tmp = (x / t) / y else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(z * Float64(z / x))) tmp = 0.0 if (z <= -6.2e+46) tmp = t_1; elseif (z <= -1.7e-13) tmp = Float64(Float64(-x) / Float64(z * y)); elseif (z <= 2.15e+17) tmp = Float64(Float64(x / t) / y); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 / (z * (z / x));
tmp = 0.0;
if (z <= -6.2e+46)
tmp = t_1;
elseif (z <= -1.7e-13)
tmp = -x / (z * y);
elseif (z <= 2.15e+17)
tmp = (x / t) / y;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y 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[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.2e+46], t$95$1, If[LessEqual[z, -1.7e-13], N[((-x) / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e+17], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-13}:\\
\;\;\;\;\frac{-x}{z \cdot y}\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+17}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -6.1999999999999995e46 or 2.15e17 < z Initial program 86.5%
Taylor expanded in z around inf 73.4%
unpow273.4%
Simplified73.4%
clear-num73.7%
inv-pow73.7%
Applied egg-rr73.7%
unpow-173.7%
*-lft-identity73.7%
times-frac77.4%
/-rgt-identity77.4%
Simplified77.4%
if -6.1999999999999995e46 < z < -1.70000000000000008e-13Initial program 99.6%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in t around 0 52.9%
associate-*r/52.9%
neg-mul-152.9%
Simplified52.9%
if -1.70000000000000008e-13 < z < 2.15e17Initial program 92.1%
Taylor expanded in z around 0 59.3%
associate-/r*62.7%
Simplified62.7%
Final simplification69.5%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (* z (/ z x)))))
(if (<= z -2.65e+53)
t_1
(if (<= z -3e-13)
(/ (- x) (* z y))
(if (<= z 1.26e+28) (/ x (* t (- y z))) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (z * (z / x));
double tmp;
if (z <= -2.65e+53) {
tmp = t_1;
} else if (z <= -3e-13) {
tmp = -x / (z * y);
} else if (z <= 1.26e+28) {
tmp = x / (t * (y - z));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y 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 / (z * (z / x))
if (z <= (-2.65d+53)) then
tmp = t_1
else if (z <= (-3d-13)) then
tmp = -x / (z * y)
else if (z <= 1.26d+28) then
tmp = x / (t * (y - z))
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (z * (z / x));
double tmp;
if (z <= -2.65e+53) {
tmp = t_1;
} else if (z <= -3e-13) {
tmp = -x / (z * y);
} else if (z <= 1.26e+28) {
tmp = x / (t * (y - z));
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = 1.0 / (z * (z / x)) tmp = 0 if z <= -2.65e+53: tmp = t_1 elif z <= -3e-13: tmp = -x / (z * y) elif z <= 1.26e+28: tmp = x / (t * (y - z)) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(z * Float64(z / x))) tmp = 0.0 if (z <= -2.65e+53) tmp = t_1; elseif (z <= -3e-13) tmp = Float64(Float64(-x) / Float64(z * y)); elseif (z <= 1.26e+28) tmp = Float64(x / Float64(t * Float64(y - z))); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 / (z * (z / x));
tmp = 0.0;
if (z <= -2.65e+53)
tmp = t_1;
elseif (z <= -3e-13)
tmp = -x / (z * y);
elseif (z <= 1.26e+28)
tmp = x / (t * (y - z));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y 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[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.65e+53], t$95$1, If[LessEqual[z, -3e-13], N[((-x) / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.26e+28], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{if}\;z \leq -2.65 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-13}:\\
\;\;\;\;\frac{-x}{z \cdot y}\\
\mathbf{elif}\;z \leq 1.26 \cdot 10^{+28}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.6500000000000001e53 or 1.26e28 < z Initial program 86.2%
Taylor expanded in z around inf 73.5%
unpow273.5%
Simplified73.5%
clear-num73.9%
inv-pow73.9%
Applied egg-rr73.9%
unpow-173.9%
*-lft-identity73.9%
times-frac77.6%
/-rgt-identity77.6%
Simplified77.6%
if -2.6500000000000001e53 < z < -2.99999999999999984e-13Initial program 99.6%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in t around 0 52.9%
associate-*r/52.9%
neg-mul-152.9%
Simplified52.9%
if -2.99999999999999984e-13 < z < 1.26e28Initial program 92.3%
Taylor expanded in t around inf 68.0%
Final simplification71.9%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z z))))
(if (<= z -1.65e+47)
t_1
(if (<= z -1.06e-11)
(/ (- x) (* z y))
(if (<= z 2120000000.0) (/ (/ x t) y) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -1.65e+47) {
tmp = t_1;
} else if (z <= -1.06e-11) {
tmp = -x / (z * y);
} else if (z <= 2120000000.0) {
tmp = (x / t) / y;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y 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 = x / (z * z)
if (z <= (-1.65d+47)) then
tmp = t_1
else if (z <= (-1.06d-11)) then
tmp = -x / (z * y)
else if (z <= 2120000000.0d0) then
tmp = (x / t) / y
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -1.65e+47) {
tmp = t_1;
} else if (z <= -1.06e-11) {
tmp = -x / (z * y);
} else if (z <= 2120000000.0) {
tmp = (x / t) / y;
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = x / (z * z) tmp = 0 if z <= -1.65e+47: tmp = t_1 elif z <= -1.06e-11: tmp = -x / (z * y) elif z <= 2120000000.0: tmp = (x / t) / y else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(z * z)) tmp = 0.0 if (z <= -1.65e+47) tmp = t_1; elseif (z <= -1.06e-11) tmp = Float64(Float64(-x) / Float64(z * y)); elseif (z <= 2120000000.0) tmp = Float64(Float64(x / t) / y); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / (z * z);
tmp = 0.0;
if (z <= -1.65e+47)
tmp = t_1;
elseif (z <= -1.06e-11)
tmp = -x / (z * y);
elseif (z <= 2120000000.0)
tmp = (x / t) / y;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e+47], t$95$1, If[LessEqual[z, -1.06e-11], N[((-x) / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2120000000.0], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.06 \cdot 10^{-11}:\\
\;\;\;\;\frac{-x}{z \cdot y}\\
\mathbf{elif}\;z \leq 2120000000:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.65e47 or 2.12e9 < z Initial program 86.5%
Taylor expanded in z around inf 73.4%
unpow273.4%
Simplified73.4%
if -1.65e47 < z < -1.05999999999999993e-11Initial program 99.6%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in t around 0 52.9%
associate-*r/52.9%
neg-mul-152.9%
Simplified52.9%
if -1.05999999999999993e-11 < z < 2.12e9Initial program 92.1%
Taylor expanded in z around 0 59.3%
associate-/r*62.7%
Simplified62.7%
Final simplification67.5%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3.55e-43) (/ x (* (- t z) y)) (if (<= y -4.2e-305) (/ 1.0 (* z (/ z x))) (/ x (* t (- y z))))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.55e-43) {
tmp = x / ((t - z) * y);
} else if (y <= -4.2e-305) {
tmp = 1.0 / (z * (z / x));
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
NOTE: y 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 <= (-3.55d-43)) then
tmp = x / ((t - z) * y)
else if (y <= (-4.2d-305)) then
tmp = 1.0d0 / (z * (z / x))
else
tmp = x / (t * (y - z))
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.55e-43) {
tmp = x / ((t - z) * y);
} else if (y <= -4.2e-305) {
tmp = 1.0 / (z * (z / x));
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -3.55e-43: tmp = x / ((t - z) * y) elif y <= -4.2e-305: tmp = 1.0 / (z * (z / x)) else: tmp = x / (t * (y - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.55e-43) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (y <= -4.2e-305) tmp = Float64(1.0 / Float64(z * Float64(z / x))); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -3.55e-43)
tmp = x / ((t - z) * y);
elseif (y <= -4.2e-305)
tmp = 1.0 / (z * (z / x));
else
tmp = x / (t * (y - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -3.55e-43], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.2e-305], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.55 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-305}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -3.55000000000000013e-43Initial program 87.1%
Taylor expanded in y around inf 81.3%
*-commutative81.3%
Simplified81.3%
if -3.55000000000000013e-43 < y < -4.2e-305Initial program 93.9%
Taylor expanded in z around inf 71.3%
unpow271.3%
Simplified71.3%
clear-num72.3%
inv-pow72.3%
Applied egg-rr72.3%
unpow-172.3%
*-lft-identity72.3%
times-frac76.3%
/-rgt-identity76.3%
Simplified76.3%
if -4.2e-305 < y Initial program 89.8%
Taylor expanded in t around inf 58.3%
Final simplification69.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.8e-43) (/ (/ x y) (- t z)) (if (<= y 2.1e-57) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e-43) {
tmp = (x / y) / (t - z);
} else if (y <= 2.1e-57) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y 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.8d-43)) then
tmp = (x / y) / (t - z)
else if (y <= 2.1d-57) then
tmp = (x / z) / (z - t)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e-43) {
tmp = (x / y) / (t - z);
} else if (y <= 2.1e-57) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -2.8e-43: tmp = (x / y) / (t - z) elif y <= 2.1e-57: tmp = (x / z) / (z - t) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.8e-43) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 2.1e-57) tmp = Float64(Float64(x / z) / Float64(z - t)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -2.8e-43)
tmp = (x / y) / (t - z);
elseif (y <= 2.1e-57)
tmp = (x / z) / (z - t);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -2.8e-43], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-57], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-57}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.7999999999999998e-43Initial program 87.1%
Taylor expanded in y around inf 81.3%
associate-/r*87.2%
Simplified87.2%
if -2.7999999999999998e-43 < y < 2.0999999999999999e-57Initial program 91.3%
frac-2neg91.3%
div-inv90.3%
distribute-rgt-neg-in90.3%
Applied egg-rr90.3%
associate-*r/91.3%
*-commutative91.3%
*-rgt-identity91.3%
associate-/r*95.8%
Simplified95.8%
Taylor expanded in y around 0 75.4%
associate-/r*81.8%
Simplified81.8%
if 2.0999999999999999e-57 < y Initial program 90.5%
Taylor expanded in t around inf 56.6%
associate-/r*61.3%
Simplified61.3%
Final simplification77.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.95e+159) (/ (/ x y) (- t z)) (/ x (* (- t z) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.95e+159) {
tmp = (x / y) / (t - z);
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
NOTE: y 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.95d+159)) then
tmp = (x / y) / (t - z)
else
tmp = x / ((t - z) * (y - z))
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.95e+159) {
tmp = (x / y) / (t - z);
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -2.95e+159: tmp = (x / y) / (t - z) else: tmp = x / ((t - z) * (y - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.95e+159) tmp = Float64(Float64(x / y) / Float64(t - z)); else tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -2.95e+159)
tmp = (x / y) / (t - z);
else
tmp = x / ((t - z) * (y - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -2.95e+159], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.95 \cdot 10^{+159}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -2.94999999999999996e159Initial program 77.1%
Taylor expanded in y around inf 77.1%
associate-/r*95.9%
Simplified95.9%
if -2.94999999999999996e159 < y Initial program 91.6%
Final simplification92.2%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -7.2e+161) (/ (* x (/ 1.0 y)) (- t z)) (/ x (* (- t z) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e+161) {
tmp = (x * (1.0 / y)) / (t - z);
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
NOTE: y 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 <= (-7.2d+161)) then
tmp = (x * (1.0d0 / y)) / (t - z)
else
tmp = x / ((t - z) * (y - z))
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e+161) {
tmp = (x * (1.0 / y)) / (t - z);
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -7.2e+161: tmp = (x * (1.0 / y)) / (t - z) else: tmp = x / ((t - z) * (y - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -7.2e+161) tmp = Float64(Float64(x * Float64(1.0 / y)) / Float64(t - z)); else tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -7.2e+161)
tmp = (x * (1.0 / y)) / (t - z);
else
tmp = x / ((t - z) * (y - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -7.2e+161], N[(N[(x * N[(1.0 / y), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+161}:\\
\;\;\;\;\frac{x \cdot \frac{1}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -7.19999999999999967e161Initial program 77.1%
associate-/r*96.9%
Simplified96.9%
clear-num96.8%
associate-/r/96.8%
Applied egg-rr96.8%
Taylor expanded in y around inf 95.8%
if -7.19999999999999967e161 < y Initial program 91.6%
Final simplification92.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -3.4e+154) (not (<= z 4.4e+69))) (/ x (* t z)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.4e+154) || !(z <= 4.4e+69)) {
tmp = x / (t * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
NOTE: y 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.4d+154)) .or. (.not. (z <= 4.4d+69))) then
tmp = x / (t * z)
else
tmp = x / (t * y)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.4e+154) || !(z <= 4.4e+69)) {
tmp = x / (t * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -3.4e+154) or not (z <= 4.4e+69): tmp = x / (t * z) else: tmp = x / (t * y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3.4e+154) || !(z <= 4.4e+69)) tmp = Float64(x / Float64(t * z)); else tmp = Float64(x / Float64(t * y)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -3.4e+154) || ~((z <= 4.4e+69)))
tmp = x / (t * z);
else
tmp = x / (t * y);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.4e+154], N[Not[LessEqual[z, 4.4e+69]], $MachinePrecision]], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+154} \lor \neg \left(z \leq 4.4 \cdot 10^{+69}\right):\\
\;\;\;\;\frac{x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -3.39999999999999974e154 or 4.4000000000000003e69 < z Initial program 82.8%
Taylor expanded in y around 0 79.8%
mul-1-neg79.8%
distribute-frac-neg79.8%
associate-/r*89.6%
Simplified89.6%
Taylor expanded in z around 0 38.1%
associate-*r/38.1%
neg-mul-138.1%
*-commutative38.1%
Simplified38.1%
expm1-log1p-u37.9%
expm1-udef65.8%
add-sqr-sqrt34.0%
sqrt-unprod62.5%
sqr-neg62.5%
sqrt-unprod31.3%
add-sqr-sqrt65.3%
*-commutative65.3%
Applied egg-rr65.3%
expm1-def36.3%
expm1-log1p36.5%
Simplified36.5%
if -3.39999999999999974e154 < z < 4.4000000000000003e69Initial program 93.8%
Taylor expanded in z around 0 51.2%
Final simplification45.8%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.35e-9) (not (<= z 27000000.0))) (/ x (* z z)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.35e-9) || !(z <= 27000000.0)) {
tmp = x / (z * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
NOTE: y 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.35d-9)) .or. (.not. (z <= 27000000.0d0))) then
tmp = x / (z * z)
else
tmp = x / (t * y)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.35e-9) || !(z <= 27000000.0)) {
tmp = x / (z * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.35e-9) or not (z <= 27000000.0): tmp = x / (z * z) else: tmp = x / (t * y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.35e-9) || !(z <= 27000000.0)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(t * y)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.35e-9) || ~((z <= 27000000.0)))
tmp = x / (z * z);
else
tmp = x / (t * y);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.35e-9], N[Not[LessEqual[z, 27000000.0]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-9} \lor \neg \left(z \leq 27000000\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -1.3500000000000001e-9 or 2.7e7 < z Initial program 87.8%
Taylor expanded in z around inf 69.7%
unpow269.7%
Simplified69.7%
if -1.3500000000000001e-9 < z < 2.7e7Initial program 92.2%
Taylor expanded in z around 0 58.9%
Final simplification64.9%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -7.4e-9) (not (<= z 135000000000.0))) (/ x (* z z)) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.4e-9) || !(z <= 135000000000.0)) {
tmp = x / (z * z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: y 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 <= (-7.4d-9)) .or. (.not. (z <= 135000000000.0d0))) then
tmp = x / (z * z)
else
tmp = (x / t) / y
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.4e-9) || !(z <= 135000000000.0)) {
tmp = x / (z * z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -7.4e-9) or not (z <= 135000000000.0): tmp = x / (z * z) else: tmp = (x / t) / y return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -7.4e-9) || !(z <= 135000000000.0)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(Float64(x / t) / y); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -7.4e-9) || ~((z <= 135000000000.0)))
tmp = x / (z * z);
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.4e-9], N[Not[LessEqual[z, 135000000000.0]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{-9} \lor \neg \left(z \leq 135000000000\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -7.4e-9 or 1.35e11 < z Initial program 87.8%
Taylor expanded in z around inf 69.7%
unpow269.7%
Simplified69.7%
if -7.4e-9 < z < 1.35e11Initial program 92.2%
Taylor expanded in z around 0 58.9%
associate-/r*62.2%
Simplified62.2%
Final simplification66.3%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* t y)))
assert(y < t);
double code(double x, double y, double z, double t) {
return x / (t * y);
}
NOTE: y 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 = x / (t * y)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return x / (t * y);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return x / (t * y)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(x / Float64(t * y)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (t * y);
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{x}{t \cdot y}
\end{array}
Initial program 89.7%
Taylor expanded in z around 0 41.0%
Final simplification41.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
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 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t_1}\\
\end{array}
\end{array}
herbie shell --seed 2023279
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:herbie-target
(if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))