
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
NOTE: 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)) (/ 1.0 (- t z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (x / (y - z)) * (1.0 / (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)) * (1.0d0 / (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)) * (1.0 / (t - z));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (x / (y - z)) * (1.0 / (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(1.0 / 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)) * (1.0 / (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[(1.0 / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{y - z} \cdot \frac{1}{t - z}
\end{array}
Initial program 88.8%
associate-/r*98.7%
div-inv98.7%
Applied egg-rr98.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 -1.65e+140)
(/ (/ x z) z)
(if (or (<= z -1.4e-108) (not (<= z 3.6e-87)))
(/ x (* z (- 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 (z <= -1.65e+140) {
tmp = (x / z) / z;
} else if ((z <= -1.4e-108) || !(z <= 3.6e-87)) {
tmp = x / (z * (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 (z <= (-1.65d+140)) then
tmp = (x / z) / z
else if ((z <= (-1.4d-108)) .or. (.not. (z <= 3.6d-87))) then
tmp = x / (z * (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 (z <= -1.65e+140) {
tmp = (x / z) / z;
} else if ((z <= -1.4e-108) || !(z <= 3.6e-87)) {
tmp = x / (z * (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 z <= -1.65e+140: tmp = (x / z) / z elif (z <= -1.4e-108) or not (z <= 3.6e-87): tmp = x / (z * (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 (z <= -1.65e+140) tmp = Float64(Float64(x / z) / z); elseif ((z <= -1.4e-108) || !(z <= 3.6e-87)) tmp = Float64(x / Float64(z * 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 (z <= -1.65e+140)
tmp = (x / z) / z;
elseif ((z <= -1.4e-108) || ~((z <= 3.6e-87)))
tmp = x / (z * (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[z, -1.65e+140], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[z, -1.4e-108], N[Not[LessEqual[z, 3.6e-87]], $MachinePrecision]], N[(x / N[(z * N[(z - t), $MachinePrecision]), $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 -1.65 \cdot 10^{+140}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-108} \lor \neg \left(z \leq 3.6 \cdot 10^{-87}\right):\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.6500000000000001e140Initial program 72.8%
Taylor expanded in y around 0 72.8%
mul-1-neg72.8%
associate-/r*94.4%
distribute-neg-frac294.4%
sub-neg94.4%
+-commutative94.4%
distribute-neg-in94.4%
remove-double-neg94.4%
unsub-neg94.4%
Simplified94.4%
Taylor expanded in z around inf 94.4%
if -1.6500000000000001e140 < z < -1.4e-108 or 3.59999999999999993e-87 < z Initial program 90.8%
Taylor expanded in y around 0 66.7%
mul-1-neg66.7%
distribute-rgt-neg-in66.7%
sub-neg66.7%
+-commutative66.7%
distribute-neg-in66.7%
remove-double-neg66.7%
unsub-neg66.7%
Simplified66.7%
if -1.4e-108 < z < 3.59999999999999993e-87Initial program 92.7%
associate-/l/94.3%
Simplified94.3%
Taylor expanded in t around inf 83.9%
Taylor expanded in y around inf 70.8%
Final simplification72.3%
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 (* (- y z) (- t z))))) (if (<= t_1 -2e-299) t_1 (/ (/ x (- t z)) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (t - z));
double tmp;
if (t_1 <= -2e-299) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x / ((y - z) * (t - z))
if (t_1 <= (-2d-299)) then
tmp = t_1
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 t_1 = x / ((y - z) * (t - z));
double tmp;
if (t_1 <= -2e-299) {
tmp = t_1;
} else {
tmp = (x / (t - z)) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / ((y - z) * (t - z)) tmp = 0 if t_1 <= -2e-299: tmp = t_1 else: tmp = (x / (t - z)) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= -2e-299) tmp = t_1; else tmp = Float64(Float64(x / 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)
t_1 = x / ((y - z) * (t - z));
tmp = 0.0;
if (t_1 <= -2e-299)
tmp = t_1;
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_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-299], t$95$1, 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])\\
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-299}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -1.99999999999999998e-299Initial program 96.1%
if -1.99999999999999998e-299 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 86.9%
associate-/l/98.0%
Simplified98.0%
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 -5.2e+19)
t_1
(if (<= z -1.3e-98)
(/ x (* y (- z)))
(if (<= z 3.5e+52) (/ (/ x t) 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 <= -5.2e+19) {
tmp = t_1;
} else if (z <= -1.3e-98) {
tmp = x / (y * -z);
} else if (z <= 3.5e+52) {
tmp = (x / t) / 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 <= (-5.2d+19)) then
tmp = t_1
else if (z <= (-1.3d-98)) then
tmp = x / (y * -z)
else if (z <= 3.5d+52) then
tmp = (x / t) / 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 <= -5.2e+19) {
tmp = t_1;
} else if (z <= -1.3e-98) {
tmp = x / (y * -z);
} else if (z <= 3.5e+52) {
tmp = (x / t) / 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 <= -5.2e+19: tmp = t_1 elif z <= -1.3e-98: tmp = x / (y * -z) elif z <= 3.5e+52: tmp = (x / t) / 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 <= -5.2e+19) tmp = t_1; elseif (z <= -1.3e-98) tmp = Float64(x / Float64(y * Float64(-z))); elseif (z <= 3.5e+52) tmp = Float64(Float64(x / t) / 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 <= -5.2e+19)
tmp = t_1;
elseif (z <= -1.3e-98)
tmp = x / (y * -z);
elseif (z <= 3.5e+52)
tmp = (x / t) / 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, -5.2e+19], t$95$1, If[LessEqual[z, -1.3e-98], N[(x / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+52], N[(N[(x / t), $MachinePrecision] / y), $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 -5.2 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-98}:\\
\;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+52}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.2e19 or 3.5e52 < z Initial program 81.5%
Taylor expanded in y around 0 77.1%
mul-1-neg77.1%
associate-/r*88.6%
distribute-neg-frac288.6%
sub-neg88.6%
+-commutative88.6%
distribute-neg-in88.6%
remove-double-neg88.6%
unsub-neg88.6%
Simplified88.6%
Taylor expanded in z around inf 81.5%
if -5.2e19 < z < -1.30000000000000007e-98Initial program 99.9%
Taylor expanded in y around inf 67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in t around 0 48.7%
associate-*r/48.7%
neg-mul-148.7%
*-commutative48.7%
Simplified48.7%
if -1.30000000000000007e-98 < z < 3.5e52Initial program 93.5%
associate-/l/94.8%
Simplified94.8%
Taylor expanded in t around inf 77.7%
Taylor expanded in y around inf 64.3%
Final simplification70.4%
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 (<= t_1 5e+285) (/ x t_1) (* (/ x (- y z)) (/ -1.0 z)))))
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 <= 5e+285) {
tmp = x / t_1;
} else {
tmp = (x / (y - z)) * (-1.0 / 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) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if (t_1 <= 5d+285) then
tmp = x / t_1
else
tmp = (x / (y - z)) * ((-1.0d0) / 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 t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 5e+285) {
tmp = x / t_1;
} else {
tmp = (x / (y - z)) * (-1.0 / z);
}
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 <= 5e+285: tmp = x / t_1 else: tmp = (x / (y - z)) * (-1.0 / z) 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 <= 5e+285) tmp = Float64(x / t_1); else tmp = Float64(Float64(x / Float64(y - z)) * Float64(-1.0 / z)); 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 <= 5e+285)
tmp = x / t_1;
else
tmp = (x / (y - z)) * (-1.0 / 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_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+285], N[(x / t$95$1), $MachinePrecision], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $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 5 \cdot 10^{+285}:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - z} \cdot \frac{-1}{z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < 5.00000000000000016e285Initial program 96.0%
if 5.00000000000000016e285 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 73.0%
associate-/r*99.9%
div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 87.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 (<= z -8.8e+17) (not (<= z 1.45e-19))) (/ (/ x z) (- z t)) (/ (/ x y) (- t z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.8e+17) || !(z <= 1.45e-19)) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / y) / (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 <= (-8.8d+17)) .or. (.not. (z <= 1.45d-19))) then
tmp = (x / z) / (z - t)
else
tmp = (x / y) / (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 <= -8.8e+17) || !(z <= 1.45e-19)) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / y) / (t - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -8.8e+17) or not (z <= 1.45e-19): tmp = (x / z) / (z - t) else: tmp = (x / y) / (t - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -8.8e+17) || !(z <= 1.45e-19)) tmp = Float64(Float64(x / z) / Float64(z - t)); else tmp = Float64(Float64(x / y) / 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 <= -8.8e+17) || ~((z <= 1.45e-19)))
tmp = (x / z) / (z - t);
else
tmp = (x / y) / (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, -8.8e+17], N[Not[LessEqual[z, 1.45e-19]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+17} \lor \neg \left(z \leq 1.45 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\end{array}
\end{array}
if z < -8.8e17 or 1.45e-19 < z Initial program 83.2%
Taylor expanded in y around 0 74.3%
mul-1-neg74.3%
associate-/r*84.7%
distribute-neg-frac284.7%
sub-neg84.7%
+-commutative84.7%
distribute-neg-in84.7%
remove-double-neg84.7%
unsub-neg84.7%
Simplified84.7%
if -8.8e17 < z < 1.45e-19Initial program 94.1%
Taylor expanded in y around inf 73.8%
associate-/r*76.8%
Simplified76.8%
Final simplification80.6%
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 -4e-36) (/ (/ x y) (- t z)) (if (<= t 0.205) (/ (/ x z) (- 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 <= -4e-36) {
tmp = (x / y) / (t - z);
} else if (t <= 0.205) {
tmp = (x / z) / (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 <= (-4d-36)) then
tmp = (x / y) / (t - z)
else if (t <= 0.205d0) then
tmp = (x / z) / (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 <= -4e-36) {
tmp = (x / y) / (t - z);
} else if (t <= 0.205) {
tmp = (x / z) / (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 <= -4e-36: tmp = (x / y) / (t - z) elif t <= 0.205: tmp = (x / z) / (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 <= -4e-36) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 0.205) tmp = Float64(Float64(x / z) / 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 <= -4e-36)
tmp = (x / y) / (t - z);
elseif (t <= 0.205)
tmp = (x / z) / (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, -4e-36], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.205], N[(N[(x / z), $MachinePrecision] / N[(z - y), $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 -4 \cdot 10^{-36}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 0.205:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -3.9999999999999998e-36Initial program 86.4%
Taylor expanded in y around inf 54.3%
associate-/r*59.2%
Simplified59.2%
if -3.9999999999999998e-36 < t < 0.204999999999999988Initial program 88.1%
Taylor expanded in t around 0 70.4%
mul-1-neg70.4%
associate-/r*80.4%
distribute-neg-frac280.4%
neg-sub080.4%
sub-neg80.4%
+-commutative80.4%
associate--r+80.4%
neg-sub080.4%
remove-double-neg80.4%
Simplified80.4%
if 0.204999999999999988 < t Initial program 91.7%
Taylor expanded in t around inf 86.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 -7.5e-104) (/ (/ x y) (- t z)) (if (<= y 1.35e-64) (/ 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 <= -7.5e-104) {
tmp = (x / y) / (t - z);
} else if (y <= 1.35e-64) {
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 <= (-7.5d-104)) then
tmp = (x / y) / (t - z)
else if (y <= 1.35d-64) 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 <= -7.5e-104) {
tmp = (x / y) / (t - z);
} else if (y <= 1.35e-64) {
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 <= -7.5e-104: tmp = (x / y) / (t - z) elif y <= 1.35e-64: 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 <= -7.5e-104) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 1.35e-64) 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 <= -7.5e-104)
tmp = (x / y) / (t - z);
elseif (y <= 1.35e-64)
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, -7.5e-104], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e-64], 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 -7.5 \cdot 10^{-104}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-64}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -7.5e-104Initial program 86.0%
Taylor expanded in y around inf 72.7%
associate-/r*79.3%
Simplified79.3%
if -7.5e-104 < y < 1.34999999999999993e-64Initial program 94.1%
Taylor expanded in y around 0 85.6%
mul-1-neg85.6%
distribute-rgt-neg-in85.6%
sub-neg85.6%
+-commutative85.6%
distribute-neg-in85.6%
remove-double-neg85.6%
unsub-neg85.6%
Simplified85.6%
if 1.34999999999999993e-64 < y Initial program 86.8%
associate-/l/98.7%
Simplified98.7%
Taylor expanded in t around inf 63.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 (<= y -7e-104) (/ x (* y (- t z))) (if (<= y 1.8e-61) (/ 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 <= -7e-104) {
tmp = x / (y * (t - z));
} else if (y <= 1.8e-61) {
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 <= (-7d-104)) then
tmp = x / (y * (t - z))
else if (y <= 1.8d-61) 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 <= -7e-104) {
tmp = x / (y * (t - z));
} else if (y <= 1.8e-61) {
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 <= -7e-104: tmp = x / (y * (t - z)) elif y <= 1.8e-61: 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 <= -7e-104) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 1.8e-61) 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 <= -7e-104)
tmp = x / (y * (t - z));
elseif (y <= 1.8e-61)
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, -7e-104], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e-61], 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 -7 \cdot 10^{-104}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-61}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -7.00000000000000057e-104Initial program 86.0%
Taylor expanded in y around inf 72.7%
*-commutative72.7%
Simplified72.7%
if -7.00000000000000057e-104 < y < 1.80000000000000007e-61Initial program 94.1%
Taylor expanded in y around 0 84.5%
mul-1-neg84.5%
distribute-rgt-neg-in84.5%
sub-neg84.5%
+-commutative84.5%
distribute-neg-in84.5%
remove-double-neg84.5%
unsub-neg84.5%
Simplified84.5%
if 1.80000000000000007e-61 < y Initial program 86.6%
associate-/l/98.7%
Simplified98.7%
Taylor expanded in t around inf 63.3%
Final simplification73.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 (<= z -1.18e+21) (/ (/ x z) z) (if (<= z 1.25e-19) (/ x (* y (- t z))) (/ x (* z (- z t))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.18e+21) {
tmp = (x / z) / z;
} else if (z <= 1.25e-19) {
tmp = x / (y * (t - z));
} else {
tmp = x / (z * (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 (z <= (-1.18d+21)) then
tmp = (x / z) / z
else if (z <= 1.25d-19) then
tmp = x / (y * (t - z))
else
tmp = x / (z * (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 (z <= -1.18e+21) {
tmp = (x / z) / z;
} else if (z <= 1.25e-19) {
tmp = x / (y * (t - z));
} else {
tmp = x / (z * (z - t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.18e+21: tmp = (x / z) / z elif z <= 1.25e-19: tmp = x / (y * (t - z)) else: tmp = x / (z * (z - t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.18e+21) tmp = Float64(Float64(x / z) / z); elseif (z <= 1.25e-19) tmp = Float64(x / Float64(y * Float64(t - z))); else tmp = Float64(x / Float64(z * Float64(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 (z <= -1.18e+21)
tmp = (x / z) / z;
elseif (z <= 1.25e-19)
tmp = x / (y * (t - z));
else
tmp = x / (z * (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[z, -1.18e+21], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.25e-19], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.18 \cdot 10^{+21}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\end{array}
\end{array}
if z < -1.18e21Initial program 79.8%
Taylor expanded in y around 0 76.4%
mul-1-neg76.4%
associate-/r*91.0%
distribute-neg-frac291.0%
sub-neg91.0%
+-commutative91.0%
distribute-neg-in91.0%
remove-double-neg91.0%
unsub-neg91.0%
Simplified91.0%
Taylor expanded in z around inf 86.0%
if -1.18e21 < z < 1.2500000000000001e-19Initial program 94.1%
Taylor expanded in y around inf 73.8%
*-commutative73.8%
Simplified73.8%
if 1.2500000000000001e-19 < z Initial program 86.0%
Taylor expanded in y around 0 72.5%
mul-1-neg72.5%
distribute-rgt-neg-in72.5%
sub-neg72.5%
+-commutative72.5%
distribute-neg-in72.5%
remove-double-neg72.5%
unsub-neg72.5%
Simplified72.5%
Final simplification76.1%
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 -5e+23) (not (<= z 6.8e+50))) (/ (/ 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 <= -5e+23) || !(z <= 6.8e+50)) {
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 <= (-5d+23)) .or. (.not. (z <= 6.8d+50))) 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 <= -5e+23) || !(z <= 6.8e+50)) {
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 <= -5e+23) or not (z <= 6.8e+50): 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 <= -5e+23) || !(z <= 6.8e+50)) 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 <= -5e+23) || ~((z <= 6.8e+50)))
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, -5e+23], N[Not[LessEqual[z, 6.8e+50]], $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 -5 \cdot 10^{+23} \lor \neg \left(z \leq 6.8 \cdot 10^{+50}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -4.9999999999999999e23 or 6.7999999999999997e50 < z Initial program 81.5%
Taylor expanded in y around 0 77.1%
mul-1-neg77.1%
associate-/r*88.6%
distribute-neg-frac288.6%
sub-neg88.6%
+-commutative88.6%
distribute-neg-in88.6%
remove-double-neg88.6%
unsub-neg88.6%
Simplified88.6%
Taylor expanded in z around inf 81.5%
if -4.9999999999999999e23 < z < 6.7999999999999997e50Initial program 94.5%
associate-/l/95.0%
Simplified95.0%
Taylor expanded in t around inf 73.1%
Taylor expanded in y around inf 58.7%
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 -1.1e+19) (not (<= z 6.6e+50))) (/ 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 <= -1.1e+19) || !(z <= 6.6e+50)) {
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 <= (-1.1d+19)) .or. (.not. (z <= 6.6d+50))) 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 <= -1.1e+19) || !(z <= 6.6e+50)) {
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 <= -1.1e+19) or not (z <= 6.6e+50): 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 <= -1.1e+19) || !(z <= 6.6e+50)) 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 <= -1.1e+19) || ~((z <= 6.6e+50)))
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, -1.1e+19], N[Not[LessEqual[z, 6.6e+50]], $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 -1.1 \cdot 10^{+19} \lor \neg \left(z \leq 6.6 \cdot 10^{+50}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.1e19 or 6.6000000000000001e50 < z Initial program 81.5%
Taylor expanded in y around 0 77.1%
mul-1-neg77.1%
distribute-rgt-neg-in77.1%
sub-neg77.1%
+-commutative77.1%
distribute-neg-in77.1%
remove-double-neg77.1%
unsub-neg77.1%
Simplified77.1%
Taylor expanded in z around inf 73.0%
if -1.1e19 < z < 6.6000000000000001e50Initial program 94.5%
associate-/l/95.0%
Simplified95.0%
Taylor expanded in t around inf 73.1%
Taylor expanded in y around inf 58.7%
Final simplification65.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 (or (<= z -1.1e+18) (not (<= z 6.6e+50))) (/ x (* z z)) (/ 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.1e+18) || !(z <= 6.6e+50)) {
tmp = x / (z * z);
} 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.1d+18)) .or. (.not. (z <= 6.6d+50))) then
tmp = x / (z * z)
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.1e+18) || !(z <= 6.6e+50)) {
tmp = x / (z * z);
} 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.1e+18) or not (z <= 6.6e+50): tmp = x / (z * z) 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.1e+18) || !(z <= 6.6e+50)) tmp = Float64(x / Float64(z * z)); 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 <= -1.1e+18) || ~((z <= 6.6e+50)))
tmp = x / (z * z);
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.1e+18], N[Not[LessEqual[z, 6.6e+50]], $MachinePrecision]], N[(x / N[(z * z), $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 -1.1 \cdot 10^{+18} \lor \neg \left(z \leq 6.6 \cdot 10^{+50}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.1e18 or 6.6000000000000001e50 < z Initial program 81.5%
Taylor expanded in y around 0 77.1%
mul-1-neg77.1%
distribute-rgt-neg-in77.1%
sub-neg77.1%
+-commutative77.1%
distribute-neg-in77.1%
remove-double-neg77.1%
unsub-neg77.1%
Simplified77.1%
Taylor expanded in z around inf 73.0%
if -1.1e18 < z < 6.6000000000000001e50Initial program 94.5%
Taylor expanded in z around 0 55.4%
Final simplification63.1%
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.7e+24) (not (<= z 3.7e+51))) (/ 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 <= -1.7e+24) || !(z <= 3.7e+51)) {
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 <= (-1.7d+24)) .or. (.not. (z <= 3.7d+51))) 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 <= -1.7e+24) || !(z <= 3.7e+51)) {
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 <= -1.7e+24) or not (z <= 3.7e+51): 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 <= -1.7e+24) || !(z <= 3.7e+51)) 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 <= -1.7e+24) || ~((z <= 3.7e+51)))
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, -1.7e+24], N[Not[LessEqual[z, 3.7e+51]], $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 -1.7 \cdot 10^{+24} \lor \neg \left(z \leq 3.7 \cdot 10^{+51}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.7e24 or 3.7000000000000002e51 < z Initial program 81.5%
Taylor expanded in y around 0 77.1%
mul-1-neg77.1%
distribute-rgt-neg-in77.1%
sub-neg77.1%
+-commutative77.1%
distribute-neg-in77.1%
remove-double-neg77.1%
unsub-neg77.1%
Simplified77.1%
Taylor expanded in z around 0 43.6%
associate-*r/43.6%
mul-1-neg43.6%
*-commutative43.6%
Simplified43.6%
distribute-frac-neg43.6%
associate-/r*50.3%
distribute-frac-neg250.3%
*-un-lft-identity50.3%
*-commutative50.3%
add-sqr-sqrt17.9%
sqrt-unprod40.1%
sqr-neg40.1%
sqrt-unprod31.6%
add-sqr-sqrt46.2%
Applied egg-rr46.2%
*-rgt-identity46.2%
associate-/r*41.2%
Simplified41.2%
if -1.7e24 < z < 3.7000000000000002e51Initial program 94.5%
Taylor expanded in z around 0 55.4%
Final simplification49.2%
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 88.8%
Taylor expanded in z around 0 39.0%
Final simplification39.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024165
(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))))