
(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: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) (- t z))))
(if (or (<= t_1 -2e+237) (not (<= t_1 1e+219)))
(/ (/ x (- t z)) (- y z))
(/ x t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((t_1 <= -2e+237) || !(t_1 <= 1e+219)) {
tmp = (x / (t - z)) / (y - z);
} else {
tmp = x / t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if ((t_1 <= (-2d+237)) .or. (.not. (t_1 <= 1d+219))) then
tmp = (x / (t - z)) / (y - z)
else
tmp = x / t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((t_1 <= -2e+237) || !(t_1 <= 1e+219)) {
tmp = (x / (t - z)) / (y - z);
} else {
tmp = x / t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (t_1 <= -2e+237) or not (t_1 <= 1e+219): tmp = (x / (t - z)) / (y - z) else: tmp = x / t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if ((t_1 <= -2e+237) || !(t_1 <= 1e+219)) tmp = Float64(Float64(x / Float64(t - z)) / Float64(y - z)); else tmp = Float64(x / t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (y - z) * (t - z);
tmp = 0.0;
if ((t_1 <= -2e+237) || ~((t_1 <= 1e+219)))
tmp = (x / (t - z)) / (y - z);
else
tmp = x / t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+237], N[Not[LessEqual[t$95$1, 1e+219]], $MachinePrecision]], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x / t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+237} \lor \neg \left(t\_1 \leq 10^{+219}\right):\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t\_1}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -1.99999999999999988e237 or 9.99999999999999965e218 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 78.7%
associate-/l/99.9%
Simplified99.9%
if -1.99999999999999988e237 < (*.f64 (-.f64 y z) (-.f64 t z)) < 9.99999999999999965e218Initial program 99.6%
Final simplification99.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -2.9e+123) (not (<= z 1.85e+143))) (/ (/ x z) (- z y)) (/ x (* (- y z) (- t z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+123) || !(z <= 1.85e+143)) {
tmp = (x / z) / (z - y);
} else {
tmp = x / ((y - z) * (t - z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.9d+123)) .or. (.not. (z <= 1.85d+143))) then
tmp = (x / z) / (z - y)
else
tmp = x / ((y - z) * (t - z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+123) || !(z <= 1.85e+143)) {
tmp = (x / z) / (z - y);
} else {
tmp = x / ((y - z) * (t - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -2.9e+123) or not (z <= 1.85e+143): tmp = (x / z) / (z - y) else: tmp = x / ((y - z) * (t - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -2.9e+123) || !(z <= 1.85e+143)) tmp = Float64(Float64(x / z) / Float64(z - y)); else tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -2.9e+123) || ~((z <= 1.85e+143)))
tmp = (x / z) / (z - y);
else
tmp = x / ((y - z) * (t - z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.9e+123], N[Not[LessEqual[z, 1.85e+143]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+123} \lor \neg \left(z \leq 1.85 \cdot 10^{+143}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if z < -2.9000000000000001e123 or 1.8500000000000001e143 < z Initial program 72.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 96.0%
associate-*r/57.4%
neg-mul-157.4%
Simplified96.0%
if -2.9000000000000001e123 < z < 1.8500000000000001e143Initial program 95.7%
Final simplification95.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -9e-187) (/ (/ x y) t) (if (<= t 1.08e-69) (/ (/ x (- z)) y) (/ x (* (- y z) t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -9e-187) {
tmp = (x / y) / t;
} else if (t <= 1.08e-69) {
tmp = (x / -z) / y;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-9d-187)) then
tmp = (x / y) / t
else if (t <= 1.08d-69) then
tmp = (x / -z) / y
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -9e-187) {
tmp = (x / y) / t;
} else if (t <= 1.08e-69) {
tmp = (x / -z) / y;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -9e-187: tmp = (x / y) / t elif t <= 1.08e-69: tmp = (x / -z) / y else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -9e-187) tmp = Float64(Float64(x / y) / t); elseif (t <= 1.08e-69) tmp = Float64(Float64(x / Float64(-z)) / y); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -9e-187)
tmp = (x / y) / t;
elseif (t <= 1.08e-69)
tmp = (x / -z) / y;
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -9e-187], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1.08e-69], N[(N[(x / (-z)), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{-187}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;t \leq 1.08 \cdot 10^{-69}:\\
\;\;\;\;\frac{\frac{x}{-z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -8.9999999999999996e-187Initial program 90.0%
Taylor expanded in z around 0 43.7%
clear-num43.7%
associate-/r/43.7%
*-commutative43.7%
associate-/r*44.9%
Applied egg-rr44.9%
*-commutative44.9%
associate-*r/43.0%
div-inv43.1%
Applied egg-rr43.1%
if -8.9999999999999996e-187 < t < 1.0800000000000001e-69Initial program 89.5%
Taylor expanded in y around inf 59.1%
*-commutative59.1%
Simplified59.1%
associate-/r*60.2%
div-inv60.3%
Applied egg-rr60.3%
un-div-inv60.2%
Applied egg-rr60.2%
Taylor expanded in t around 0 57.9%
associate-*r/57.9%
neg-mul-157.9%
Simplified57.9%
if 1.0800000000000001e-69 < t Initial program 87.1%
Taylor expanded in t around inf 79.5%
Final simplification58.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.4e-15) (/ (/ x y) (- t z)) (if (<= y 1.06e-200) (/ x (* (- y z) t)) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-15) {
tmp = (x / y) / (t - z);
} else if (y <= 1.06e-200) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.4d-15)) then
tmp = (x / y) / (t - z)
else if (y <= 1.06d-200) then
tmp = x / ((y - z) * t)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-15) {
tmp = (x / y) / (t - z);
} else if (y <= 1.06e-200) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.4e-15: tmp = (x / y) / (t - z) elif y <= 1.06e-200: tmp = x / ((y - z) * t) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.4e-15) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 1.06e-200) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1.4e-15)
tmp = (x / y) / (t - z);
elseif (y <= 1.06e-200)
tmp = x / ((y - z) * t);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.4e-15], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e-200], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{-200}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.40000000000000007e-15Initial program 87.3%
Taylor expanded in x around 0 87.3%
associate-/l/98.0%
Simplified98.0%
Taylor expanded in y around inf 88.6%
if -1.40000000000000007e-15 < y < 1.05999999999999998e-200Initial program 92.8%
Taylor expanded in t around inf 60.5%
if 1.05999999999999998e-200 < y Initial program 87.1%
associate-/l/97.1%
Simplified97.1%
Taylor expanded in t around inf 58.4%
Final simplification67.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.7e-12) (/ (/ x y) (- t z)) (if (<= y 5.8e-202) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.7e-12) {
tmp = (x / y) / (t - z);
} else if (y <= 5.8e-202) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.7d-12)) then
tmp = (x / y) / (t - z)
else if (y <= 5.8d-202) then
tmp = x / (z * (z - t))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.7e-12) {
tmp = (x / y) / (t - z);
} else if (y <= 5.8e-202) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -2.7e-12: tmp = (x / y) / (t - z) elif y <= 5.8e-202: tmp = x / (z * (z - t)) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.7e-12) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 5.8e-202) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -2.7e-12)
tmp = (x / y) / (t - z);
elseif (y <= 5.8e-202)
tmp = x / (z * (z - t));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -2.7e-12], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e-202], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-202}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.6999999999999998e-12Initial program 87.3%
Taylor expanded in x around 0 87.3%
associate-/l/98.0%
Simplified98.0%
Taylor expanded in y around inf 88.6%
if -2.6999999999999998e-12 < y < 5.79999999999999976e-202Initial program 92.8%
Taylor expanded in y around 0 76.7%
associate-*r/76.7%
neg-mul-176.7%
Simplified76.7%
if 5.79999999999999976e-202 < y Initial program 87.2%
associate-/l/96.3%
Simplified96.3%
Taylor expanded in t around inf 58.0%
Final simplification71.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3.45e-12) (/ (/ x y) (- t z)) (if (<= y 1.3e-63) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.45e-12) {
tmp = (x / y) / (t - z);
} else if (y <= 1.3e-63) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.45d-12)) then
tmp = (x / y) / (t - z)
else if (y <= 1.3d-63) then
tmp = (x / z) / (z - t)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.45e-12) {
tmp = (x / y) / (t - z);
} else if (y <= 1.3e-63) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -3.45e-12: tmp = (x / y) / (t - z) elif y <= 1.3e-63: tmp = (x / z) / (z - t) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.45e-12) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 1.3e-63) tmp = Float64(Float64(x / z) / Float64(z - t)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -3.45e-12)
tmp = (x / y) / (t - z);
elseif (y <= 1.3e-63)
tmp = (x / z) / (z - t);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -3.45e-12], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-63], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.45 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-63}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -3.45e-12Initial program 87.3%
Taylor expanded in x around 0 87.3%
associate-/l/98.0%
Simplified98.0%
Taylor expanded in y around inf 88.6%
if -3.45e-12 < y < 1.3000000000000001e-63Initial program 91.5%
Taylor expanded in x around 0 91.5%
associate-/l/95.7%
Simplified95.7%
Taylor expanded in y around 0 80.6%
associate-*r/80.6%
mul-1-neg80.6%
Simplified80.6%
if 1.3000000000000001e-63 < y Initial program 86.6%
associate-/l/96.0%
Simplified96.0%
Taylor expanded in t around inf 55.6%
Final simplification75.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.65e-15) (not (<= z 3.9e-130))) (/ (/ x (- z)) y) (/ (/ x y) t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.65e-15) || !(z <= 3.9e-130)) {
tmp = (x / -z) / y;
} else {
tmp = (x / y) / t;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.65d-15)) .or. (.not. (z <= 3.9d-130))) then
tmp = (x / -z) / y
else
tmp = (x / y) / t
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.65e-15) || !(z <= 3.9e-130)) {
tmp = (x / -z) / y;
} else {
tmp = (x / y) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.65e-15) or not (z <= 3.9e-130): tmp = (x / -z) / y else: tmp = (x / y) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.65e-15) || !(z <= 3.9e-130)) tmp = Float64(Float64(x / Float64(-z)) / y); else tmp = Float64(Float64(x / y) / t); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.65e-15) || ~((z <= 3.9e-130)))
tmp = (x / -z) / y;
else
tmp = (x / y) / t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.65e-15], N[Not[LessEqual[z, 3.9e-130]], $MachinePrecision]], N[(N[(x / (-z)), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-15} \lor \neg \left(z \leq 3.9 \cdot 10^{-130}\right):\\
\;\;\;\;\frac{\frac{x}{-z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -1.65e-15 or 3.9000000000000001e-130 < z Initial program 85.0%
Taylor expanded in y around inf 45.8%
*-commutative45.8%
Simplified45.8%
associate-/r*54.5%
div-inv54.4%
Applied egg-rr54.4%
un-div-inv54.5%
Applied egg-rr54.5%
Taylor expanded in t around 0 46.7%
associate-*r/46.7%
neg-mul-146.7%
Simplified46.7%
if -1.65e-15 < z < 3.9000000000000001e-130Initial program 96.1%
Taylor expanded in z around 0 68.6%
clear-num68.4%
associate-/r/68.5%
*-commutative68.5%
associate-/r*69.8%
Applied egg-rr69.8%
*-commutative69.8%
associate-*r/71.2%
div-inv71.3%
Applied egg-rr71.3%
Final simplification55.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3.1e-159) (/ (/ x y) t) (if (<= y 5.7e+22) (/ (/ x (- z)) t) (/ (/ x t) y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-159) {
tmp = (x / y) / t;
} else if (y <= 5.7e+22) {
tmp = (x / -z) / t;
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.1d-159)) then
tmp = (x / y) / t
else if (y <= 5.7d+22) then
tmp = (x / -z) / t
else
tmp = (x / t) / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-159) {
tmp = (x / y) / t;
} else if (y <= 5.7e+22) {
tmp = (x / -z) / t;
} else {
tmp = (x / t) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -3.1e-159: tmp = (x / y) / t elif y <= 5.7e+22: tmp = (x / -z) / t else: tmp = (x / t) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e-159) tmp = Float64(Float64(x / y) / t); elseif (y <= 5.7e+22) tmp = Float64(Float64(x / Float64(-z)) / t); else tmp = Float64(Float64(x / t) / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -3.1e-159)
tmp = (x / y) / t;
elseif (y <= 5.7e+22)
tmp = (x / -z) / t;
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e-159], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 5.7e+22], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-159}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;y \leq 5.7 \cdot 10^{+22}:\\
\;\;\;\;\frac{\frac{x}{-z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if y < -3.1e-159Initial program 89.0%
Taylor expanded in z around 0 49.4%
clear-num49.2%
associate-/r/49.4%
*-commutative49.4%
associate-/r*50.6%
Applied egg-rr50.6%
*-commutative50.6%
associate-*r/59.3%
div-inv59.4%
Applied egg-rr59.4%
if -3.1e-159 < y < 5.69999999999999979e22Initial program 90.8%
Taylor expanded in y around 0 76.5%
associate-*r/76.5%
neg-mul-176.5%
Simplified76.5%
Taylor expanded in z around 0 48.1%
associate-*r/48.1%
mul-1-neg48.1%
Simplified48.1%
Taylor expanded in x around 0 48.1%
neg-mul-148.1%
*-commutative48.1%
associate-/r*47.2%
Simplified47.2%
if 5.69999999999999979e22 < y Initial program 86.2%
Taylor expanded in y around inf 82.6%
*-commutative82.6%
Simplified82.6%
associate-/r*83.2%
div-inv83.1%
Applied egg-rr83.1%
un-div-inv83.2%
Applied egg-rr83.2%
Taylor expanded in t around inf 50.0%
Final simplification52.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -9.5e-163) (/ (/ x y) t) (if (<= y 1.4e+22) (/ x (* z (- t))) (/ (/ x t) y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e-163) {
tmp = (x / y) / t;
} else if (y <= 1.4e+22) {
tmp = x / (z * -t);
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9.5d-163)) then
tmp = (x / y) / t
else if (y <= 1.4d+22) then
tmp = x / (z * -t)
else
tmp = (x / t) / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e-163) {
tmp = (x / y) / t;
} else if (y <= 1.4e+22) {
tmp = x / (z * -t);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -9.5e-163: tmp = (x / y) / t elif y <= 1.4e+22: tmp = x / (z * -t) else: tmp = (x / t) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -9.5e-163) tmp = Float64(Float64(x / y) / t); elseif (y <= 1.4e+22) tmp = Float64(x / Float64(z * Float64(-t))); else tmp = Float64(Float64(x / t) / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -9.5e-163)
tmp = (x / y) / t;
elseif (y <= 1.4e+22)
tmp = x / (z * -t);
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -9.5e-163], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 1.4e+22], N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-163}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if y < -9.50000000000000012e-163Initial program 89.0%
Taylor expanded in z around 0 49.4%
clear-num49.2%
associate-/r/49.4%
*-commutative49.4%
associate-/r*50.6%
Applied egg-rr50.6%
*-commutative50.6%
associate-*r/59.3%
div-inv59.4%
Applied egg-rr59.4%
if -9.50000000000000012e-163 < y < 1.4e22Initial program 90.8%
Taylor expanded in y around 0 76.5%
associate-*r/76.5%
neg-mul-176.5%
Simplified76.5%
Taylor expanded in z around 0 48.1%
associate-*r/48.1%
mul-1-neg48.1%
Simplified48.1%
if 1.4e22 < y Initial program 86.2%
Taylor expanded in y around inf 82.6%
*-commutative82.6%
Simplified82.6%
associate-/r*83.2%
div-inv83.1%
Applied egg-rr83.1%
un-div-inv83.2%
Applied egg-rr83.2%
Taylor expanded in t around inf 50.0%
Final simplification52.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -3.8e+94) (not (<= z 1.35e-67))) (/ x (* z t)) (/ x (* y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.8e+94) || !(z <= 1.35e-67)) {
tmp = x / (z * t);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.8d+94)) .or. (.not. (z <= 1.35d-67))) then
tmp = x / (z * t)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.8e+94) || !(z <= 1.35e-67)) {
tmp = x / (z * t);
} else {
tmp = x / (y * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -3.8e+94) or not (z <= 1.35e-67): tmp = x / (z * t) else: tmp = x / (y * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3.8e+94) || !(z <= 1.35e-67)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(x / Float64(y * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -3.8e+94) || ~((z <= 1.35e-67)))
tmp = x / (z * t);
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.8e+94], N[Not[LessEqual[z, 1.35e-67]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+94} \lor \neg \left(z \leq 1.35 \cdot 10^{-67}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -3.7999999999999996e94 or 1.35000000000000008e-67 < z Initial program 81.4%
Taylor expanded in y around 0 69.3%
associate-*r/69.3%
neg-mul-169.3%
Simplified69.3%
Taylor expanded in z around 0 32.7%
associate-*r/32.7%
mul-1-neg32.7%
Simplified32.7%
div-inv32.7%
add-sqr-sqrt14.4%
sqrt-unprod33.6%
sqr-neg33.6%
sqrt-unprod15.3%
add-sqr-sqrt29.9%
Applied egg-rr29.9%
associate-*r/29.9%
*-rgt-identity29.9%
Simplified29.9%
if -3.7999999999999996e94 < z < 1.35000000000000008e-67Initial program 96.4%
Taylor expanded in z around 0 60.2%
Final simplification45.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -3.8e+177) (not (<= z 1.45e+149))) (/ x (* z t)) (/ (/ x y) t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.8e+177) || !(z <= 1.45e+149)) {
tmp = x / (z * t);
} else {
tmp = (x / y) / t;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.8d+177)) .or. (.not. (z <= 1.45d+149))) then
tmp = x / (z * t)
else
tmp = (x / y) / t
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.8e+177) || !(z <= 1.45e+149)) {
tmp = x / (z * t);
} else {
tmp = (x / y) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -3.8e+177) or not (z <= 1.45e+149): tmp = x / (z * t) else: tmp = (x / y) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3.8e+177) || !(z <= 1.45e+149)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(Float64(x / y) / t); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -3.8e+177) || ~((z <= 1.45e+149)))
tmp = x / (z * t);
else
tmp = (x / y) / t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.8e+177], N[Not[LessEqual[z, 1.45e+149]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+177} \lor \neg \left(z \leq 1.45 \cdot 10^{+149}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -3.7999999999999998e177 or 1.4500000000000001e149 < z Initial program 73.1%
Taylor expanded in y around 0 73.1%
associate-*r/73.1%
neg-mul-173.1%
Simplified73.1%
Taylor expanded in z around 0 38.9%
associate-*r/38.9%
mul-1-neg38.9%
Simplified38.9%
div-inv38.9%
add-sqr-sqrt16.1%
sqrt-unprod40.7%
sqr-neg40.7%
sqrt-unprod22.8%
add-sqr-sqrt38.9%
Applied egg-rr38.9%
associate-*r/38.9%
*-rgt-identity38.9%
Simplified38.9%
if -3.7999999999999998e177 < z < 1.4500000000000001e149Initial program 93.7%
Taylor expanded in z around 0 44.6%
clear-num44.5%
associate-/r/44.5%
*-commutative44.5%
associate-/r*45.1%
Applied egg-rr45.1%
*-commutative45.1%
associate-*r/47.8%
div-inv47.8%
Applied egg-rr47.8%
Final simplification45.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -2.8e+129) (not (<= z 1.45e+149))) (/ (/ x z) t) (/ (/ x y) t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.8e+129) || !(z <= 1.45e+149)) {
tmp = (x / z) / t;
} else {
tmp = (x / y) / t;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.8d+129)) .or. (.not. (z <= 1.45d+149))) then
tmp = (x / z) / t
else
tmp = (x / y) / t
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.8e+129) || !(z <= 1.45e+149)) {
tmp = (x / z) / t;
} else {
tmp = (x / y) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -2.8e+129) or not (z <= 1.45e+149): tmp = (x / z) / t else: tmp = (x / y) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -2.8e+129) || !(z <= 1.45e+149)) tmp = Float64(Float64(x / z) / t); else tmp = Float64(Float64(x / y) / t); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -2.8e+129) || ~((z <= 1.45e+149)))
tmp = (x / z) / t;
else
tmp = (x / y) / t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.8e+129], N[Not[LessEqual[z, 1.45e+149]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+129} \lor \neg \left(z \leq 1.45 \cdot 10^{+149}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -2.79999999999999975e129 or 1.4500000000000001e149 < z Initial program 73.7%
Taylor expanded in y around 0 73.7%
associate-*r/73.7%
neg-mul-173.7%
Simplified73.7%
Taylor expanded in z around 0 36.9%
associate-*r/36.9%
mul-1-neg36.9%
Simplified36.9%
div-inv36.9%
add-sqr-sqrt16.5%
sqrt-unprod39.8%
sqr-neg39.8%
sqrt-unprod20.5%
add-sqr-sqrt37.0%
Applied egg-rr37.0%
associate-*r/37.0%
*-rgt-identity37.0%
*-commutative37.0%
associate-/r*43.3%
Simplified43.3%
if -2.79999999999999975e129 < z < 1.4500000000000001e149Initial program 94.8%
Taylor expanded in z around 0 45.7%
clear-num45.6%
associate-/r/45.7%
*-commutative45.7%
associate-/r*46.3%
Applied egg-rr46.3%
*-commutative46.3%
associate-*r/48.6%
div-inv48.7%
Applied egg-rr48.7%
Final simplification47.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 2.4e-72) (/ x (* y (- t z))) (/ x (* (- y z) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.4e-72) {
tmp = x / (y * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 2.4d-72) then
tmp = x / (y * (t - z))
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.4e-72) {
tmp = x / (y * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 2.4e-72: tmp = x / (y * (t - z)) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 2.4e-72) tmp = Float64(x / Float64(y * Float64(t - z))); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 2.4e-72)
tmp = x / (y * (t - z));
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 2.4e-72], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.4 \cdot 10^{-72}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < 2.4e-72Initial program 89.7%
Taylor expanded in y around inf 56.6%
*-commutative56.6%
Simplified56.6%
if 2.4e-72 < t Initial program 87.4%
Taylor expanded in t around inf 78.8%
Final simplification63.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 1.2e-29) (/ x (* y (- t z))) (/ (/ x t) (- y z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.2e-29) {
tmp = x / (y * (t - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.2d-29) then
tmp = x / (y * (t - z))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.2e-29) {
tmp = x / (y * (t - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 1.2e-29: tmp = x / (y * (t - z)) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 1.2e-29) tmp = Float64(x / Float64(y * Float64(t - z))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 1.2e-29)
tmp = x / (y * (t - z));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 1.2e-29], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.2 \cdot 10^{-29}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 1.19999999999999996e-29Initial program 89.7%
Taylor expanded in y around inf 56.9%
*-commutative56.9%
Simplified56.9%
if 1.19999999999999996e-29 < t Initial program 86.9%
associate-/l/95.5%
Simplified95.5%
Taylor expanded in t around inf 84.5%
Final simplification64.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ (/ x (- y z)) (- t z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / (y - z)) / (t - z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (x / (y - z)) / (t - z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(y - z)) / Float64(t - z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (y - z)) / (t - z);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{y - z}}{t - z}
\end{array}
Initial program 89.0%
Taylor expanded in x around 0 89.0%
associate-/l/96.3%
Simplified96.3%
Final simplification96.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* y t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x / (y * t);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / (y * t)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x / (y * t);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / (y * t)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / Float64(y * t)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (y * t);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{y \cdot t}
\end{array}
Initial program 89.0%
Taylor expanded in z around 0 38.5%
Final simplification38.5%
(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 2024059
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(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))))