
(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 14 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: 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)) (- y t))))
assert(z < t);
double code(double x, double y, double z, double t) {
return 1.0 - ((x / (y - z)) / (y - t));
}
NOTE: 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)) / (y - t))
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - ((x / (y - z)) / (y - t));
}
[z, t] = sort([z, t]) def code(x, y, z, t): return 1.0 - ((x / (y - z)) / (y - t))
z, t = sort([z, t]) function code(x, y, z, t) return Float64(1.0 - Float64(Float64(x / Float64(y - z)) / Float64(y - t))) end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - ((x / (y - z)) / (y - t));
end
NOTE: 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[(y - z), $MachinePrecision]), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
1 - \frac{\frac{x}{y - z}}{y - t}
\end{array}
Initial program 98.5%
associate-/r*98.8%
div-inv98.7%
Applied egg-rr98.7%
un-div-inv98.8%
Applied egg-rr98.8%
Final simplification98.8%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -4.5e-83)
1.0
(if (<= y 1.42e-102)
(- 1.0 (/ (/ x z) t))
(if (<= y 1.45e+40)
(+ 1.0 (/ x (* y z)))
(if (<= y 1.35e+47) (+ 1.0 (/ x (* y t))) (- 1.0 (/ x (* y y))))))))assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.5e-83) {
tmp = 1.0;
} else if (y <= 1.42e-102) {
tmp = 1.0 - ((x / z) / t);
} else if (y <= 1.45e+40) {
tmp = 1.0 + (x / (y * z));
} else if (y <= 1.35e+47) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0 - (x / (y * y));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.5d-83)) then
tmp = 1.0d0
else if (y <= 1.42d-102) then
tmp = 1.0d0 - ((x / z) / t)
else if (y <= 1.45d+40) then
tmp = 1.0d0 + (x / (y * z))
else if (y <= 1.35d+47) then
tmp = 1.0d0 + (x / (y * t))
else
tmp = 1.0d0 - (x / (y * y))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.5e-83) {
tmp = 1.0;
} else if (y <= 1.42e-102) {
tmp = 1.0 - ((x / z) / t);
} else if (y <= 1.45e+40) {
tmp = 1.0 + (x / (y * z));
} else if (y <= 1.35e+47) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0 - (x / (y * y));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if y <= -4.5e-83: tmp = 1.0 elif y <= 1.42e-102: tmp = 1.0 - ((x / z) / t) elif y <= 1.45e+40: tmp = 1.0 + (x / (y * z)) elif y <= 1.35e+47: tmp = 1.0 + (x / (y * t)) else: tmp = 1.0 - (x / (y * y)) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -4.5e-83) tmp = 1.0; elseif (y <= 1.42e-102) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); elseif (y <= 1.45e+40) tmp = Float64(1.0 + Float64(x / Float64(y * z))); elseif (y <= 1.35e+47) tmp = Float64(1.0 + Float64(x / Float64(y * t))); else tmp = Float64(1.0 - Float64(x / Float64(y * y))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -4.5e-83)
tmp = 1.0;
elseif (y <= 1.42e-102)
tmp = 1.0 - ((x / z) / t);
elseif (y <= 1.45e+40)
tmp = 1.0 + (x / (y * z));
elseif (y <= 1.35e+47)
tmp = 1.0 + (x / (y * t));
else
tmp = 1.0 - (x / (y * y));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -4.5e-83], 1.0, If[LessEqual[y, 1.42e-102], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+40], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+47], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-83}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.42 \cdot 10^{-102}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+40}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+47}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -4.49999999999999997e-83Initial program 99.9%
Taylor expanded in t around inf 78.2%
associate-*r/78.2%
neg-mul-178.2%
Simplified78.2%
Taylor expanded in y around inf 73.4%
mul-1-neg73.4%
distribute-frac-neg73.4%
Simplified73.4%
expm1-log1p-u68.3%
expm1-udef68.3%
add-sqr-sqrt34.1%
sqrt-unprod63.6%
sqr-neg63.6%
sqrt-unprod32.9%
add-sqr-sqrt67.1%
Applied egg-rr67.1%
expm1-def67.1%
expm1-log1p69.1%
Simplified69.1%
Taylor expanded in x around 0 89.0%
if -4.49999999999999997e-83 < y < 1.42000000000000009e-102Initial program 95.5%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 78.0%
*-commutative78.0%
associate-/r*79.2%
Simplified79.2%
if 1.42000000000000009e-102 < y < 1.45000000000000009e40Initial program 99.8%
Taylor expanded in t around 0 56.5%
Taylor expanded in y around 0 36.7%
mul-1-neg36.7%
distribute-frac-neg36.7%
Simplified36.7%
if 1.45000000000000009e40 < y < 1.34999999999999998e47Initial program 99.5%
Taylor expanded in t around inf 93.2%
associate-*r/93.2%
neg-mul-193.2%
Simplified93.2%
Taylor expanded in y around inf 61.7%
mul-1-neg61.7%
distribute-frac-neg61.7%
Simplified61.7%
expm1-log1p-u33.3%
expm1-udef33.3%
add-sqr-sqrt0.0%
sqrt-unprod34.1%
sqr-neg34.1%
sqrt-unprod34.2%
add-sqr-sqrt34.2%
Applied egg-rr34.2%
expm1-def34.2%
expm1-log1p34.2%
Simplified34.2%
sub-neg34.2%
distribute-neg-frac34.2%
add-sqr-sqrt0.0%
sqrt-unprod60.9%
sqr-neg60.9%
sqrt-unprod61.7%
add-sqr-sqrt61.7%
Applied egg-rr61.7%
if 1.34999999999999998e47 < y Initial program 100.0%
Taylor expanded in y around inf 97.3%
unpow297.3%
Simplified97.3%
Final simplification80.0%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -1.7e-159) (not (<= y 8.8e-105))) (- 1.0 (/ x (* y (- y z)))) (- 1.0 (/ (/ x z) t))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.7e-159) || !(y <= 8.8e-105)) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 - ((x / z) / t);
}
return tmp;
}
NOTE: 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.7d-159)) .or. (.not. (y <= 8.8d-105))) then
tmp = 1.0d0 - (x / (y * (y - z)))
else
tmp = 1.0d0 - ((x / z) / t)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.7e-159) || !(y <= 8.8e-105)) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 - ((x / z) / t);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if (y <= -1.7e-159) or not (y <= 8.8e-105): tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 - ((x / z) / t) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -1.7e-159) || !(y <= 8.8e-105)) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); else tmp = Float64(1.0 - Float64(Float64(x / z) / t)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -1.7e-159) || ~((y <= 8.8e-105)))
tmp = 1.0 - (x / (y * (y - z)));
else
tmp = 1.0 - ((x / z) / t);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.7e-159], N[Not[LessEqual[y, 8.8e-105]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-159} \lor \neg \left(y \leq 8.8 \cdot 10^{-105}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\end{array}
\end{array}
if y < -1.69999999999999992e-159 or 8.80000000000000016e-105 < y Initial program 99.9%
Taylor expanded in t around 0 84.0%
if -1.69999999999999992e-159 < y < 8.80000000000000016e-105Initial program 94.6%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 79.3%
*-commutative79.3%
associate-/r*80.7%
Simplified80.7%
Final simplification83.2%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -9.8e-64) (- 1.0 (/ x (* y (- y z)))) (if (<= z 2.7e-41) (- 1.0 (/ x (* y (- y t)))) (- 1.0 (/ x (* z t))))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.8e-64) {
tmp = 1.0 - (x / (y * (y - z)));
} else if (z <= 2.7e-41) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
NOTE: 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 <= (-9.8d-64)) then
tmp = 1.0d0 - (x / (y * (y - z)))
else if (z <= 2.7d-41) then
tmp = 1.0d0 - (x / (y * (y - t)))
else
tmp = 1.0d0 - (x / (z * t))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.8e-64) {
tmp = 1.0 - (x / (y * (y - z)));
} else if (z <= 2.7e-41) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if z <= -9.8e-64: tmp = 1.0 - (x / (y * (y - z))) elif z <= 2.7e-41: tmp = 1.0 - (x / (y * (y - t))) else: tmp = 1.0 - (x / (z * t)) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -9.8e-64) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); elseif (z <= 2.7e-41) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); else tmp = Float64(1.0 - Float64(x / Float64(z * t))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -9.8e-64)
tmp = 1.0 - (x / (y * (y - z)));
elseif (z <= 2.7e-41)
tmp = 1.0 - (x / (y * (y - t)));
else
tmp = 1.0 - (x / (z * t));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -9.8e-64], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e-41], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{-64}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-41}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if z < -9.8000000000000003e-64Initial program 99.8%
Taylor expanded in t around 0 71.3%
if -9.8000000000000003e-64 < z < 2.7e-41Initial program 96.4%
Taylor expanded in z around 0 89.0%
if 2.7e-41 < z Initial program 100.0%
Taylor expanded in y around 0 72.4%
Final simplification78.6%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -1.1e-63) (- 1.0 (/ x (* y (- y z)))) (if (<= z 2.45e-42) (- 1.0 (/ (/ x y) (- y t))) (- 1.0 (/ x (* z t))))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e-63) {
tmp = 1.0 - (x / (y * (y - z)));
} else if (z <= 2.45e-42) {
tmp = 1.0 - ((x / y) / (y - t));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.1d-63)) then
tmp = 1.0d0 - (x / (y * (y - z)))
else if (z <= 2.45d-42) then
tmp = 1.0d0 - ((x / y) / (y - t))
else
tmp = 1.0d0 - (x / (z * t))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e-63) {
tmp = 1.0 - (x / (y * (y - z)));
} else if (z <= 2.45e-42) {
tmp = 1.0 - ((x / y) / (y - t));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.1e-63: tmp = 1.0 - (x / (y * (y - z))) elif z <= 2.45e-42: tmp = 1.0 - ((x / y) / (y - t)) else: tmp = 1.0 - (x / (z * t)) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.1e-63) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); elseif (z <= 2.45e-42) tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - t))); else tmp = Float64(1.0 - Float64(x / Float64(z * t))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.1e-63)
tmp = 1.0 - (x / (y * (y - z)));
elseif (z <= 2.45e-42)
tmp = 1.0 - ((x / y) / (y - t));
else
tmp = 1.0 - (x / (z * t));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.1e-63], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e-42], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-63}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-42}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if z < -1.1e-63Initial program 99.8%
Taylor expanded in t around 0 71.3%
if -1.1e-63 < z < 2.45e-42Initial program 96.4%
Taylor expanded in z around 0 89.0%
associate-/l/89.0%
Simplified89.0%
if 2.45e-42 < z Initial program 100.0%
Taylor expanded in y around 0 72.4%
Final simplification78.6%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -1.9e-188)
(+ 1.0 (/ x (* z (- y t))))
(if (<= t 3.9e-95)
(- 1.0 (/ (/ x (- y z)) y))
(+ 1.0 (/ x (* (- y z) t))))))assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.9e-188) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 3.9e-95) {
tmp = 1.0 - ((x / (y - z)) / y);
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.9d-188)) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (t <= 3.9d-95) then
tmp = 1.0d0 - ((x / (y - z)) / y)
else
tmp = 1.0d0 + (x / ((y - z) * t))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.9e-188) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 3.9e-95) {
tmp = 1.0 - ((x / (y - z)) / y);
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if t <= -1.9e-188: tmp = 1.0 + (x / (z * (y - t))) elif t <= 3.9e-95: tmp = 1.0 - ((x / (y - z)) / y) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.9e-188) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (t <= 3.9e-95) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - z)) / y)); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -1.9e-188)
tmp = 1.0 + (x / (z * (y - t)));
elseif (t <= 3.9e-95)
tmp = 1.0 - ((x / (y - z)) / y);
else
tmp = 1.0 + (x / ((y - z) * t));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -1.9e-188], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.9e-95], N[(1.0 - N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-188}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-95}:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.9e-188Initial program 98.9%
Taylor expanded in z around inf 79.6%
associate-*r/79.6%
neg-mul-179.6%
Simplified79.6%
if -1.9e-188 < t < 3.9e-95Initial program 96.2%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 95.0%
*-lft-identity95.0%
times-frac97.8%
associate-*l/97.9%
*-lft-identity97.9%
Simplified97.9%
if 3.9e-95 < t Initial program 99.9%
Taylor expanded in t around inf 93.6%
associate-*r/93.6%
neg-mul-193.6%
Simplified93.6%
Final simplification89.6%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -1.9e-188)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 2.5e-95)
(- 1.0 (/ (/ x (- y z)) y))
(+ 1.0 (/ x (* (- y z) t))))))assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.9e-188) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 2.5e-95) {
tmp = 1.0 - ((x / (y - z)) / y);
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.9d-188)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 2.5d-95) then
tmp = 1.0d0 - ((x / (y - z)) / y)
else
tmp = 1.0d0 + (x / ((y - z) * t))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.9e-188) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 2.5e-95) {
tmp = 1.0 - ((x / (y - z)) / y);
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if t <= -1.9e-188: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 2.5e-95: tmp = 1.0 - ((x / (y - z)) / y) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.9e-188) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 2.5e-95) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - z)) / y)); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -1.9e-188)
tmp = 1.0 + ((x / z) / (y - t));
elseif (t <= 2.5e-95)
tmp = 1.0 - ((x / (y - z)) / y);
else
tmp = 1.0 + (x / ((y - z) * t));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -1.9e-188], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e-95], N[(1.0 - N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-188}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-95}:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.9e-188Initial program 98.9%
associate-/r*97.9%
div-inv97.9%
Applied egg-rr97.9%
un-div-inv97.9%
Applied egg-rr97.9%
Taylor expanded in y around 0 80.5%
mul-1-neg80.5%
distribute-frac-neg80.5%
Simplified80.5%
if -1.9e-188 < t < 2.4999999999999999e-95Initial program 96.2%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 95.0%
*-lft-identity95.0%
times-frac97.8%
associate-*l/97.9%
*-lft-identity97.9%
Simplified97.9%
if 2.4999999999999999e-95 < t Initial program 99.9%
Taylor expanded in t around inf 93.6%
associate-*r/93.6%
neg-mul-193.6%
Simplified93.6%
Final simplification89.9%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -6.8e-258) 1.0 (if (<= z 1.3e-53) (+ 1.0 (/ x (* y t))) 1.0)))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.8e-258) {
tmp = 1.0;
} else if (z <= 1.3e-53) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: 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 <= (-6.8d-258)) then
tmp = 1.0d0
else if (z <= 1.3d-53) then
tmp = 1.0d0 + (x / (y * t))
else
tmp = 1.0d0
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.8e-258) {
tmp = 1.0;
} else if (z <= 1.3e-53) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if z <= -6.8e-258: tmp = 1.0 elif z <= 1.3e-53: tmp = 1.0 + (x / (y * t)) else: tmp = 1.0 return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -6.8e-258) tmp = 1.0; elseif (z <= 1.3e-53) tmp = Float64(1.0 + Float64(x / Float64(y * t))); else tmp = 1.0; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -6.8e-258)
tmp = 1.0;
elseif (z <= 1.3e-53)
tmp = 1.0 + (x / (y * t));
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -6.8e-258], 1.0, If[LessEqual[z, 1.3e-53], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-258}:\\
\;\;\;\;1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-53}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -6.7999999999999996e-258 or 1.29999999999999998e-53 < z Initial program 99.1%
Taylor expanded in t around inf 77.1%
associate-*r/77.1%
neg-mul-177.1%
Simplified77.1%
Taylor expanded in y around inf 53.3%
mul-1-neg53.3%
distribute-frac-neg53.3%
Simplified53.3%
expm1-log1p-u49.5%
expm1-udef49.5%
add-sqr-sqrt24.9%
sqrt-unprod48.5%
sqr-neg48.5%
sqrt-unprod24.3%
add-sqr-sqrt49.7%
Applied egg-rr49.7%
expm1-def49.7%
expm1-log1p50.7%
Simplified50.7%
Taylor expanded in x around 0 76.3%
if -6.7999999999999996e-258 < z < 1.29999999999999998e-53Initial program 96.5%
Taylor expanded in t around inf 74.5%
associate-*r/74.5%
neg-mul-174.5%
Simplified74.5%
Taylor expanded in y around inf 67.4%
mul-1-neg67.4%
distribute-frac-neg67.4%
Simplified67.4%
expm1-log1p-u55.8%
expm1-udef55.8%
add-sqr-sqrt30.1%
sqrt-unprod52.1%
sqr-neg52.1%
sqrt-unprod25.7%
add-sqr-sqrt49.1%
Applied egg-rr49.1%
expm1-def49.1%
expm1-log1p53.8%
Simplified53.8%
sub-neg53.8%
distribute-neg-frac53.8%
add-sqr-sqrt25.9%
sqrt-unprod49.7%
sqr-neg49.7%
sqrt-unprod27.6%
add-sqr-sqrt67.4%
Applied egg-rr67.4%
Final simplification74.4%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3.9e-82) 1.0 (if (<= y 9e+18) (- 1.0 (/ x (* z t))) 1.0)))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.9e-82) {
tmp = 1.0;
} else if (y <= 9e+18) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: 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 <= (-3.9d-82)) then
tmp = 1.0d0
else if (y <= 9d+18) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.9e-82) {
tmp = 1.0;
} else if (y <= 9e+18) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if y <= -3.9e-82: tmp = 1.0 elif y <= 9e+18: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.9e-82) tmp = 1.0; elseif (y <= 9e+18) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = 1.0; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -3.9e-82)
tmp = 1.0;
elseif (y <= 9e+18)
tmp = 1.0 - (x / (z * t));
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -3.9e-82], 1.0, If[LessEqual[y, 9e+18], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{-82}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+18}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.89999999999999973e-82 or 9e18 < y Initial program 99.9%
Taylor expanded in t around inf 75.0%
associate-*r/75.0%
neg-mul-175.0%
Simplified75.0%
Taylor expanded in y around inf 70.3%
mul-1-neg70.3%
distribute-frac-neg70.3%
Simplified70.3%
expm1-log1p-u64.9%
expm1-udef64.9%
add-sqr-sqrt33.6%
sqrt-unprod60.6%
sqr-neg60.6%
sqrt-unprod30.7%
add-sqr-sqrt64.3%
Applied egg-rr64.3%
expm1-def64.3%
expm1-log1p65.7%
Simplified65.7%
Taylor expanded in x around 0 88.2%
if -3.89999999999999973e-82 < y < 9e18Initial program 96.6%
Taylor expanded in y around 0 69.7%
Final simplification80.2%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -7.5e-83) 1.0 (if (<= y 1.26e+47) (- 1.0 (/ x (* z t))) (- 1.0 (/ x (* y y))))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e-83) {
tmp = 1.0;
} else if (y <= 1.26e+47) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - (x / (y * y));
}
return tmp;
}
NOTE: 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 <= (-7.5d-83)) then
tmp = 1.0d0
else if (y <= 1.26d+47) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0 - (x / (y * y))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e-83) {
tmp = 1.0;
} else if (y <= 1.26e+47) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - (x / (y * y));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if y <= -7.5e-83: tmp = 1.0 elif y <= 1.26e+47: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 - (x / (y * y)) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e-83) tmp = 1.0; elseif (y <= 1.26e+47) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = Float64(1.0 - Float64(x / Float64(y * y))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -7.5e-83)
tmp = 1.0;
elseif (y <= 1.26e+47)
tmp = 1.0 - (x / (z * t));
else
tmp = 1.0 - (x / (y * y));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -7.5e-83], 1.0, If[LessEqual[y, 1.26e+47], 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}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{-83}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{+47}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -7.4999999999999997e-83Initial program 99.9%
Taylor expanded in t around inf 78.2%
associate-*r/78.2%
neg-mul-178.2%
Simplified78.2%
Taylor expanded in y around inf 73.4%
mul-1-neg73.4%
distribute-frac-neg73.4%
Simplified73.4%
expm1-log1p-u68.3%
expm1-udef68.3%
add-sqr-sqrt34.1%
sqrt-unprod63.6%
sqr-neg63.6%
sqrt-unprod32.9%
add-sqr-sqrt67.1%
Applied egg-rr67.1%
expm1-def67.1%
expm1-log1p69.1%
Simplified69.1%
Taylor expanded in x around 0 89.0%
if -7.4999999999999997e-83 < y < 1.26e47Initial program 96.9%
Taylor expanded in y around 0 68.0%
if 1.26e47 < y Initial program 100.0%
Taylor expanded in y around inf 97.3%
unpow297.3%
Simplified97.3%
Final simplification80.8%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.4e-80) 1.0 (if (<= y 9e-97) (- 1.0 (/ (/ x z) t)) (- 1.0 (/ x (* y y))))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-80) {
tmp = 1.0;
} else if (y <= 9e-97) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0 - (x / (y * y));
}
return tmp;
}
NOTE: 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.4d-80)) then
tmp = 1.0d0
else if (y <= 9d-97) then
tmp = 1.0d0 - ((x / z) / t)
else
tmp = 1.0d0 - (x / (y * y))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-80) {
tmp = 1.0;
} else if (y <= 9e-97) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0 - (x / (y * y));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.4e-80: tmp = 1.0 elif y <= 9e-97: tmp = 1.0 - ((x / z) / t) else: tmp = 1.0 - (x / (y * y)) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.4e-80) tmp = 1.0; elseif (y <= 9e-97) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); else tmp = Float64(1.0 - Float64(x / Float64(y * y))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1.4e-80)
tmp = 1.0;
elseif (y <= 9e-97)
tmp = 1.0 - ((x / z) / t);
else
tmp = 1.0 - (x / (y * y));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.4e-80], 1.0, If[LessEqual[y, 9e-97], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-80}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-97}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -1.39999999999999995e-80Initial program 99.9%
Taylor expanded in t around inf 78.2%
associate-*r/78.2%
neg-mul-178.2%
Simplified78.2%
Taylor expanded in y around inf 73.4%
mul-1-neg73.4%
distribute-frac-neg73.4%
Simplified73.4%
expm1-log1p-u68.3%
expm1-udef68.3%
add-sqr-sqrt34.1%
sqrt-unprod63.6%
sqr-neg63.6%
sqrt-unprod32.9%
add-sqr-sqrt67.1%
Applied egg-rr67.1%
expm1-def67.1%
expm1-log1p69.1%
Simplified69.1%
Taylor expanded in x around 0 89.0%
if -1.39999999999999995e-80 < y < 9.0000000000000002e-97Initial program 95.6%
associate-/r*98.7%
div-inv98.6%
Applied egg-rr98.6%
Taylor expanded in y around 0 77.4%
*-commutative77.4%
associate-/r*78.5%
Simplified78.5%
if 9.0000000000000002e-97 < y Initial program 99.9%
Taylor expanded in y around inf 75.3%
unpow275.3%
Simplified75.3%
Final simplification81.0%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 3e-95) (- 1.0 (/ (/ x (- y z)) y)) (+ 1.0 (/ x (* (- y z) t)))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3e-95) {
tmp = 1.0 - ((x / (y - z)) / y);
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
NOTE: 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 <= 3d-95) then
tmp = 1.0d0 - ((x / (y - z)) / y)
else
tmp = 1.0d0 + (x / ((y - z) * t))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3e-95) {
tmp = 1.0 - ((x / (y - z)) / y);
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if t <= 3e-95: tmp = 1.0 - ((x / (y - z)) / y) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 3e-95) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - z)) / y)); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 3e-95)
tmp = 1.0 - ((x / (y - z)) / y);
else
tmp = 1.0 + (x / ((y - z) * t));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 3e-95], N[(1.0 - N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3 \cdot 10^{-95}:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < 3e-95Initial program 97.8%
associate-/r*98.7%
div-inv98.7%
Applied egg-rr98.7%
un-div-inv98.7%
Applied egg-rr98.7%
Taylor expanded in t around 0 78.6%
*-lft-identity78.6%
times-frac79.8%
associate-*l/79.9%
*-lft-identity79.9%
Simplified79.9%
if 3e-95 < t Initial program 99.9%
Taylor expanded in t around inf 93.6%
associate-*r/93.6%
neg-mul-193.6%
Simplified93.6%
Final simplification84.7%
NOTE: 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) (- y t)))))
assert(z < t);
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
NOTE: 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) * (y - t)))
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
[z, t] = sort([z, t]) def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
z, t = sort([z, t]) function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - (x / ((y - z) * (y - t)));
end
NOTE: 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[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Initial program 98.5%
Final simplification98.5%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 1.0)
assert(z < t);
double code(double x, double y, double z, double t) {
return 1.0;
}
NOTE: 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 z < t;
public static double code(double x, double y, double z, double t) {
return 1.0;
}
[z, t] = sort([z, t]) def code(x, y, z, t): return 1.0
z, t = sort([z, t]) function code(x, y, z, t) return 1.0 end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
1
\end{array}
Initial program 98.5%
Taylor expanded in t around inf 76.6%
associate-*r/76.6%
neg-mul-176.6%
Simplified76.6%
Taylor expanded in y around inf 56.3%
mul-1-neg56.3%
distribute-frac-neg56.3%
Simplified56.3%
expm1-log1p-u50.9%
expm1-udef50.9%
add-sqr-sqrt26.0%
sqrt-unprod49.3%
sqr-neg49.3%
sqrt-unprod24.6%
add-sqr-sqrt49.5%
Applied egg-rr49.5%
expm1-def49.5%
expm1-log1p51.4%
Simplified51.4%
Taylor expanded in x around 0 72.0%
Final simplification72.0%
herbie shell --seed 2023200
(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)))))