
(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 16 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 92.0%
*-un-lft-identity92.0%
times-frac98.5%
Applied egg-rr98.5%
associate-*l/98.6%
*-un-lft-identity98.6%
Applied egg-rr98.6%
Final simplification98.6%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -2.26e+30)
(/ (/ x y) (- t z))
(if (<= y -1.9e-6)
(/ (/ (- x) z) (- y z))
(if (<= y -4.4e-39)
(* x (/ 1.0 (* (- t z) y)))
(if (<= y 7.2e-142)
(/ -1.0 (* z (/ (- t z) x)))
(/ (/ x t) (- y z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.26e+30) {
tmp = (x / y) / (t - z);
} else if (y <= -1.9e-6) {
tmp = (-x / z) / (y - z);
} else if (y <= -4.4e-39) {
tmp = x * (1.0 / ((t - z) * y));
} else if (y <= 7.2e-142) {
tmp = -1.0 / (z * ((t - 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 <= (-2.26d+30)) then
tmp = (x / y) / (t - z)
else if (y <= (-1.9d-6)) then
tmp = (-x / z) / (y - z)
else if (y <= (-4.4d-39)) then
tmp = x * (1.0d0 / ((t - z) * y))
else if (y <= 7.2d-142) then
tmp = (-1.0d0) / (z * ((t - 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 <= -2.26e+30) {
tmp = (x / y) / (t - z);
} else if (y <= -1.9e-6) {
tmp = (-x / z) / (y - z);
} else if (y <= -4.4e-39) {
tmp = x * (1.0 / ((t - z) * y));
} else if (y <= 7.2e-142) {
tmp = -1.0 / (z * ((t - 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 <= -2.26e+30: tmp = (x / y) / (t - z) elif y <= -1.9e-6: tmp = (-x / z) / (y - z) elif y <= -4.4e-39: tmp = x * (1.0 / ((t - z) * y)) elif y <= 7.2e-142: tmp = -1.0 / (z * ((t - 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 <= -2.26e+30) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= -1.9e-6) tmp = Float64(Float64(Float64(-x) / z) / Float64(y - z)); elseif (y <= -4.4e-39) tmp = Float64(x * Float64(1.0 / Float64(Float64(t - z) * y))); elseif (y <= 7.2e-142) tmp = Float64(-1.0 / Float64(z * Float64(Float64(t - z) / x))); 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.26e+30)
tmp = (x / y) / (t - z);
elseif (y <= -1.9e-6)
tmp = (-x / z) / (y - z);
elseif (y <= -4.4e-39)
tmp = x * (1.0 / ((t - z) * y));
elseif (y <= 7.2e-142)
tmp = -1.0 / (z * ((t - 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, -2.26e+30], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.9e-6], N[(N[((-x) / z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.4e-39], N[(x * N[(1.0 / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e-142], N[(-1.0 / N[(z * N[(N[(t - z), $MachinePrecision] / x), $MachinePrecision]), $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.26 \cdot 10^{+30}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y - z}\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-39}:\\
\;\;\;\;x \cdot \frac{1}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-142}:\\
\;\;\;\;\frac{-1}{z \cdot \frac{t - z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.26e30Initial program 89.4%
associate-/r*96.5%
Simplified96.5%
Taylor expanded in y around inf 89.5%
if -2.26e30 < y < -1.9e-6Initial program 99.5%
Taylor expanded in t around 0 83.6%
associate-*r/83.6%
neg-mul-183.6%
*-commutative83.6%
associate-/r*84.1%
Simplified84.1%
if -1.9e-6 < y < -4.40000000000000002e-39Initial program 99.8%
Taylor expanded in y around inf 72.2%
*-commutative72.2%
Simplified72.2%
div-inv72.2%
*-commutative72.2%
Applied egg-rr72.2%
if -4.40000000000000002e-39 < y < 7.20000000000000001e-142Initial program 94.6%
associate-/r*95.5%
Simplified95.5%
clear-num95.4%
associate-/r/95.4%
Applied egg-rr95.4%
Taylor expanded in y around 0 87.7%
associate-/l*89.0%
div-inv89.0%
*-un-lft-identity89.0%
times-frac89.0%
metadata-eval89.0%
Applied egg-rr89.0%
mul-1-neg89.0%
associate-/l/89.0%
distribute-neg-frac89.0%
metadata-eval89.0%
Simplified89.0%
if 7.20000000000000001e-142 < y Initial program 90.1%
Taylor expanded in t around inf 63.8%
associate-/r*64.9%
Simplified64.9%
Final simplification79.2%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -4.2e-43)
(/ x (* (- t z) y))
(if (or (<= y -2.5e-150) (and (not (<= y -1.55e-186)) (<= y -1.82e-239)))
(/ (/ x z) z)
(/ x (* t (- y z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e-43) {
tmp = x / ((t - z) * y);
} else if ((y <= -2.5e-150) || (!(y <= -1.55e-186) && (y <= -1.82e-239))) {
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 <= (-4.2d-43)) then
tmp = x / ((t - z) * y)
else if ((y <= (-2.5d-150)) .or. (.not. (y <= (-1.55d-186))) .and. (y <= (-1.82d-239))) 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 <= -4.2e-43) {
tmp = x / ((t - z) * y);
} else if ((y <= -2.5e-150) || (!(y <= -1.55e-186) && (y <= -1.82e-239))) {
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 <= -4.2e-43: tmp = x / ((t - z) * y) elif (y <= -2.5e-150) or (not (y <= -1.55e-186) and (y <= -1.82e-239)): 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 <= -4.2e-43) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif ((y <= -2.5e-150) || (!(y <= -1.55e-186) && (y <= -1.82e-239))) tmp = Float64(Float64(x / z) / z); 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 <= -4.2e-43)
tmp = x / ((t - z) * y);
elseif ((y <= -2.5e-150) || (~((y <= -1.55e-186)) && (y <= -1.82e-239)))
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, -4.2e-43], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -2.5e-150], And[N[Not[LessEqual[y, -1.55e-186]], $MachinePrecision], LessEqual[y, -1.82e-239]]], N[(N[(x / z), $MachinePrecision] / z), $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 -4.2 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-150} \lor \neg \left(y \leq -1.55 \cdot 10^{-186}\right) \land y \leq -1.82 \cdot 10^{-239}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -4.2000000000000001e-43Initial program 91.4%
Taylor expanded in y around inf 82.7%
*-commutative82.7%
Simplified82.7%
if -4.2000000000000001e-43 < y < -2.49999999999999995e-150 or -1.55000000000000005e-186 < y < -1.8200000000000001e-239Initial program 92.4%
Taylor expanded in z around inf 65.7%
unpow265.7%
associate-/r*69.2%
Simplified69.2%
if -2.49999999999999995e-150 < y < -1.55000000000000005e-186 or -1.8200000000000001e-239 < y Initial program 92.2%
Taylor expanded in t around inf 62.3%
Final simplification68.3%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (or (<= z -29000000000000.0)
(not (or (<= z 3.7e-65) (and (not (<= z 3.2e-29)) (<= z 6.8e+24)))))
(/ x (* z z))
(/ x (* t y))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -29000000000000.0) || !((z <= 3.7e-65) || (!(z <= 3.2e-29) && (z <= 6.8e+24)))) {
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 <= (-29000000000000.0d0)) .or. (.not. (z <= 3.7d-65) .or. (.not. (z <= 3.2d-29)) .and. (z <= 6.8d+24))) 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 <= -29000000000000.0) || !((z <= 3.7e-65) || (!(z <= 3.2e-29) && (z <= 6.8e+24)))) {
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 <= -29000000000000.0) or not ((z <= 3.7e-65) or (not (z <= 3.2e-29) and (z <= 6.8e+24))): 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 <= -29000000000000.0) || !((z <= 3.7e-65) || (!(z <= 3.2e-29) && (z <= 6.8e+24)))) 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 <= -29000000000000.0) || ~(((z <= 3.7e-65) || (~((z <= 3.2e-29)) && (z <= 6.8e+24)))))
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, -29000000000000.0], N[Not[Or[LessEqual[z, 3.7e-65], And[N[Not[LessEqual[z, 3.2e-29]], $MachinePrecision], LessEqual[z, 6.8e+24]]]], $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 -29000000000000 \lor \neg \left(z \leq 3.7 \cdot 10^{-65} \lor \neg \left(z \leq 3.2 \cdot 10^{-29}\right) \land z \leq 6.8 \cdot 10^{+24}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -2.9e13 or 3.7e-65 < z < 3.2e-29 or 6.8000000000000001e24 < z Initial program 87.9%
Taylor expanded in z around inf 71.6%
unpow271.6%
Simplified71.6%
if -2.9e13 < z < 3.7e-65 or 3.2e-29 < z < 6.8000000000000001e24Initial program 96.1%
Taylor expanded in z around 0 58.0%
Final simplification64.8%
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 (* t (- y z)))))
(if (<= t -1.35e-80)
t_1
(if (<= t 3.5e-301)
(/ (/ (- x) z) y)
(if (<= t 9e-116) (/ (/ x z) z) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (t * (y - z));
double tmp;
if (t <= -1.35e-80) {
tmp = t_1;
} else if (t <= 3.5e-301) {
tmp = (-x / z) / y;
} else if (t <= 9e-116) {
tmp = (x / z) / 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 = x / (t * (y - z))
if (t <= (-1.35d-80)) then
tmp = t_1
else if (t <= 3.5d-301) then
tmp = (-x / z) / y
else if (t <= 9d-116) then
tmp = (x / z) / 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 = x / (t * (y - z));
double tmp;
if (t <= -1.35e-80) {
tmp = t_1;
} else if (t <= 3.5e-301) {
tmp = (-x / z) / y;
} else if (t <= 9e-116) {
tmp = (x / z) / z;
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = x / (t * (y - z)) tmp = 0 if t <= -1.35e-80: tmp = t_1 elif t <= 3.5e-301: tmp = (-x / z) / y elif t <= 9e-116: tmp = (x / z) / z else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(t * Float64(y - z))) tmp = 0.0 if (t <= -1.35e-80) tmp = t_1; elseif (t <= 3.5e-301) tmp = Float64(Float64(Float64(-x) / z) / y); elseif (t <= 9e-116) tmp = Float64(Float64(x / z) / 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 = x / (t * (y - z));
tmp = 0.0;
if (t <= -1.35e-80)
tmp = t_1;
elseif (t <= 3.5e-301)
tmp = (-x / z) / y;
elseif (t <= 9e-116)
tmp = (x / z) / 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[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.35e-80], t$95$1, If[LessEqual[t, 3.5e-301], N[(N[((-x) / z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 9e-116], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{-80}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-301}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-116}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.3500000000000001e-80 or 9.00000000000000023e-116 < t Initial program 91.2%
Taylor expanded in t around inf 79.7%
if -1.3500000000000001e-80 < t < 3.49999999999999992e-301Initial program 89.2%
Taylor expanded in y around inf 54.2%
*-commutative54.2%
Simplified54.2%
Taylor expanded in t around 0 45.4%
associate-*r/45.4%
neg-mul-145.4%
*-commutative45.4%
Simplified45.4%
Taylor expanded in x around 0 45.4%
*-commutative45.4%
associate-*r/45.4%
associate-/r*50.7%
neg-mul-150.7%
Simplified50.7%
if 3.49999999999999992e-301 < t < 9.00000000000000023e-116Initial program 97.8%
Taylor expanded in z around inf 60.2%
unpow260.2%
associate-/r*60.2%
Simplified60.2%
Final simplification71.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.16e-38) (/ (/ x y) (- t z)) (if (<= y 1.6e-139) (/ (/ (- x) z) (- t z)) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.16e-38) {
tmp = (x / y) / (t - z);
} else if (y <= 1.6e-139) {
tmp = (-x / z) / (t - 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.16d-38)) then
tmp = (x / y) / (t - z)
else if (y <= 1.6d-139) then
tmp = (-x / z) / (t - 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.16e-38) {
tmp = (x / y) / (t - z);
} else if (y <= 1.6e-139) {
tmp = (-x / z) / (t - 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.16e-38: tmp = (x / y) / (t - z) elif y <= 1.6e-139: tmp = (-x / z) / (t - 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.16e-38) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 1.6e-139) tmp = Float64(Float64(Float64(-x) / z) / Float64(t - 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.16e-38)
tmp = (x / y) / (t - z);
elseif (y <= 1.6e-139)
tmp = (-x / z) / (t - 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.16e-38], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-139], N[(N[((-x) / z), $MachinePrecision] / N[(t - 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.16 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-139}:\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.16e-38Initial program 91.4%
associate-/r*97.1%
Simplified97.1%
Taylor expanded in y around inf 84.3%
if -2.16e-38 < y < 1.6e-139Initial program 94.7%
Taylor expanded in y around 0 86.1%
mul-1-neg86.1%
distribute-frac-neg86.1%
associate-/r*88.0%
Simplified88.0%
if 1.6e-139 < y Initial program 90.0%
Taylor expanded in t around inf 64.4%
associate-/r*65.5%
Simplified65.5%
Final simplification78.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -6.5e-80) (/ (/ x y) (- t z)) (if (<= t 5.8e-62) (/ (/ (- x) z) (- y z)) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -6.5e-80) {
tmp = (x / y) / (t - z);
} else if (t <= 5.8e-62) {
tmp = (-x / z) / (y - 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 (t <= (-6.5d-80)) then
tmp = (x / y) / (t - z)
else if (t <= 5.8d-62) then
tmp = (-x / z) / (y - 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 (t <= -6.5e-80) {
tmp = (x / y) / (t - z);
} else if (t <= 5.8e-62) {
tmp = (-x / z) / (y - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= -6.5e-80: tmp = (x / y) / (t - z) elif t <= 5.8e-62: tmp = (-x / z) / (y - z) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -6.5e-80) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 5.8e-62) tmp = Float64(Float64(Float64(-x) / z) / Float64(y - 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 (t <= -6.5e-80)
tmp = (x / y) / (t - z);
elseif (t <= 5.8e-62)
tmp = (-x / z) / (y - 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[t, -6.5e-80], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e-62], N[(N[((-x) / z), $MachinePrecision] / N[(y - 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}\;t \leq -6.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -6.49999999999999984e-80Initial program 88.5%
associate-/r*98.6%
Simplified98.6%
Taylor expanded in y around inf 64.8%
if -6.49999999999999984e-80 < t < 5.79999999999999971e-62Initial program 94.1%
Taylor expanded in t around 0 81.8%
associate-*r/81.8%
neg-mul-181.8%
*-commutative81.8%
associate-/r*86.6%
Simplified86.6%
if 5.79999999999999971e-62 < t Initial program 93.2%
Taylor expanded in t around inf 88.7%
associate-/r*90.3%
Simplified90.3%
Final simplification80.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -1.75e-74) (* (/ x y) (/ 1.0 (- t z))) (if (<= t 6.4e-62) (/ (/ (- x) z) (- y z)) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.75e-74) {
tmp = (x / y) * (1.0 / (t - z));
} else if (t <= 6.4e-62) {
tmp = (-x / z) / (y - 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 (t <= (-1.75d-74)) then
tmp = (x / y) * (1.0d0 / (t - z))
else if (t <= 6.4d-62) then
tmp = (-x / z) / (y - 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 (t <= -1.75e-74) {
tmp = (x / y) * (1.0 / (t - z));
} else if (t <= 6.4e-62) {
tmp = (-x / z) / (y - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= -1.75e-74: tmp = (x / y) * (1.0 / (t - z)) elif t <= 6.4e-62: tmp = (-x / z) / (y - z) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.75e-74) tmp = Float64(Float64(x / y) * Float64(1.0 / Float64(t - z))); elseif (t <= 6.4e-62) tmp = Float64(Float64(Float64(-x) / z) / Float64(y - 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 (t <= -1.75e-74)
tmp = (x / y) * (1.0 / (t - z));
elseif (t <= 6.4e-62)
tmp = (-x / z) / (y - 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[t, -1.75e-74], N[(N[(x / y), $MachinePrecision] * N[(1.0 / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.4e-62], N[(N[((-x) / z), $MachinePrecision] / N[(y - 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}\;t \leq -1.75 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{t - z}\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.75000000000000007e-74Initial program 88.1%
Taylor expanded in y around inf 60.1%
*-commutative60.1%
Simplified60.1%
*-un-lft-identity60.1%
times-frac64.6%
Applied egg-rr64.6%
if -1.75000000000000007e-74 < t < 6.40000000000000043e-62Initial program 94.3%
Taylor expanded in t around 0 82.4%
associate-*r/82.4%
neg-mul-182.4%
*-commutative82.4%
associate-/r*87.0%
Simplified87.0%
if 6.40000000000000043e-62 < t Initial program 93.2%
Taylor expanded in t around inf 88.7%
associate-/r*90.3%
Simplified90.3%
Final simplification81.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 2.55e-300) (/ x (* (- t z) y)) (if (<= t 8.2e-116) (/ (/ x z) z) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.55e-300) {
tmp = x / ((t - z) * y);
} else if (t <= 8.2e-116) {
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 (t <= 2.55d-300) then
tmp = x / ((t - z) * y)
else if (t <= 8.2d-116) 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 (t <= 2.55e-300) {
tmp = x / ((t - z) * y);
} else if (t <= 8.2e-116) {
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 t <= 2.55e-300: tmp = x / ((t - z) * y) elif t <= 8.2e-116: 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 (t <= 2.55e-300) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (t <= 8.2e-116) tmp = Float64(Float64(x / 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 (t <= 2.55e-300)
tmp = x / ((t - z) * y);
elseif (t <= 8.2e-116)
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[t, 2.55e-300], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.2e-116], N[(N[(x / z), $MachinePrecision] / z), $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}\;t \leq 2.55 \cdot 10^{-300}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{-116}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 2.55e-300Initial program 88.7%
Taylor expanded in y around inf 58.2%
*-commutative58.2%
Simplified58.2%
if 2.55e-300 < t < 8.1999999999999998e-116Initial program 97.8%
Taylor expanded in z around inf 60.2%
unpow260.2%
associate-/r*60.2%
Simplified60.2%
if 8.1999999999999998e-116 < t Initial program 93.8%
Taylor expanded in t around inf 84.0%
associate-/r*85.5%
Simplified85.5%
Final simplification67.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 8e-299) (/ (/ x y) (- t z)) (if (<= t 7.5e-116) (/ (/ x z) z) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8e-299) {
tmp = (x / y) / (t - z);
} else if (t <= 7.5e-116) {
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 (t <= 8d-299) then
tmp = (x / y) / (t - z)
else if (t <= 7.5d-116) 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 (t <= 8e-299) {
tmp = (x / y) / (t - z);
} else if (t <= 7.5e-116) {
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 t <= 8e-299: tmp = (x / y) / (t - z) elif t <= 7.5e-116: 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 (t <= 8e-299) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 7.5e-116) tmp = Float64(Float64(x / 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 (t <= 8e-299)
tmp = (x / y) / (t - z);
elseif (t <= 7.5e-116)
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[t, 8e-299], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e-116], N[(N[(x / z), $MachinePrecision] / z), $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}\;t \leq 8 \cdot 10^{-299}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-116}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 7.99999999999999994e-299Initial program 88.7%
associate-/r*96.9%
Simplified96.9%
Taylor expanded in y around inf 59.8%
if 7.99999999999999994e-299 < t < 7.5000000000000004e-116Initial program 97.8%
Taylor expanded in z around inf 60.2%
unpow260.2%
associate-/r*60.2%
Simplified60.2%
if 7.5000000000000004e-116 < t Initial program 93.8%
Taylor expanded in t around inf 84.0%
associate-/r*85.5%
Simplified85.5%
Final simplification68.2%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 4.3e+200) (/ x (* (- t z) (- y z))) (/ (/ x t) (- y z))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 4.3e+200) {
tmp = x / ((t - z) * (y - 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 (t <= 4.3d+200) then
tmp = x / ((t - z) * (y - 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 (t <= 4.3e+200) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= 4.3e+200: tmp = x / ((t - z) * (y - z)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 4.3e+200) tmp = Float64(x / Float64(Float64(t - z) * Float64(y - 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 (t <= 4.3e+200)
tmp = x / ((t - z) * (y - 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[t, 4.3e+200], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $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}\;t \leq 4.3 \cdot 10^{+200}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 4.30000000000000031e200Initial program 92.7%
if 4.30000000000000031e200 < t Initial program 83.3%
Taylor expanded in t around inf 83.3%
associate-/r*95.0%
Simplified95.0%
Final simplification92.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 -1.5e+109) (not (<= z 2.15e+48))) (/ x (* z y)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.5e+109) || !(z <= 2.15e+48)) {
tmp = x / (z * y);
} 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.5d+109)) .or. (.not. (z <= 2.15d+48))) then
tmp = x / (z * y)
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.5e+109) || !(z <= 2.15e+48)) {
tmp = x / (z * y);
} else {
tmp = x / (t * y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.5e+109) or not (z <= 2.15e+48): tmp = x / (z * y) else: tmp = x / (t * y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.5e+109) || !(z <= 2.15e+48)) tmp = Float64(x / Float64(z * y)); 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.5e+109) || ~((z <= 2.15e+48)))
tmp = x / (z * y);
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.5e+109], N[Not[LessEqual[z, 2.15e+48]], $MachinePrecision]], N[(x / N[(z * y), $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.5 \cdot 10^{+109} \lor \neg \left(z \leq 2.15 \cdot 10^{+48}\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -1.50000000000000008e109 or 2.14999999999999989e48 < z Initial program 87.1%
Taylor expanded in y around inf 49.2%
*-commutative49.2%
Simplified49.2%
Taylor expanded in t around 0 47.9%
associate-*r/47.9%
neg-mul-147.9%
*-commutative47.9%
Simplified47.9%
expm1-log1p-u47.6%
expm1-udef67.2%
add-sqr-sqrt37.2%
sqrt-unprod65.2%
sqr-neg65.2%
sqrt-unprod29.2%
add-sqr-sqrt66.4%
Applied egg-rr66.4%
expm1-def45.8%
expm1-log1p46.0%
*-commutative46.0%
Simplified46.0%
if -1.50000000000000008e109 < z < 2.14999999999999989e48Initial program 94.7%
Taylor expanded in z around 0 48.4%
Final simplification47.5%
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.05e+34) (not (<= z 7e+25))) (/ x (* z z)) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e+34) || !(z <= 7e+25)) {
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.05d+34)) .or. (.not. (z <= 7d+25))) 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.05e+34) || !(z <= 7e+25)) {
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.05e+34) or not (z <= 7e+25): 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.05e+34) || !(z <= 7e+25)) 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 <= -1.05e+34) || ~((z <= 7e+25)))
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.05e+34], N[Not[LessEqual[z, 7e+25]], $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 -1.05 \cdot 10^{+34} \lor \neg \left(z \leq 7 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.05000000000000009e34 or 6.99999999999999999e25 < z Initial program 89.5%
Taylor expanded in z around inf 75.8%
unpow275.8%
Simplified75.8%
if -1.05000000000000009e34 < z < 6.99999999999999999e25Initial program 93.9%
Taylor expanded in z around 0 52.6%
*-un-lft-identity52.6%
times-frac58.5%
Applied egg-rr58.5%
associate-*l/58.6%
*-lft-identity58.6%
Simplified58.6%
Final simplification66.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 -9e+34) (not (<= z 3.9e+31))) (/ (/ x z) z) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9e+34) || !(z <= 3.9e+31)) {
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 <= (-9d+34)) .or. (.not. (z <= 3.9d+31))) 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 <= -9e+34) || !(z <= 3.9e+31)) {
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 <= -9e+34) or not (z <= 3.9e+31): 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 <= -9e+34) || !(z <= 3.9e+31)) tmp = Float64(Float64(x / 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 <= -9e+34) || ~((z <= 3.9e+31)))
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, -9e+34], N[Not[LessEqual[z, 3.9e+31]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+34} \lor \neg \left(z \leq 3.9 \cdot 10^{+31}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -9.0000000000000001e34 or 3.89999999999999999e31 < z Initial program 89.5%
Taylor expanded in z around inf 75.8%
unpow275.8%
associate-/r*79.9%
Simplified79.9%
if -9.0000000000000001e34 < z < 3.89999999999999999e31Initial program 93.9%
Taylor expanded in z around 0 52.6%
*-un-lft-identity52.6%
times-frac58.5%
Applied egg-rr58.5%
associate-*l/58.6%
*-lft-identity58.6%
Simplified58.6%
Final simplification67.9%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -2.3e+35) (/ x (* t z)) (if (<= z 3.2e+43) (/ x (* t y)) (/ x (* z y)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.3e+35) {
tmp = x / (t * z);
} else if (z <= 3.2e+43) {
tmp = x / (t * y);
} else {
tmp = x / (z * 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 <= (-2.3d+35)) then
tmp = x / (t * z)
else if (z <= 3.2d+43) then
tmp = x / (t * y)
else
tmp = x / (z * 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 <= -2.3e+35) {
tmp = x / (t * z);
} else if (z <= 3.2e+43) {
tmp = x / (t * y);
} else {
tmp = x / (z * y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -2.3e+35: tmp = x / (t * z) elif z <= 3.2e+43: tmp = x / (t * y) else: tmp = x / (z * y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2.3e+35) tmp = Float64(x / Float64(t * z)); elseif (z <= 3.2e+43) tmp = Float64(x / Float64(t * y)); else tmp = Float64(x / Float64(z * y)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -2.3e+35)
tmp = x / (t * z);
elseif (z <= 3.2e+43)
tmp = x / (t * y);
else
tmp = x / (z * 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[LessEqual[z, -2.3e+35], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+43], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{t \cdot z}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+43}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot y}\\
\end{array}
\end{array}
if z < -2.2999999999999998e35Initial program 91.5%
Taylor expanded in y around 0 81.5%
mul-1-neg81.5%
distribute-frac-neg81.5%
associate-/r*85.8%
Simplified85.8%
Taylor expanded in z around 0 43.4%
associate-*r/43.4%
neg-mul-143.4%
*-commutative43.4%
Simplified43.4%
expm1-log1p-u43.1%
expm1-udef58.8%
add-sqr-sqrt32.1%
sqrt-unprod57.3%
sqr-neg57.3%
sqrt-unprod26.6%
add-sqr-sqrt58.6%
Applied egg-rr58.6%
expm1-def41.5%
expm1-log1p41.9%
Simplified41.9%
if -2.2999999999999998e35 < z < 3.20000000000000014e43Initial program 94.1%
Taylor expanded in z around 0 51.3%
if 3.20000000000000014e43 < z Initial program 86.2%
Taylor expanded in y around inf 47.2%
*-commutative47.2%
Simplified47.2%
Taylor expanded in t around 0 45.2%
associate-*r/45.2%
neg-mul-145.2%
*-commutative45.2%
Simplified45.2%
expm1-log1p-u44.8%
expm1-udef63.4%
add-sqr-sqrt33.9%
sqrt-unprod61.4%
sqr-neg61.4%
sqrt-unprod27.8%
add-sqr-sqrt61.7%
Applied egg-rr61.7%
expm1-def43.2%
expm1-log1p43.4%
*-commutative43.4%
Simplified43.4%
Final simplification47.6%
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 92.0%
Taylor expanded in z around 0 40.0%
Final simplification40.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 2023268
(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))))