
(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 18 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 (/ (/ x (- t z)) (- y z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - 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 / (t - z)) / (y - z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (x / (t - z)) / (y - z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(t - z)) / Float64(y - z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (t - z)) / (y - 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[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{t - z}}{y - z}
\end{array}
Initial program 87.9%
associate-/l/96.5%
Simplified96.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -2.75e+19)
(/ (/ x z) z)
(if (<= z 3.6e-67)
(/ x (* (- t z) y))
(if (<= z 1.14e+164) (/ x (* z (- z y))) (/ 1.0 (* z (/ z x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.75e+19) {
tmp = (x / z) / z;
} else if (z <= 3.6e-67) {
tmp = x / ((t - z) * y);
} else if (z <= 1.14e+164) {
tmp = x / (z * (z - y));
} else {
tmp = 1.0 / (z * (z / x));
}
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.75d+19)) then
tmp = (x / z) / z
else if (z <= 3.6d-67) then
tmp = x / ((t - z) * y)
else if (z <= 1.14d+164) then
tmp = x / (z * (z - y))
else
tmp = 1.0d0 / (z * (z / x))
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.75e+19) {
tmp = (x / z) / z;
} else if (z <= 3.6e-67) {
tmp = x / ((t - z) * y);
} else if (z <= 1.14e+164) {
tmp = x / (z * (z - y));
} else {
tmp = 1.0 / (z * (z / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -2.75e+19: tmp = (x / z) / z elif z <= 3.6e-67: tmp = x / ((t - z) * y) elif z <= 1.14e+164: tmp = x / (z * (z - y)) else: tmp = 1.0 / (z * (z / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2.75e+19) tmp = Float64(Float64(x / z) / z); elseif (z <= 3.6e-67) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (z <= 1.14e+164) tmp = Float64(x / Float64(z * Float64(z - y))); else tmp = Float64(1.0 / Float64(z * Float64(z / x))); 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.75e+19)
tmp = (x / z) / z;
elseif (z <= 3.6e-67)
tmp = x / ((t - z) * y);
elseif (z <= 1.14e+164)
tmp = x / (z * (z - y));
else
tmp = 1.0 / (z * (z / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -2.75e+19], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3.6e-67], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.14e+164], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-67}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;z \leq 1.14 \cdot 10^{+164}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -2.75e19Initial program 78.2%
Taylor expanded in t around 0 71.4%
mul-1-neg71.4%
associate-/r*88.3%
distribute-neg-frac288.3%
neg-sub088.3%
sub-neg88.3%
+-commutative88.3%
associate--r+88.3%
neg-sub088.3%
remove-double-neg88.3%
Simplified88.3%
Taylor expanded in z around inf 81.3%
if -2.75e19 < z < 3.59999999999999999e-67Initial program 96.1%
associate-/l/92.5%
Simplified92.5%
clear-num92.0%
associate-/r/92.4%
Applied egg-rr92.4%
Taylor expanded in y around inf 75.8%
if 3.59999999999999999e-67 < z < 1.14e164Initial program 91.0%
Taylor expanded in t around 0 68.0%
mul-1-neg68.0%
distribute-rgt-neg-in68.0%
neg-sub068.0%
sub-neg68.0%
+-commutative68.0%
associate--r+68.0%
neg-sub068.0%
remove-double-neg68.0%
Simplified68.0%
if 1.14e164 < z Initial program 73.5%
Taylor expanded in t around 0 73.5%
mul-1-neg73.5%
associate-/r*97.5%
distribute-neg-frac297.5%
neg-sub097.5%
sub-neg97.5%
+-commutative97.5%
associate--r+97.5%
neg-sub097.5%
remove-double-neg97.5%
Simplified97.5%
clear-num97.4%
inv-pow97.4%
div-inv97.5%
clear-num97.5%
Applied egg-rr97.5%
unpow-197.5%
Simplified97.5%
Taylor expanded in z around inf 90.8%
Final simplification77.9%
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 (/ (/ x z) z)))
(if (<= z -430000000.0)
t_1
(if (<= z 6.5e-166)
(/ (/ x t) y)
(if (<= z 2.5e-5) (/ x (* z (- y))) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -430000000.0) {
tmp = t_1;
} else if (z <= 6.5e-166) {
tmp = (x / t) / y;
} else if (z <= 2.5e-5) {
tmp = x / (z * -y);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / z
if (z <= (-430000000.0d0)) then
tmp = t_1
else if (z <= 6.5d-166) then
tmp = (x / t) / y
else if (z <= 2.5d-5) then
tmp = x / (z * -y)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -430000000.0) {
tmp = t_1;
} else if (z <= 6.5e-166) {
tmp = (x / t) / y;
} else if (z <= 2.5e-5) {
tmp = x / (z * -y);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -430000000.0: tmp = t_1 elif z <= 6.5e-166: tmp = (x / t) / y elif z <= 2.5e-5: tmp = x / (z * -y) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -430000000.0) tmp = t_1; elseif (z <= 6.5e-166) tmp = Float64(Float64(x / t) / y); elseif (z <= 2.5e-5) tmp = Float64(x / Float64(z * Float64(-y))); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (z <= -430000000.0)
tmp = t_1;
elseif (z <= 6.5e-166)
tmp = (x / t) / y;
elseif (z <= 2.5e-5)
tmp = x / (z * -y);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -430000000.0], t$95$1, If[LessEqual[z, 6.5e-166], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 2.5e-5], N[(x / N[(z * (-y)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -430000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-166}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.3e8 or 2.50000000000000012e-5 < z Initial program 79.8%
Taylor expanded in t around 0 70.5%
mul-1-neg70.5%
associate-/r*85.0%
distribute-neg-frac285.0%
neg-sub085.0%
sub-neg85.0%
+-commutative85.0%
associate--r+85.0%
neg-sub085.0%
remove-double-neg85.0%
Simplified85.0%
Taylor expanded in z around inf 76.0%
if -4.3e8 < z < 6.50000000000000019e-166Initial program 95.3%
associate-/l/92.9%
Simplified92.9%
Taylor expanded in t around inf 77.6%
Taylor expanded in y around inf 67.3%
if 6.50000000000000019e-166 < z < 2.50000000000000012e-5Initial program 99.7%
Taylor expanded in t around 0 51.6%
mul-1-neg51.6%
associate-/r*48.2%
distribute-neg-frac248.2%
neg-sub048.2%
sub-neg48.2%
+-commutative48.2%
associate--r+48.2%
neg-sub048.2%
remove-double-neg48.2%
Simplified48.2%
Taylor expanded in z around 0 42.0%
associate-*r/42.0%
neg-mul-142.0%
*-commutative42.0%
Simplified42.0%
Final simplification68.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 -3.5e+105) (not (<= z 1.6e+130))) (/ (/ x z) (- z y)) (/ x (* (- t z) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.5e+105) || !(z <= 1.6e+130)) {
tmp = (x / z) / (z - y);
} else {
tmp = x / ((t - z) * (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 ((z <= (-3.5d+105)) .or. (.not. (z <= 1.6d+130))) then
tmp = (x / z) / (z - y)
else
tmp = x / ((t - z) * (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 ((z <= -3.5e+105) || !(z <= 1.6e+130)) {
tmp = (x / z) / (z - y);
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -3.5e+105) or not (z <= 1.6e+130): tmp = (x / z) / (z - y) else: tmp = x / ((t - z) * (y - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3.5e+105) || !(z <= 1.6e+130)) tmp = Float64(Float64(x / z) / Float64(z - y)); else tmp = Float64(x / Float64(Float64(t - z) * 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 ((z <= -3.5e+105) || ~((z <= 1.6e+130)))
tmp = (x / z) / (z - y);
else
tmp = x / ((t - z) * (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[Or[LessEqual[z, -3.5e+105], N[Not[LessEqual[z, 1.6e+130]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+105} \lor \neg \left(z \leq 1.6 \cdot 10^{+130}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if z < -3.49999999999999991e105 or 1.6e130 < z Initial program 71.2%
Taylor expanded in t around 0 70.0%
mul-1-neg70.0%
associate-/r*91.7%
distribute-neg-frac291.7%
neg-sub091.7%
sub-neg91.7%
+-commutative91.7%
associate--r+91.7%
neg-sub091.7%
remove-double-neg91.7%
Simplified91.7%
if -3.49999999999999991e105 < z < 1.6e130Initial program 96.5%
Final simplification94.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -3.7e+105) (/ (* x (/ 1.0 z)) (- z y)) (if (<= z 2.4e+129) (/ x (* (- t z) (- y z))) (/ (/ x z) (- z y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+105) {
tmp = (x * (1.0 / z)) / (z - y);
} else if (z <= 2.4e+129) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-3.7d+105)) then
tmp = (x * (1.0d0 / z)) / (z - y)
else if (z <= 2.4d+129) then
tmp = x / ((t - z) * (y - z))
else
tmp = (x / z) / (z - y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+105) {
tmp = (x * (1.0 / z)) / (z - y);
} else if (z <= 2.4e+129) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -3.7e+105: tmp = (x * (1.0 / z)) / (z - y) elif z <= 2.4e+129: tmp = x / ((t - z) * (y - z)) else: tmp = (x / z) / (z - y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -3.7e+105) tmp = Float64(Float64(x * Float64(1.0 / z)) / Float64(z - y)); elseif (z <= 2.4e+129) tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); else tmp = Float64(Float64(x / z) / Float64(z - y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -3.7e+105)
tmp = (x * (1.0 / z)) / (z - y);
elseif (z <= 2.4e+129)
tmp = x / ((t - z) * (y - z));
else
tmp = (x / z) / (z - y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -3.7e+105], N[(N[(x * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+129], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+105}:\\
\;\;\;\;\frac{x \cdot \frac{1}{z}}{z - y}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+129}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\end{array}
\end{array}
if z < -3.69999999999999985e105Initial program 72.3%
Taylor expanded in t around 0 70.0%
mul-1-neg70.0%
associate-/r*91.6%
distribute-neg-frac291.6%
neg-sub091.6%
sub-neg91.6%
+-commutative91.6%
associate--r+91.6%
neg-sub091.6%
remove-double-neg91.6%
Simplified91.6%
clear-num91.6%
associate-/r/91.6%
Applied egg-rr91.6%
if -3.69999999999999985e105 < z < 2.3999999999999999e129Initial program 96.5%
if 2.3999999999999999e129 < z Initial program 70.1%
Taylor expanded in t around 0 70.0%
mul-1-neg70.0%
associate-/r*91.9%
distribute-neg-frac291.9%
neg-sub091.9%
sub-neg91.9%
+-commutative91.9%
associate--r+91.9%
neg-sub091.9%
remove-double-neg91.9%
Simplified91.9%
Final simplification94.9%
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 -5e-45) (/ (/ x (- t z)) y) (if (<= t 480.0) (/ 1.0 (* (- z y) (/ z x))) (/ (/ 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 <= -5e-45) {
tmp = (x / (t - z)) / y;
} else if (t <= 480.0) {
tmp = 1.0 / ((z - y) * (z / x));
} 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 <= (-5d-45)) then
tmp = (x / (t - z)) / y
else if (t <= 480.0d0) then
tmp = 1.0d0 / ((z - y) * (z / x))
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 <= -5e-45) {
tmp = (x / (t - z)) / y;
} else if (t <= 480.0) {
tmp = 1.0 / ((z - y) * (z / x));
} 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 <= -5e-45: tmp = (x / (t - z)) / y elif t <= 480.0: tmp = 1.0 / ((z - y) * (z / x)) 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 <= -5e-45) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t <= 480.0) tmp = Float64(1.0 / Float64(Float64(z - y) * Float64(z / x))); 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 <= -5e-45)
tmp = (x / (t - z)) / y;
elseif (t <= 480.0)
tmp = 1.0 / ((z - y) * (z / x));
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, -5e-45], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 480.0], N[(1.0 / N[(N[(z - y), $MachinePrecision] * N[(z / x), $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 -5 \cdot 10^{-45}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t \leq 480:\\
\;\;\;\;\frac{1}{\left(z - y\right) \cdot \frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -4.99999999999999976e-45Initial program 84.5%
associate-/l/98.6%
Simplified98.6%
Taylor expanded in y around inf 65.8%
if -4.99999999999999976e-45 < t < 480Initial program 91.3%
Taylor expanded in t around 0 73.2%
mul-1-neg73.2%
associate-/r*78.8%
distribute-neg-frac278.8%
neg-sub078.8%
sub-neg78.8%
+-commutative78.8%
associate--r+78.8%
neg-sub078.8%
remove-double-neg78.8%
Simplified78.8%
clear-num78.6%
inv-pow78.6%
div-inv78.6%
clear-num79.6%
Applied egg-rr79.6%
unpow-179.6%
Simplified79.6%
if 480 < t Initial program 84.9%
associate-/l/96.5%
Simplified96.5%
Taylor expanded in t around inf 86.9%
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 (<= t -8.2e-47) (not (<= t 1.4e-82))) (/ (/ x t) (- y z)) (/ x (* z (- z y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.2e-47) || !(t <= 1.4e-82)) {
tmp = (x / t) / (y - z);
} else {
tmp = x / (z * (z - y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-8.2d-47)) .or. (.not. (t <= 1.4d-82))) then
tmp = (x / t) / (y - z)
else
tmp = x / (z * (z - y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.2e-47) || !(t <= 1.4e-82)) {
tmp = (x / t) / (y - z);
} else {
tmp = x / (z * (z - y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (t <= -8.2e-47) or not (t <= 1.4e-82): tmp = (x / t) / (y - z) else: tmp = x / (z * (z - y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((t <= -8.2e-47) || !(t <= 1.4e-82)) tmp = Float64(Float64(x / t) / Float64(y - z)); else tmp = Float64(x / Float64(z * Float64(z - y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((t <= -8.2e-47) || ~((t <= 1.4e-82)))
tmp = (x / t) / (y - z);
else
tmp = x / (z * (z - y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8.2e-47], N[Not[LessEqual[t, 1.4e-82]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{-47} \lor \neg \left(t \leq 1.4 \cdot 10^{-82}\right):\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if t < -8.20000000000000003e-47 or 1.40000000000000012e-82 < t Initial program 83.5%
associate-/l/97.9%
Simplified97.9%
Taylor expanded in t around inf 81.7%
if -8.20000000000000003e-47 < t < 1.40000000000000012e-82Initial program 93.7%
Taylor expanded in t around 0 76.7%
mul-1-neg76.7%
distribute-rgt-neg-in76.7%
neg-sub076.7%
sub-neg76.7%
+-commutative76.7%
associate--r+76.7%
neg-sub076.7%
remove-double-neg76.7%
Simplified76.7%
Final simplification79.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 -5.4e-45) (/ (/ x (- t z)) y) (if (<= t 445.0) (/ (/ x z) (- z y)) (/ (/ 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 <= -5.4e-45) {
tmp = (x / (t - z)) / y;
} else if (t <= 445.0) {
tmp = (x / z) / (z - y);
} 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 <= (-5.4d-45)) then
tmp = (x / (t - z)) / y
else if (t <= 445.0d0) then
tmp = (x / z) / (z - y)
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 <= -5.4e-45) {
tmp = (x / (t - z)) / y;
} else if (t <= 445.0) {
tmp = (x / z) / (z - y);
} 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 <= -5.4e-45: tmp = (x / (t - z)) / y elif t <= 445.0: tmp = (x / z) / (z - y) 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 <= -5.4e-45) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t <= 445.0) tmp = Float64(Float64(x / z) / Float64(z - y)); 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 <= -5.4e-45)
tmp = (x / (t - z)) / y;
elseif (t <= 445.0)
tmp = (x / z) / (z - y);
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, -5.4e-45], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 445.0], N[(N[(x / z), $MachinePrecision] / N[(z - y), $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 -5.4 \cdot 10^{-45}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t \leq 445:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -5.3999999999999997e-45Initial program 84.5%
associate-/l/98.6%
Simplified98.6%
Taylor expanded in y around inf 65.8%
if -5.3999999999999997e-45 < t < 445Initial program 91.3%
Taylor expanded in t around 0 73.2%
mul-1-neg73.2%
associate-/r*78.8%
distribute-neg-frac278.8%
neg-sub078.8%
sub-neg78.8%
+-commutative78.8%
associate--r+78.8%
neg-sub078.8%
remove-double-neg78.8%
Simplified78.8%
if 445 < t Initial program 84.9%
associate-/l/96.5%
Simplified96.5%
Taylor expanded in t around inf 86.9%
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.05e-44) (/ (/ x y) (- t z)) (if (<= t 250.0) (/ (/ x z) (- z y)) (/ (/ 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 <= -2.05e-44) {
tmp = (x / y) / (t - z);
} else if (t <= 250.0) {
tmp = (x / z) / (z - y);
} 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 <= (-2.05d-44)) then
tmp = (x / y) / (t - z)
else if (t <= 250.0d0) then
tmp = (x / z) / (z - y)
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 <= -2.05e-44) {
tmp = (x / y) / (t - z);
} else if (t <= 250.0) {
tmp = (x / z) / (z - y);
} 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 <= -2.05e-44: tmp = (x / y) / (t - z) elif t <= 250.0: tmp = (x / z) / (z - y) 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 <= -2.05e-44) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 250.0) tmp = Float64(Float64(x / z) / Float64(z - y)); 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 <= -2.05e-44)
tmp = (x / y) / (t - z);
elseif (t <= 250.0)
tmp = (x / z) / (z - y);
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, -2.05e-44], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 250.0], N[(N[(x / z), $MachinePrecision] / N[(z - y), $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 -2.05 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 250:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -2.04999999999999996e-44Initial program 84.5%
Taylor expanded in y around inf 55.5%
associate-/r*59.4%
Simplified59.4%
if -2.04999999999999996e-44 < t < 250Initial program 91.3%
Taylor expanded in t around 0 73.2%
mul-1-neg73.2%
associate-/r*78.8%
distribute-neg-frac278.8%
neg-sub078.8%
sub-neg78.8%
+-commutative78.8%
associate--r+78.8%
neg-sub078.8%
remove-double-neg78.8%
Simplified78.8%
if 250 < t Initial program 84.9%
associate-/l/96.5%
Simplified96.5%
Taylor expanded in t around inf 86.9%
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 -3.6e-71) (/ (/ x y) (- t z)) (if (<= t 4e-82) (/ x (* z (- z y))) (/ (/ 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 <= -3.6e-71) {
tmp = (x / y) / (t - z);
} else if (t <= 4e-82) {
tmp = x / (z * (z - y));
} 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 <= (-3.6d-71)) then
tmp = (x / y) / (t - z)
else if (t <= 4d-82) then
tmp = x / (z * (z - y))
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 <= -3.6e-71) {
tmp = (x / y) / (t - z);
} else if (t <= 4e-82) {
tmp = x / (z * (z - y));
} 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 <= -3.6e-71: tmp = (x / y) / (t - z) elif t <= 4e-82: tmp = x / (z * (z - y)) 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 <= -3.6e-71) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 4e-82) tmp = Float64(x / Float64(z * Float64(z - y))); 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 <= -3.6e-71)
tmp = (x / y) / (t - z);
elseif (t <= 4e-82)
tmp = x / (z * (z - y));
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, -3.6e-71], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e-82], N[(x / N[(z * N[(z - y), $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 -3.6 \cdot 10^{-71}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -3.6e-71Initial program 84.0%
Taylor expanded in y around inf 55.3%
associate-/r*59.0%
Simplified59.0%
if -3.6e-71 < t < 4e-82Initial program 93.5%
Taylor expanded in t around 0 76.9%
mul-1-neg76.9%
distribute-rgt-neg-in76.9%
neg-sub076.9%
sub-neg76.9%
+-commutative76.9%
associate--r+76.9%
neg-sub076.9%
remove-double-neg76.9%
Simplified76.9%
if 4e-82 < t Initial program 83.7%
associate-/l/97.2%
Simplified97.2%
Taylor expanded in t around inf 81.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 -2e-57) (/ x (* (- t z) y)) (if (<= t 4.4e-82) (/ x (* z (- z y))) (/ 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 <= -2e-57) {
tmp = x / ((t - z) * y);
} else if (t <= 4.4e-82) {
tmp = x / (z * (z - y));
} 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 <= (-2d-57)) then
tmp = x / ((t - z) * y)
else if (t <= 4.4d-82) then
tmp = x / (z * (z - y))
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 <= -2e-57) {
tmp = x / ((t - z) * y);
} else if (t <= 4.4e-82) {
tmp = x / (z * (z - y));
} 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 <= -2e-57: tmp = x / ((t - z) * y) elif t <= 4.4e-82: tmp = x / (z * (z - y)) 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 <= -2e-57) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (t <= 4.4e-82) tmp = Float64(x / Float64(z * Float64(z - y))); else tmp = Float64(x / Float64(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 <= -2e-57)
tmp = x / ((t - z) * y);
elseif (t <= 4.4e-82)
tmp = x / (z * (z - y));
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, -2e-57], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e-82], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-57}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if t < -1.99999999999999991e-57Initial program 83.8%
associate-/l/98.6%
Simplified98.6%
clear-num98.5%
associate-/r/98.5%
Applied egg-rr98.5%
Taylor expanded in y around inf 54.7%
if -1.99999999999999991e-57 < t < 4.39999999999999971e-82Initial program 93.5%
Taylor expanded in t around 0 76.2%
mul-1-neg76.2%
distribute-rgt-neg-in76.2%
neg-sub076.2%
sub-neg76.2%
+-commutative76.2%
associate--r+76.2%
neg-sub076.2%
remove-double-neg76.2%
Simplified76.2%
if 4.39999999999999971e-82 < t Initial program 83.7%
Taylor expanded in t around inf 79.6%
Final simplification70.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 (<= z -3e+18) (/ (/ x z) z) (if (<= z 2.5e+87) (/ x (* (- t z) y)) (/ 1.0 (* z (/ z x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3e+18) {
tmp = (x / z) / z;
} else if (z <= 2.5e+87) {
tmp = x / ((t - z) * y);
} else {
tmp = 1.0 / (z * (z / x));
}
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 <= (-3d+18)) then
tmp = (x / z) / z
else if (z <= 2.5d+87) then
tmp = x / ((t - z) * y)
else
tmp = 1.0d0 / (z * (z / x))
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 <= -3e+18) {
tmp = (x / z) / z;
} else if (z <= 2.5e+87) {
tmp = x / ((t - z) * y);
} else {
tmp = 1.0 / (z * (z / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -3e+18: tmp = (x / z) / z elif z <= 2.5e+87: tmp = x / ((t - z) * y) else: tmp = 1.0 / (z * (z / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -3e+18) tmp = Float64(Float64(x / z) / z); elseif (z <= 2.5e+87) tmp = Float64(x / Float64(Float64(t - z) * y)); else tmp = Float64(1.0 / Float64(z * Float64(z / x))); 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 <= -3e+18)
tmp = (x / z) / z;
elseif (z <= 2.5e+87)
tmp = x / ((t - z) * y);
else
tmp = 1.0 / (z * (z / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -3e+18], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.5e+87], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+18}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+87}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -3e18Initial program 78.2%
Taylor expanded in t around 0 71.4%
mul-1-neg71.4%
associate-/r*88.3%
distribute-neg-frac288.3%
neg-sub088.3%
sub-neg88.3%
+-commutative88.3%
associate--r+88.3%
neg-sub088.3%
remove-double-neg88.3%
Simplified88.3%
Taylor expanded in z around inf 81.3%
if -3e18 < z < 2.4999999999999999e87Initial program 96.0%
associate-/l/93.9%
Simplified93.9%
clear-num93.4%
associate-/r/93.8%
Applied egg-rr93.8%
Taylor expanded in y around inf 72.9%
if 2.4999999999999999e87 < z Initial program 76.6%
Taylor expanded in t around 0 73.2%
mul-1-neg73.2%
associate-/r*90.2%
distribute-neg-frac290.2%
neg-sub090.2%
sub-neg90.2%
+-commutative90.2%
associate--r+90.2%
neg-sub090.2%
remove-double-neg90.2%
Simplified90.2%
clear-num90.2%
inv-pow90.2%
div-inv90.2%
clear-num90.2%
Applied egg-rr90.2%
unpow-190.2%
Simplified90.2%
Taylor expanded in z around inf 85.0%
Final simplification77.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -2.15e+15) (not (<= z 0.0044))) (/ (/ x z) z) (/ (/ x t) y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.15e+15) || !(z <= 0.0044)) {
tmp = (x / z) / z;
} 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 ((z <= (-2.15d+15)) .or. (.not. (z <= 0.0044d0))) then
tmp = (x / z) / z
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 ((z <= -2.15e+15) || !(z <= 0.0044)) {
tmp = (x / z) / z;
} 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 (z <= -2.15e+15) or not (z <= 0.0044): tmp = (x / z) / z 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 ((z <= -2.15e+15) || !(z <= 0.0044)) tmp = Float64(Float64(x / z) / z); 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 ((z <= -2.15e+15) || ~((z <= 0.0044)))
tmp = (x / z) / z;
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[Or[LessEqual[z, -2.15e+15], N[Not[LessEqual[z, 0.0044]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $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}\;z \leq -2.15 \cdot 10^{+15} \lor \neg \left(z \leq 0.0044\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -2.15e15 or 0.00440000000000000027 < z Initial program 79.8%
Taylor expanded in t around 0 70.5%
mul-1-neg70.5%
associate-/r*85.0%
distribute-neg-frac285.0%
neg-sub085.0%
sub-neg85.0%
+-commutative85.0%
associate--r+85.0%
neg-sub085.0%
remove-double-neg85.0%
Simplified85.0%
Taylor expanded in z around inf 76.0%
if -2.15e15 < z < 0.00440000000000000027Initial program 96.3%
associate-/l/93.0%
Simplified93.0%
Taylor expanded in t around inf 71.5%
Taylor expanded in y around inf 58.5%
Final simplification67.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -6.5e+15) (not (<= z 0.009))) (/ x (* z z)) (/ (/ x t) y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.5e+15) || !(z <= 0.009)) {
tmp = x / (z * z);
} 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 ((z <= (-6.5d+15)) .or. (.not. (z <= 0.009d0))) then
tmp = x / (z * z)
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 ((z <= -6.5e+15) || !(z <= 0.009)) {
tmp = x / (z * z);
} 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 (z <= -6.5e+15) or not (z <= 0.009): tmp = x / (z * z) 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 ((z <= -6.5e+15) || !(z <= 0.009)) tmp = Float64(x / Float64(z * z)); 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 ((z <= -6.5e+15) || ~((z <= 0.009)))
tmp = x / (z * z);
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[Or[LessEqual[z, -6.5e+15], N[Not[LessEqual[z, 0.009]], $MachinePrecision]], N[(x / N[(z * z), $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}\;z \leq -6.5 \cdot 10^{+15} \lor \neg \left(z \leq 0.009\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -6.5e15 or 0.00899999999999999932 < z Initial program 79.8%
clear-num79.6%
associate-/r/79.7%
Applied egg-rr79.7%
Taylor expanded in t around 0 70.5%
associate-/r*70.5%
Simplified70.5%
*-commutative70.5%
frac-2neg70.5%
associate-*r/85.0%
distribute-neg-frac285.0%
add-sqr-sqrt37.9%
sqrt-unprod63.6%
sqr-neg63.6%
sqrt-unprod32.0%
add-sqr-sqrt55.1%
*-commutative55.1%
frac-2neg55.1%
metadata-eval55.1%
associate-*l/55.1%
*-un-lft-identity55.1%
add-sqr-sqrt23.1%
sqrt-unprod63.0%
sqr-neg63.0%
sqrt-unprod46.9%
add-sqr-sqrt85.0%
sub-neg85.0%
distribute-neg-in85.0%
remove-double-neg85.0%
Applied egg-rr85.0%
associate-/l/70.5%
+-commutative70.5%
unsub-neg70.5%
Simplified70.5%
Taylor expanded in z around inf 65.9%
if -6.5e15 < z < 0.00899999999999999932Initial program 96.3%
associate-/l/93.0%
Simplified93.0%
Taylor expanded in t around inf 71.5%
Taylor expanded in y around inf 58.5%
Final simplification62.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 -48000000.0) (not (<= z 6.7e-15))) (/ x (* z z)) (/ x (* t y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -48000000.0) || !(z <= 6.7e-15)) {
tmp = x / (z * z);
} 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 ((z <= (-48000000.0d0)) .or. (.not. (z <= 6.7d-15))) then
tmp = x / (z * z)
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 ((z <= -48000000.0) || !(z <= 6.7e-15)) {
tmp = x / (z * z);
} 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 (z <= -48000000.0) or not (z <= 6.7e-15): tmp = x / (z * z) 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 ((z <= -48000000.0) || !(z <= 6.7e-15)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(t * y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -48000000.0) || ~((z <= 6.7e-15)))
tmp = x / (z * z);
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[Or[LessEqual[z, -48000000.0], N[Not[LessEqual[z, 6.7e-15]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -48000000 \lor \neg \left(z \leq 6.7 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -4.8e7 or 6.70000000000000001e-15 < z Initial program 79.8%
clear-num79.6%
associate-/r/79.7%
Applied egg-rr79.7%
Taylor expanded in t around 0 70.5%
associate-/r*70.5%
Simplified70.5%
*-commutative70.5%
frac-2neg70.5%
associate-*r/85.0%
distribute-neg-frac285.0%
add-sqr-sqrt37.9%
sqrt-unprod63.6%
sqr-neg63.6%
sqrt-unprod32.0%
add-sqr-sqrt55.1%
*-commutative55.1%
frac-2neg55.1%
metadata-eval55.1%
associate-*l/55.1%
*-un-lft-identity55.1%
add-sqr-sqrt23.1%
sqrt-unprod63.0%
sqr-neg63.0%
sqrt-unprod46.9%
add-sqr-sqrt85.0%
sub-neg85.0%
distribute-neg-in85.0%
remove-double-neg85.0%
Applied egg-rr85.0%
associate-/l/70.5%
+-commutative70.5%
unsub-neg70.5%
Simplified70.5%
Taylor expanded in z around inf 65.9%
if -4.8e7 < z < 6.70000000000000001e-15Initial program 96.3%
Taylor expanded in z around 0 56.7%
Final simplification61.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 -7e+31) (not (<= z 1.7e+85))) (/ x (* t z)) (/ x (* t y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7e+31) || !(z <= 1.7e+85)) {
tmp = x / (t * z);
} 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 ((z <= (-7d+31)) .or. (.not. (z <= 1.7d+85))) then
tmp = x / (t * z)
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 ((z <= -7e+31) || !(z <= 1.7e+85)) {
tmp = x / (t * z);
} 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 (z <= -7e+31) or not (z <= 1.7e+85): tmp = x / (t * z) 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 ((z <= -7e+31) || !(z <= 1.7e+85)) tmp = Float64(x / Float64(t * z)); else tmp = Float64(x / Float64(t * y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -7e+31) || ~((z <= 1.7e+85)))
tmp = x / (t * z);
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[Or[LessEqual[z, -7e+31], N[Not[LessEqual[z, 1.7e+85]], $MachinePrecision]], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+31} \lor \neg \left(z \leq 1.7 \cdot 10^{+85}\right):\\
\;\;\;\;\frac{x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -7e31 or 1.7000000000000002e85 < z Initial program 77.0%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 39.3%
Taylor expanded in y around 0 38.0%
neg-mul-138.0%
Simplified38.0%
add-sqr-sqrt17.8%
sqrt-unprod56.8%
sqr-neg56.8%
sqrt-unprod18.0%
add-sqr-sqrt31.3%
*-un-lft-identity31.3%
associate-/l/32.4%
*-commutative32.4%
Applied egg-rr32.4%
*-lft-identity32.4%
*-commutative32.4%
Simplified32.4%
if -7e31 < z < 1.7000000000000002e85Initial program 96.0%
Taylor expanded in z around 0 51.6%
Final simplification43.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 (<= z -1.65e+31) (/ x (* t z)) (if (<= z 5.7e+87) (/ x (* t y)) (/ x (* z y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.65e+31) {
tmp = x / (t * z);
} else if (z <= 5.7e+87) {
tmp = x / (t * y);
} else {
tmp = x / (z * y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.65d+31)) then
tmp = x / (t * z)
else if (z <= 5.7d+87) then
tmp = x / (t * y)
else
tmp = x / (z * y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.65e+31) {
tmp = x / (t * z);
} else if (z <= 5.7e+87) {
tmp = x / (t * y);
} else {
tmp = x / (z * y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.65e+31: tmp = x / (t * z) elif z <= 5.7e+87: tmp = x / (t * y) else: tmp = x / (z * y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.65e+31) tmp = Float64(x / Float64(t * z)); elseif (z <= 5.7e+87) tmp = Float64(x / Float64(t * y)); else tmp = Float64(x / Float64(z * y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.65e+31)
tmp = x / (t * z);
elseif (z <= 5.7e+87)
tmp = x / (t * y);
else
tmp = x / (z * y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.65e+31], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.7e+87], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], N[(x / N[(z * y), $MachinePrecision]), $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^{+31}:\\
\;\;\;\;\frac{x}{t \cdot z}\\
\mathbf{elif}\;z \leq 5.7 \cdot 10^{+87}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot y}\\
\end{array}
\end{array}
if z < -1.64999999999999996e31Initial program 76.5%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 37.3%
Taylor expanded in y around 0 37.2%
neg-mul-137.2%
Simplified37.2%
add-sqr-sqrt37.2%
sqrt-unprod53.6%
sqr-neg53.6%
sqrt-unprod0.0%
add-sqr-sqrt27.9%
*-un-lft-identity27.9%
associate-/l/29.9%
*-commutative29.9%
Applied egg-rr29.9%
*-lft-identity29.9%
*-commutative29.9%
Simplified29.9%
if -1.64999999999999996e31 < z < 5.70000000000000039e87Initial program 96.1%
Taylor expanded in z around 0 51.1%
if 5.70000000000000039e87 < z Initial program 76.6%
Taylor expanded in t around 0 73.2%
mul-1-neg73.2%
associate-/r*90.2%
distribute-neg-frac290.2%
neg-sub090.2%
sub-neg90.2%
+-commutative90.2%
associate--r+90.2%
neg-sub090.2%
remove-double-neg90.2%
Simplified90.2%
Taylor expanded in z around 0 29.2%
associate-*r/29.2%
neg-mul-129.2%
*-commutative29.2%
Simplified29.2%
neg-sub029.2%
sub-neg29.2%
add-sqr-sqrt17.8%
sqrt-unprod38.2%
sqr-neg38.2%
sqrt-unprod11.4%
add-sqr-sqrt29.2%
Applied egg-rr29.2%
+-lft-identity29.2%
Simplified29.2%
Final simplification42.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* t y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x / (t * y);
}
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 / (t * y)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x / (t * y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / (t * y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / Float64(t * y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (t * y);
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[(t * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{t \cdot y}
\end{array}
Initial program 87.9%
Taylor expanded in z around 0 36.7%
(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 2024185
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))
(/ x (* (- y z) (- t z))))